Skip to content

Commit

Permalink
Don't compile math.modf() anymore.
Browse files Browse the repository at this point in the history
It's rarely used and properly compiling it would be difficult.
  • Loading branch information
Mike Pall committed May 22, 2020
1 parent 03208c8 commit d75e262
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
2 changes: 1 addition & 1 deletion src/lib_math.c
Expand Up @@ -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)
{
Expand Down
16 changes: 0 additions & 16 deletions src/lj_ffrecord.c
Expand Up @@ -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],
Expand Down

0 comments on commit d75e262

Please sign in to comment.