2005-10-08 Zoltan Varga <vargaz@gmail.com>
+ * basic-float.cs: Add test for precision of float arithmetic.
+
+ * mini-ia64.c (mono_arch_output_basic_block): Convert to/from doubles
+ when loading/storing single values from/to memory.
+
* mini.c (mono_jit_compile_method_with_opt): Create the function
pointers in the correct domain.
return result;
}
+ static int test_0_float_precision () {
+ float f1 = 3.40282346638528859E+38f;
+ float f2 = 3.40282346638528859E+38f;
+ float PositiveInfinity = 1.0f / 0.0f;
+ float f = f1 + f2;
+
+ return f == PositiveInfinity ? 0 : 1;
+ }
}
ia64_stfd_hint (code, ins->inst_destbasereg, ins->sreg1, 0);
break;
case OP_STORER4_MEMBASE_REG:
- ia64_stfs_hint (code, ins->inst_destbasereg, ins->sreg1, 0);
+ ia64_fnorm_s_sf (code, FP_SCRATCH_REG, ins->sreg1, 0);
+ ia64_stfs_hint (code, ins->inst_destbasereg, FP_SCRATCH_REG, 0);
break;
case OP_LOADR8_MEMBASE:
ia64_ldfd (code, ins->dreg, ins->inst_basereg);
break;
case OP_LOADR4_MEMBASE:
ia64_ldfs (code, ins->dreg, ins->inst_basereg);
+ ia64_fnorm_d_sf (code, ins->dreg, ins->dreg, 0);
break;
case CEE_CONV_R4:
ia64_setf_sig (code, ins->dreg, ins->sreg1);