[jit] Emulate OP_RREM if OP_FREM is emulated. Fixes #30698.
authorZoltan Varga <vargaz@gmail.com>
Wed, 3 Jun 2015 18:40:24 +0000 (14:40 -0400)
committerZoltan Varga <vargaz@gmail.com>
Wed, 3 Jun 2015 18:40:24 +0000 (14:40 -0400)
mono/mini/basic-float.cs
mono/mini/mini-runtime.c

index ed62046b8a2cabdcab252e5020577d69e96e69cd..a5ccf787e73886fa0747e3d6feb2b0811bfc1e52 100644 (file)
@@ -704,6 +704,12 @@ class Tests
                return (int)(f1 / f2);
        }
 
+       public static int test_1_frem_r4 () {
+               float f1 = 7.0f;
+               float f2 = 2.0f;
+               return (int)(f1 % f2);
+       }
+
        public static int test_0_fcmp_eq_r4 () {
                float f1 = 1.0f;
                float f2 = 1.0f;
index 98a0b124fd50317022514d50dca333f5dd785ffa..5485d390c6c106e3dff4a6775f61ee0c670e3e20 100644 (file)
@@ -3316,6 +3316,7 @@ register_icalls (void)
 #ifdef MONO_ARCH_EMULATE_FREM
 #if defined(__default_codegen__)
        register_opcode_emulation (OP_FREM, "__emul_frem", "double double double", fmod, "fmod", FALSE);
+       register_opcode_emulation (OP_RREM, "__emul_rrem", "float float float", fmodf, "fmodf", FALSE);
 #elif defined(__native_client_codegen__)
        register_opcode_emulation (OP_FREM, "__emul_frem", "double double double", mono_fmod, "mono_fmod", FALSE);
 #endif