summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorRyan Houdek <Sonicadvance1@gmail.com>2014-11-02 09:33:37 -0600
committerRyan Houdek <Sonicadvance1@gmail.com>2014-11-02 09:33:37 -0600
commit0d70880d89cdf0b36d10246640a42ed2b17586c7 (patch)
tree040583d4eb732e79400c1b4dcea7108df43af156 /Source/Core
parent824bad458c586a8daa536b0b7025e93ae879a86d (diff)
parent86ca63658b6a4ecd233211ed46f99ba78c850e48 (diff)
Merge pull request #1466 from Sonicadvance1/ARMv7-and-optimization
Optimizes ARMv7 andi{s,}_rc implementations.
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/PowerPC/JitArm32/JitArm_Integer.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/Source/Core/Core/PowerPC/JitArm32/JitArm_Integer.cpp b/Source/Core/Core/PowerPC/JitArm32/JitArm_Integer.cpp
index e3afe530f6..5c897227b3 100644
--- a/Source/Core/Core/PowerPC/JitArm32/JitArm_Integer.cpp
+++ b/Source/Core/Core/PowerPC/JitArm32/JitArm_Integer.cpp
@@ -275,7 +275,7 @@ void JitArm::arith(UGeckoInstruction inst)
Imm[0] = gpr.GetImm(s);
}
isImm[1] = true;
- Imm[1] = inst.UIMM << (shiftedImm ? 16 : 0);
+ Imm[1] = inst.UIMM;
Rc = true;
break;
@@ -364,7 +364,7 @@ void JitArm::arith(UGeckoInstruction inst)
break;
case 28:
case 29:
- gpr.SetImmediate(a, And(Imm[0], Imm[1]));
+ gpr.SetImmediate(a, And(Imm[0], Imm[1] << (shiftedImm ? 16 : 0)));
dest = a;
break;
case 31: // addcx, addx, subfx
@@ -542,12 +542,22 @@ void JitArm::arith(UGeckoInstruction inst)
{
dest = a;
gpr.BindToRegister(a, s == a);
- ARMReg rA = gpr.GetReg();
RS = gpr.R(s);
RA = gpr.R(a);
- MOVI2R(rA, Imm[1]);
- ANDS(RA, RS, rA);
- gpr.Unlock(rA);
+
+ Operand2 imm_val;
+ if (TryMakeOperand2(Imm[1] << (shiftedImm ? 16 : 0), imm_val))
+ {
+ AND(RA, RS, imm_val);
+ }
+ else
+ {
+ ARMReg rA = gpr.GetReg();
+ MOVI2R(rA, Imm[1]);
+ Operand2 rotated_reg(rA, ST_ROR, shiftedImm ? 16 : 0);
+ AND(RA, RS, rotated_reg);
+ gpr.Unlock(rA);
+ }
}
break;
case 31: