11use astoir_hir:: nodes:: { HIRNode , HIRNodeKind } ;
2- use astoir_mir:: { blocks:: refer:: MIRBlockReference , builder:: { build_float_add, build_float_div, build_float_mul, build_float_sub, build_int_add, build_int_div, build_int_mul, build_int_sub, build_shift_left, build_shift_right} , vals:: base:: BaseMIRValue } ;
2+ use astoir_mir:: { blocks:: refer:: MIRBlockReference , builder:: { build_float_add, build_float_div, build_float_mod , build_float_mul, build_float_sub, build_int_add, build_int_div, build_int_mod , build_int_mul, build_int_sub, build_shift_left, build_shift_right} , vals:: base:: BaseMIRValue } ;
33use compiler_typing:: raw:: RawType ;
44use compiler_utils:: operators:: { MathOperator , MathOperatorType } ;
55use diagnostics:: { DiagnosticResult , builders:: { make_math_operation_req_assign, make_req_type_kind} , unsure_panic} ;
@@ -55,7 +55,8 @@ pub fn lower_hir_math_operation_int(left: BaseMIRValue, right: BaseMIRValue, ope
5555 MathOperatorType :: Multiply => build_int_mul ( & mut ctx. mir_ctx , left, right, signed) ?,
5656 MathOperatorType :: Divide => build_int_div ( & mut ctx. mir_ctx , left, right, signed) ?,
5757 MathOperatorType :: ShiftLeft => build_shift_left ( & mut ctx. mir_ctx , left, right) ?,
58- MathOperatorType :: ShiftRight => build_shift_right ( & mut ctx. mir_ctx , left, right) ?
58+ MathOperatorType :: ShiftRight => build_shift_right ( & mut ctx. mir_ctx , left, right) ?,
59+ MathOperatorType :: Modulo => build_int_mod ( & mut ctx. mir_ctx , left, right, signed) ?
5960 } ;
6061
6162 return Ok ( res. into ( ) ) ;
@@ -72,6 +73,7 @@ pub fn lower_hir_math_operation_float(left: BaseMIRValue, right: BaseMIRValue, o
7273 MathOperatorType :: Subtract => build_float_sub ( & mut ctx. mir_ctx , left, right, signed) ?,
7374 MathOperatorType :: Multiply => build_float_mul ( & mut ctx. mir_ctx , left, right, signed) ?,
7475 MathOperatorType :: Divide => build_float_div ( & mut ctx. mir_ctx , left, right, signed) ?,
76+ MathOperatorType :: Modulo => build_float_mod ( & mut ctx. mir_ctx , left, right, signed) ?,
7577
7678 _ => return Err ( make_req_type_kind ( node, & "integer" . to_string ( ) ) . into ( ) )
7779 } ;
0 commit comments