summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Sullivan <briansul@microsoft.com>2016-07-14 07:14:50 -0700
committerGitHub <noreply@github.com>2016-07-14 07:14:50 -0700
commit59b0355f4f4308c34610ded81f4d00fe3070d0ee (patch)
treec6427e98f31d9fab72e5cb8fb7afa8add6897ee9
parentea12884d1a09b66c4452ef1d962f77446996f681 (diff)
parent11f6a0d41a57bb1e80a5e63165de257624fdfb80 (diff)
downloadcoreclr-59b0355f4f4308c34610ded81f4d00fe3070d0ee.tar.gz
coreclr-59b0355f4f4308c34610ded81f4d00fe3070d0ee.tar.bz2
coreclr-59b0355f4f4308c34610ded81f4d00fe3070d0ee.zip
Merge pull request #6274 from hqueue/arm/xor_swap
Introduce XOR swap to legacy codegen for ARM32
-rw-r--r--src/jit/codegenlegacy.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/jit/codegenlegacy.cpp b/src/jit/codegenlegacy.cpp
index 23e7e1c7fb..6db43addaf 100644
--- a/src/jit/codegenlegacy.cpp
+++ b/src/jit/codegenlegacy.cpp
@@ -1029,11 +1029,10 @@ void CodeGen::genMoveRegPair(GenTreePtr tree,
if (newHi == oldLo)
{
#ifdef _TARGET_ARM_
- regNumber regTmp = regSet.rsPickFreeReg(RBM_ALLINT & ~genRegPairMask(oldPair) & ~genRegPairMask(newPair));
- inst_RV_RV(INS_mov, regTmp, oldLo);
- inst_RV_RV(INS_mov, oldLo, oldHi);
- inst_RV_RV(INS_mov, oldHi, regTmp);
- regTracker.rsTrackRegTrash(regTmp);
+ /* Let's use XOR swap to reduce register pressure. */
+ inst_RV_RV(INS_eor, oldLo, oldHi);
+ inst_RV_RV(INS_eor, oldHi, oldLo);
+ inst_RV_RV(INS_eor, oldLo, oldHi);
#else
inst_RV_RV(INS_xchg, oldHi, oldLo);
#endif