@@ -501,7 +501,7 @@ static bool validate_argument(emit_inline_asm_t *emit, qstr opcode_qstr,
501
501
return false;
502
502
}
503
503
504
- mp_uint_t immediate = mp_obj_get_int_truncated (object ) << shift ;
504
+ mp_uint_t immediate = (( mp_uint_t ) mp_obj_get_int_truncated (object ) ) << shift ;
505
505
if (kind & U ) {
506
506
if (!is_in_unsigned_mask (mask , immediate )) {
507
507
goto out_of_range ;
@@ -660,7 +660,7 @@ static void handle_opcode(emit_inline_asm_t *emit, qstr opcode, const opcode_t *
660
660
parse_register_node (arguments [1 ], & rs1 , opcode_data -> argument2_kind & C );
661
661
mp_obj_t object ;
662
662
mp_parse_node_get_int_maybe (arguments [2 ], & object );
663
- mp_uint_t immediate = mp_obj_get_int_truncated (object ) << opcode_data -> argument3_shift ;
663
+ mp_uint_t immediate = (( mp_uint_t ) mp_obj_get_int_truncated (object ) ) << opcode_data -> argument3_shift ;
664
664
((call_rri_t )opcode_data -> emitter )(& emit -> as , rd , rs1 , immediate );
665
665
break ;
666
666
}
@@ -669,7 +669,7 @@ static void handle_opcode(emit_inline_asm_t *emit, qstr opcode, const opcode_t *
669
669
parse_register_node (arguments [0 ], & rd , opcode_data -> argument1_kind & C );
670
670
mp_obj_t object ;
671
671
mp_parse_node_get_int_maybe (arguments [1 ], & object );
672
- mp_uint_t immediate = mp_obj_get_int_truncated (object ) << opcode_data -> argument2_shift ;
672
+ mp_uint_t immediate = (( mp_uint_t ) mp_obj_get_int_truncated (object ) ) << opcode_data -> argument2_shift ;
673
673
((call_ri_t )opcode_data -> emitter )(& emit -> as , rd , immediate );
674
674
break ;
675
675
}
0 commit comments