]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Don't compile math.modf() anymore.
authorMike Pall <mike>
Fri, 22 May 2020 01:10:50 +0000 (03:10 +0200)
committerMike Pall <mike>
Fri, 22 May 2020 01:13:57 +0000 (03:13 +0200)
It's rarely used and properly compiling it would be difficult.

src/lib_math.c
src/lj_ffrecord.c

index 3fd466cad2aab98a47a3b35de77629a162723018..02aa21d7601d91a32d713db43d4ecb2872fb40ef 100644 (file)
@@ -45,7 +45,7 @@ LJLIB_ASM_(math_sinh)         LJLIB_REC(math_htrig IRCALL_sinh)
 LJLIB_ASM_(math_cosh)          LJLIB_REC(math_htrig IRCALL_cosh)
 LJLIB_ASM_(math_tanh)          LJLIB_REC(math_htrig IRCALL_tanh)
 LJLIB_ASM_(math_frexp)
-LJLIB_ASM_(math_modf)          LJLIB_REC(.)
+LJLIB_ASM_(math_modf)
 
 LJLIB_ASM(math_log)            LJLIB_REC(math_log)
 {
index 5282217f99385777746d2eec4e1f78cf1bd82f71..436d5037f566e4c878ac2ecb1659cb53d4ac1ff3 100644 (file)
@@ -601,22 +601,6 @@ static void LJ_FASTCALL recff_math_htrig(jit_State *J, RecordFFData *rd)
   J->base[0] = emitir(IRTN(IR_CALLN), tr, rd->data);
 }
 
-static void LJ_FASTCALL recff_math_modf(jit_State *J, RecordFFData *rd)
-{
-  TRef tr = J->base[0];
-  if (tref_isinteger(tr)) {
-    J->base[0] = tr;
-    J->base[1] = lj_ir_kint(J, 0);
-  } else {
-    TRef trt;
-    tr = lj_ir_tonum(J, tr);
-    trt = emitir(IRTN(IR_FPMATH), tr, IRFPM_TRUNC);
-    J->base[0] = trt;
-    J->base[1] = emitir(IRTN(IR_SUB), tr, trt);
-  }
-  rd->nres = 2;
-}
-
 static void LJ_FASTCALL recff_math_pow(jit_State *J, RecordFFData *rd)
 {
   J->base[0] = lj_opt_narrow_pow(J, J->base[0], J->base[1],