ARM: Fix math.ldexp() recording and folding.
This commit is contained in:
@@ -434,8 +434,17 @@ static void LJ_FASTCALL recff_math_unary(jit_State *J, RecordFFData *rd)
|
||||
J->base[0] = emitir(IRTN(IR_FPMATH), lj_ir_tonum(J, J->base[0]), rd->data);
|
||||
}
|
||||
|
||||
/* Record binary math.* functions math.atan2 and math.ldexp. */
|
||||
static void LJ_FASTCALL recff_math_binary(jit_State *J, RecordFFData *rd)
|
||||
/* Record math.atan2. */
|
||||
static void LJ_FASTCALL recff_math_atan2(jit_State *J, RecordFFData *rd)
|
||||
{
|
||||
TRef tr = lj_ir_tonum(J, J->base[0]);
|
||||
TRef tr2 = lj_ir_tonum(J, J->base[1]);
|
||||
J->base[0] = emitir(IRTN(IR_ATAN2), tr, tr2);
|
||||
UNUSED(rd);
|
||||
}
|
||||
|
||||
/* Record math.ldexp. */
|
||||
static void LJ_FASTCALL recff_math_ldexp(jit_State *J, RecordFFData *rd)
|
||||
{
|
||||
TRef tr = lj_ir_tonum(J, J->base[0]);
|
||||
#if LJ_TARGET_X86ORX64
|
||||
@@ -443,7 +452,8 @@ static void LJ_FASTCALL recff_math_binary(jit_State *J, RecordFFData *rd)
|
||||
#else
|
||||
TRef tr2 = lj_opt_narrow_toint(J, J->base[1]);
|
||||
#endif
|
||||
J->base[0] = emitir(IRTN(rd->data), tr, tr2);
|
||||
J->base[0] = emitir(IRTN(IR_LDEXP), tr, tr2);
|
||||
UNUSED(rd);
|
||||
}
|
||||
|
||||
/* Record math.asin, math.acos, math.atan. */
|
||||
|
||||
Reference in New Issue
Block a user