diff --git a/compiler/noirc_evaluator/src/ssa/ir/instruction.rs b/compiler/noirc_evaluator/src/ssa/ir/instruction.rs index 23abcb34d20..33bafc2fbb6 100644 --- a/compiler/noirc_evaluator/src/ssa/ir/instruction.rs +++ b/compiler/noirc_evaluator/src/ssa/ir/instruction.rs @@ -222,7 +222,13 @@ pub enum Instruction { /// Binary Operations like +, -, *, /, ==, != Binary(Binary), - /// Converts `Value` into the given NumericType + /// Converts `Value` into the given `NumericType` + /// + /// This operation only changes the type of the value, it does not change the value itself. + /// It is expected that the value can fit into the target type. + /// For instance a value of type `u32` casted to `u8` must already fit into 8 bits + /// A value of type `i8` cannot be casted to 'i16' since the value would need to include the sign bit (which is the MSB) + /// Ssa code-gen must ensure that the necessary truncation or sign extension is performed when emitting a Cast instruction. Cast(ValueId, NumericType), /// Computes a bit wise not