mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
FFI: Fix FOLD rule for TOBIT + CONV num.u32.
Thanks to Jiale Zhi.
This commit is contained in:
parent
5c0e33c2aa
commit
1f578bd424
@ -1006,11 +1006,16 @@ LJFOLDF(simplify_conv_flt_num)
|
|||||||
LJFOLD(TOBIT CONV KNUM)
|
LJFOLD(TOBIT CONV KNUM)
|
||||||
LJFOLDF(simplify_tobit_conv)
|
LJFOLDF(simplify_tobit_conv)
|
||||||
{
|
{
|
||||||
if ((fleft->op2 & IRCONV_SRCMASK) == IRT_INT ||
|
/* Fold even across PHI to avoid expensive num->int conversions in loop. */
|
||||||
(fleft->op2 & IRCONV_SRCMASK) == IRT_U32) {
|
if ((fleft->op2 & IRCONV_SRCMASK) == IRT_INT) {
|
||||||
/* Fold even across PHI to avoid expensive num->int conversions in loop. */
|
|
||||||
lua_assert(irt_isnum(fleft->t));
|
lua_assert(irt_isnum(fleft->t));
|
||||||
return fleft->op1;
|
return fleft->op1;
|
||||||
|
} else if ((fleft->op2 & IRCONV_SRCMASK) == IRT_U32) {
|
||||||
|
lua_assert(irt_isnum(fleft->t));
|
||||||
|
fins->o = IR_CONV;
|
||||||
|
fins->op1 = fleft->op1;
|
||||||
|
fins->op2 = (IRT_INT<<5)|IRT_U32;
|
||||||
|
return RETRYFOLD;
|
||||||
}
|
}
|
||||||
return NEXTFOLD;
|
return NEXTFOLD;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user