diff options
author | Mike Pall <mike> | 2020-05-22 03:10:50 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2020-05-22 03:13:57 +0200 |
commit | d75e26275bdcfe95283b761ef9405841ef2d406f (patch) | |
tree | daf6ba5a7f2b66e61e464f18ad6298c68a352db5 | |
parent | 03208c8162af9cc01ca76ee1676ca79e5abe9b60 (diff) | |
download | luajit-d75e26275bdcfe95283b761ef9405841ef2d406f.tar.gz luajit-d75e26275bdcfe95283b761ef9405841ef2d406f.tar.bz2 luajit-d75e26275bdcfe95283b761ef9405841ef2d406f.zip |
Don't compile math.modf() anymore.
It's rarely used and properly compiling it would be difficult.
-rw-r--r-- | src/lib_math.c | 2 | ||||
-rw-r--r-- | src/lj_ffrecord.c | 16 |
2 files changed, 1 insertions, 17 deletions
diff --git a/src/lib_math.c b/src/lib_math.c index 3fd466ca..02aa21d7 100644 --- a/src/lib_math.c +++ b/src/lib_math.c | |||
@@ -45,7 +45,7 @@ LJLIB_ASM_(math_sinh) LJLIB_REC(math_htrig IRCALL_sinh) | |||
45 | LJLIB_ASM_(math_cosh) LJLIB_REC(math_htrig IRCALL_cosh) | 45 | LJLIB_ASM_(math_cosh) LJLIB_REC(math_htrig IRCALL_cosh) |
46 | LJLIB_ASM_(math_tanh) LJLIB_REC(math_htrig IRCALL_tanh) | 46 | LJLIB_ASM_(math_tanh) LJLIB_REC(math_htrig IRCALL_tanh) |
47 | LJLIB_ASM_(math_frexp) | 47 | LJLIB_ASM_(math_frexp) |
48 | LJLIB_ASM_(math_modf) LJLIB_REC(.) | 48 | LJLIB_ASM_(math_modf) |
49 | 49 | ||
50 | LJLIB_ASM(math_log) LJLIB_REC(math_log) | 50 | LJLIB_ASM(math_log) LJLIB_REC(math_log) |
51 | { | 51 | { |
diff --git a/src/lj_ffrecord.c b/src/lj_ffrecord.c index 5282217f..436d5037 100644 --- a/src/lj_ffrecord.c +++ b/src/lj_ffrecord.c | |||
@@ -601,22 +601,6 @@ static void LJ_FASTCALL recff_math_htrig(jit_State *J, RecordFFData *rd) | |||
601 | J->base[0] = emitir(IRTN(IR_CALLN), tr, rd->data); | 601 | J->base[0] = emitir(IRTN(IR_CALLN), tr, rd->data); |
602 | } | 602 | } |
603 | 603 | ||
604 | static void LJ_FASTCALL recff_math_modf(jit_State *J, RecordFFData *rd) | ||
605 | { | ||
606 | TRef tr = J->base[0]; | ||
607 | if (tref_isinteger(tr)) { | ||
608 | J->base[0] = tr; | ||
609 | J->base[1] = lj_ir_kint(J, 0); | ||
610 | } else { | ||
611 | TRef trt; | ||
612 | tr = lj_ir_tonum(J, tr); | ||
613 | trt = emitir(IRTN(IR_FPMATH), tr, IRFPM_TRUNC); | ||
614 | J->base[0] = trt; | ||
615 | J->base[1] = emitir(IRTN(IR_SUB), tr, trt); | ||
616 | } | ||
617 | rd->nres = 2; | ||
618 | } | ||
619 | |||
620 | static void LJ_FASTCALL recff_math_pow(jit_State *J, RecordFFData *rd) | 604 | static void LJ_FASTCALL recff_math_pow(jit_State *J, RecordFFData *rd) |
621 | { | 605 | { |
622 | J->base[0] = lj_opt_narrow_pow(J, J->base[0], J->base[1], | 606 | J->base[0] = lj_opt_narrow_pow(J, J->base[0], J->base[1], |