mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
Minor improvements of optimizations.
This commit is contained in:
parent
09547f9f6e
commit
2182630903
12
src/lj_asm.c
12
src/lj_asm.c
@ -2319,13 +2319,23 @@ static void asm_setup_regsp(ASMState *as)
|
|||||||
}
|
}
|
||||||
/* fallthrough */ /* for integer POW */
|
/* fallthrough */ /* for integer POW */
|
||||||
case IR_DIV: case IR_MOD:
|
case IR_DIV: case IR_MOD:
|
||||||
if (!irt_isnum(ir->t)) {
|
if ((LJ_64 && LJ_SOFTFP) || !irt_isnum(ir->t)) {
|
||||||
ir->prev = REGSP_HINT(RID_RET);
|
ir->prev = REGSP_HINT(RID_RET);
|
||||||
if (inloop)
|
if (inloop)
|
||||||
as->modset |= (RSET_SCRATCH & RSET_GPR);
|
as->modset |= (RSET_SCRATCH & RSET_GPR);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#if LJ_64 && LJ_SOFTFP
|
||||||
|
case IR_ADD: case IR_SUB: case IR_MUL:
|
||||||
|
if (irt_isnum(ir->t)) {
|
||||||
|
ir->prev = REGSP_HINT(RID_RET);
|
||||||
|
if (inloop)
|
||||||
|
as->modset |= (RSET_SCRATCH & RSET_GPR);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
case IR_FPMATH:
|
case IR_FPMATH:
|
||||||
#if LJ_TARGET_X86ORX64
|
#if LJ_TARGET_X86ORX64
|
||||||
if (ir->op2 <= IRFPM_TRUNC) {
|
if (ir->op2 <= IRFPM_TRUNC) {
|
||||||
|
@ -514,6 +514,7 @@ LJFOLDF(kfold_snew_kptr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
LJFOLD(SNEW any KINT)
|
LJFOLD(SNEW any KINT)
|
||||||
|
LJFOLD(XSNEW any KINT)
|
||||||
LJFOLDF(kfold_snew_empty)
|
LJFOLDF(kfold_snew_empty)
|
||||||
{
|
{
|
||||||
if (fright->i == 0)
|
if (fright->i == 0)
|
||||||
@ -1301,6 +1302,10 @@ LJFOLD(CONV SUB IRCONV_U32_U64)
|
|||||||
LJFOLD(CONV MUL IRCONV_U32_U64)
|
LJFOLD(CONV MUL IRCONV_U32_U64)
|
||||||
LJFOLDF(simplify_conv_narrow)
|
LJFOLDF(simplify_conv_narrow)
|
||||||
{
|
{
|
||||||
|
#if LJ_64
|
||||||
|
UNUSED(J);
|
||||||
|
return NEXTFOLD;
|
||||||
|
#else
|
||||||
IROp op = (IROp)fleft->o;
|
IROp op = (IROp)fleft->o;
|
||||||
IRType t = irt_type(fins->t);
|
IRType t = irt_type(fins->t);
|
||||||
IRRef op1 = fleft->op1, op2 = fleft->op2, mode = fins->op2;
|
IRRef op1 = fleft->op1, op2 = fleft->op2, mode = fins->op2;
|
||||||
@ -1311,6 +1316,7 @@ LJFOLDF(simplify_conv_narrow)
|
|||||||
fins->op1 = op1;
|
fins->op1 = op1;
|
||||||
fins->op2 = op2;
|
fins->op2 = op2;
|
||||||
return RETRYFOLD;
|
return RETRYFOLD;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Special CSE rule for CONV. */
|
/* Special CSE rule for CONV. */
|
||||||
|
Loading…
Reference in New Issue
Block a user