Skip to content

Commit

Permalink
Fix register pair allocation
Browse files Browse the repository at this point in the history
A free register is also allocated

Signed-off-by: Zoltan Herczeg [email protected]
  • Loading branch information
Zoltan Herczeg authored and clover2123 committed Jun 11, 2024
1 parent c8886c2 commit 28fe509
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/jit/RegisterAlloc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,15 +347,10 @@ uint8_t RegisterSet::allocateRegisterPair(VariableList::Variable* variable, uint

size_t maxRangeEnd;

if (freeReg != VariableList::kUnusedReg) {
if (maxRangeEndSingle1 >= maxRangeEndPair) {
i = maxRangeIndexSingle1;
maxRangeEnd = maxRangeEndSingle1;
} else {
i = maxRangeIndexPair;
maxRangeEnd = maxRangeEndPair;
}
} else if (maxRangeEndPair < maxRangeEndSingle1 && maxRangeEndPair < maxRangeEndSingle2) {
if (freeReg != VariableList::kUnusedReg && maxRangeEndSingle1 >= maxRangeEndPair) {
i = maxRangeIndexSingle1;
maxRangeEnd = maxRangeEndSingle1;
} else if (freeReg == VariableList::kUnusedReg && maxRangeEndPair < maxRangeEndSingle1 && maxRangeEndPair < maxRangeEndSingle2) {
i = maxRangeIndexSingle1;
maxRangeEnd = maxRangeEndSingle2;
freeReg = maxRangeIndexSingle2;
Expand Down

0 comments on commit 28fe509

Please sign in to comment.