ARM: Handle large offsets in emit_float_args ().
authorAlex Rønne Petersen <alexrp@xamarin.com>
Tue, 18 Feb 2014 20:24:44 +0000 (21:24 +0100)
committerAlex Rønne Petersen <alexrp@xamarin.com>
Tue, 18 Feb 2014 22:22:53 +0000 (23:22 +0100)
mono/mini/mini-arm.c

index 054b5ccb51bad306383d72845fc06cd9b41112af..d32d0e9a00f81331ee02b692968300b50654e3cc 100644 (file)
@@ -520,7 +520,8 @@ emit_float_args (MonoCompile *cfg, MonoCallInst *inst, guint8 *code, int *max_le
                FloatArgData *fad = list->data;
                MonoInst *var = get_vreg_to_inst (cfg, fad->vreg);
 
-               *max_len += 4;
+               /* 4+1 insns for emit_big_add () and 1 for FLDS. */
+               *max_len += 20 + 4 + 4;
 
                if (*offset + *max_len > cfg->code_size) {
                        cfg->code_size += *max_len;
@@ -529,7 +530,8 @@ emit_float_args (MonoCompile *cfg, MonoCallInst *inst, guint8 *code, int *max_le
                        code = cfg->native_code + *offset;
                }
 
-               ARM_FLDS (code, fad->hreg, var->inst_basereg, var->inst_offset);
+               code = emit_big_add (code, ARMREG_LR, var->inst_basereg, var->inst_offset);
+               ARM_FLDS (code, fad->hreg, ARMREG_LR, 0);
 
                *offset = code - cfg->native_code;
        }