[mini] Really fix the float <-> int data transfer instructions on arm.
authorAlex Rønne Petersen <alexrp@xamarin.com>
Thu, 5 Feb 2015 03:58:23 +0000 (04:58 +0100)
committerAlex Rønne Petersen <alexrp@xamarin.com>
Thu, 5 Feb 2015 03:59:47 +0000 (04:59 +0100)
The ARM_CVTS/ARM_CVTD macros have somewhat deceptive names: They
describe the source data type, not the target data type.

mono/mini/mini-arm.c

index 3d16b711522f57d61e3a63ab8ccc7c3979f6dde8..144e86a352137d1bd39305fccb899ba0aba12e51 100644 (file)
@@ -4835,13 +4835,13 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                        break;
                case OP_MOVE_F_TO_I4:
                        code = mono_arm_emit_vfp_scratch_save (cfg, code, vfp_scratch1);
-                       ARM_CVTS (code, vfp_scratch1, ins->sreg1);
+                       ARM_CVTD (code, vfp_scratch1, ins->sreg1);
                        ARM_FMRS (code, ins->dreg, vfp_scratch1);
                        code = mono_arm_emit_vfp_scratch_restore (cfg, code, vfp_scratch1);
                        break;
                case OP_MOVE_I4_TO_F:
                        ARM_FMSR (code, ins->dreg, ins->sreg1);
-                       ARM_CVTD (code, ins->dreg, ins->dreg);
+                       ARM_CVTS (code, ins->dreg, ins->dreg);
                        break;
                case OP_FCONV_TO_R4:
                        if (IS_VFP) {