summaryrefslogtreecommitdiff
path: root/src/lj_ffrecord.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_ffrecord.c')
-rw-r--r--src/lj_ffrecord.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/lj_ffrecord.c b/src/lj_ffrecord.c
index 8cc42406..067f66cf 100644
--- a/src/lj_ffrecord.c
+++ b/src/lj_ffrecord.c
@@ -434,8 +434,17 @@ static void LJ_FASTCALL recff_math_unary(jit_State *J, RecordFFData *rd)
434 J->base[0] = emitir(IRTN(IR_FPMATH), lj_ir_tonum(J, J->base[0]), rd->data); 434 J->base[0] = emitir(IRTN(IR_FPMATH), lj_ir_tonum(J, J->base[0]), rd->data);
435} 435}
436 436
437/* Record binary math.* functions math.atan2 and math.ldexp. */ 437/* Record math.atan2. */
438static void LJ_FASTCALL recff_math_binary(jit_State *J, RecordFFData *rd) 438static void LJ_FASTCALL recff_math_atan2(jit_State *J, RecordFFData *rd)
439{
440 TRef tr = lj_ir_tonum(J, J->base[0]);
441 TRef tr2 = lj_ir_tonum(J, J->base[1]);
442 J->base[0] = emitir(IRTN(IR_ATAN2), tr, tr2);
443 UNUSED(rd);
444}
445
446/* Record math.ldexp. */
447static void LJ_FASTCALL recff_math_ldexp(jit_State *J, RecordFFData *rd)
439{ 448{
440 TRef tr = lj_ir_tonum(J, J->base[0]); 449 TRef tr = lj_ir_tonum(J, J->base[0]);
441#if LJ_TARGET_X86ORX64 450#if LJ_TARGET_X86ORX64
@@ -443,7 +452,8 @@ static void LJ_FASTCALL recff_math_binary(jit_State *J, RecordFFData *rd)
443#else 452#else
444 TRef tr2 = lj_opt_narrow_toint(J, J->base[1]); 453 TRef tr2 = lj_opt_narrow_toint(J, J->base[1]);
445#endif 454#endif
446 J->base[0] = emitir(IRTN(rd->data), tr, tr2); 455 J->base[0] = emitir(IRTN(IR_LDEXP), tr, tr2);
456 UNUSED(rd);
447} 457}
448 458
449/* Record math.asin, math.acos, math.atan. */ 459/* Record math.asin, math.acos, math.atan. */