mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-04-19 21:43:27 +00:00
Improve register allocation for loops with variable shifts.
This commit is contained in:
parent
c0ffe7d394
commit
6082f93919
@ -3801,8 +3801,11 @@ static void asm_setup_regsp(ASMState *as, GCtrace *T)
|
|||||||
break;
|
break;
|
||||||
/* Non-constant shift counts need to be in RID_ECX. */
|
/* Non-constant shift counts need to be in RID_ECX. */
|
||||||
case IR_BSHL: case IR_BSHR: case IR_BSAR: case IR_BROL: case IR_BROR:
|
case IR_BSHL: case IR_BSHR: case IR_BSAR: case IR_BROL: case IR_BROR:
|
||||||
if (!irref_isk(ir->op2) && !ra_hashint(IR(ir->op2)->r))
|
if (!irref_isk(ir->op2) && !ra_hashint(IR(ir->op2)->r)) {
|
||||||
IR(ir->op2)->r = REGSP_HINT(RID_ECX);
|
IR(ir->op2)->r = REGSP_HINT(RID_ECX);
|
||||||
|
if (inloop)
|
||||||
|
rset_set(as->modset, RID_ECX);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
/* Do not propagate hints across type conversions. */
|
/* Do not propagate hints across type conversions. */
|
||||||
case IR_TONUM: case IR_TOINT: case IR_TOBIT:
|
case IR_TONUM: case IR_TOINT: case IR_TOBIT:
|
||||||
|
Loading…
Reference in New Issue
Block a user