Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 11f6a0d

Browse files
committed
Introduce XOR swap to legacy codegen for ARM32
Signed-off-by: Hyung-Kyu Choi <[email protected]>
1 parent 361edab commit 11f6a0d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/jit/codegenlegacy.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,11 +1029,10 @@ void CodeGen::genMoveRegPair(GenTreePtr tree,
10291029
if (newHi == oldLo)
10301030
{
10311031
#ifdef _TARGET_ARM_
1032-
regNumber regTmp = regSet.rsPickFreeReg(RBM_ALLINT & ~genRegPairMask(oldPair) & ~genRegPairMask(newPair));
1033-
inst_RV_RV(INS_mov, regTmp, oldLo);
1034-
inst_RV_RV(INS_mov, oldLo, oldHi);
1035-
inst_RV_RV(INS_mov, oldHi, regTmp);
1036-
regTracker.rsTrackRegTrash(regTmp);
1032+
/* Let's use XOR swap to reduce register pressure. */
1033+
inst_RV_RV(INS_eor, oldLo, oldHi);
1034+
inst_RV_RV(INS_eor, oldHi, oldLo);
1035+
inst_RV_RV(INS_eor, oldLo, oldHi);
10371036
#else
10381037
inst_RV_RV(INS_xchg, oldHi, oldLo);
10391038
#endif

0 commit comments

Comments
 (0)