Skip to content

Commit

Permalink
[2020-02] Backport r4-conv-i fixes (#20986)
Browse files Browse the repository at this point in the history
* [mini] Add missing opcodes for r4 to native int conversions

* [interp] Add handling for conv.i from r4
  • Loading branch information
BrzVlad committed Mar 30, 2021
1 parent fcbc455 commit 225ba3c
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions mono/mini/cpu-arm.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ rmove: dest:f src1:f len:4
r4_conv_to_i1: dest:i src1:f len:88
r4_conv_to_i2: dest:i src1:f len:88
r4_conv_to_i4: dest:i src1:f len:88
r4_conv_to_i: dest:i src1:f len:88
r4_conv_to_u1: dest:i src1:f len:88
r4_conv_to_u2: dest:i src1:f len:88
r4_conv_to_u4: dest:i src1:f len:88
Expand Down
1 change: 1 addition & 0 deletions mono/mini/cpu-arm64.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ r4_conv_to_u2: dest:i src1:f len:8
r4_conv_to_i4: dest:i src1:f len:8
r4_conv_to_u4: dest:i src1:f len:8
r4_conv_to_i8: dest:l src1:f len:8
r4_conv_to_i: dest:l src1:f len:8
r4_conv_to_u8: dest:l src1:f len:8
r4_conv_to_r4: dest:f src1:f len:4
r4_conv_to_r8: dest:f src1:f len:4
Expand Down
7 changes: 7 additions & 0 deletions mono/mini/interp/transform.c
Original file line number Diff line number Diff line change
Expand Up @@ -4201,6 +4201,13 @@ generate_code (TransformData *td, MonoMethod *method, MonoMethodHeader *header,
interp_add_ins (td, MINT_CONV_I8_R8);
#else
interp_add_ins (td, MINT_CONV_I4_R8);
#endif
break;
case STACK_TYPE_R4:
#if SIZEOF_VOID_P == 8
interp_add_ins (td, MINT_CONV_I8_R4);
#else
interp_add_ins (td, MINT_CONV_I4_R4);
#endif
break;
case STACK_TYPE_I4:
Expand Down
1 change: 1 addition & 0 deletions mono/mini/mini-arm.c
Original file line number Diff line number Diff line change
Expand Up @@ -5909,6 +5909,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
code = emit_r4_to_int (cfg, code, ins->dreg, ins->sreg1, 2, FALSE);
break;
case OP_RCONV_TO_I4:
case OP_RCONV_TO_I:
code = emit_r4_to_int (cfg, code, ins->dreg, ins->sreg1, 4, TRUE);
break;
case OP_RCONV_TO_U4:
Expand Down
1 change: 1 addition & 0 deletions mono/mini/mini-arm64.c
Original file line number Diff line number Diff line change
Expand Up @@ -4304,6 +4304,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
arm_fcvtzu_sx (code, dreg, sreg1);
break;
case OP_RCONV_TO_I8:
case OP_RCONV_TO_I:
arm_fcvtzs_sx (code, dreg, sreg1);
break;
case OP_RCONV_TO_U8:
Expand Down

0 comments on commit 225ba3c

Please sign in to comment.