summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorcalc84maniac <calc84maniac@gmail.com>2012-01-02 18:00:28 -0500
committercalc84maniac <calc84maniac@gmail.com>2012-01-02 18:00:28 -0500
commitf575c2c3be88fa9b7d9327c8a4e90ca84d2bcf30 (patch)
treedbae3d2e79425883bee48994d81c0c5d3ec383c1 /Source
parent42cdda42c9ac4d3f5e176ada57a3f13eedc3284b (diff)
srwx and slwx optimizations
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/Core/Src/PowerPC/Jit64/Jit_Integer.cpp54
1 files changed, 32 insertions, 22 deletions
diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit_Integer.cpp b/Source/Core/Core/Src/PowerPC/Jit64/Jit_Integer.cpp
index c2726fc7de..b0be8517c7 100644
--- a/Source/Core/Core/Src/PowerPC/Jit64/Jit_Integer.cpp
+++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit_Integer.cpp
@@ -1652,28 +1652,33 @@ void Jit64::srwx(UGeckoInstruction inst)
{
u32 amount = (u32)gpr.R(b).offset;
gpr.SetImmediate32(a, (amount & 0x20) ? 0 : ((u32)gpr.R(s).offset >> (amount & 0x1f)));
+ if (inst.Rc)
+ {
+ ComputeRC(gpr.R(a));
+ }
}
else
{
gpr.FlushLockX(ECX);
gpr.Lock(a, b, s);
- gpr.BindToRegister(a, a == s || a == b || s == b, true);
+ gpr.BindToRegister(a, true, true);
MOV(32, R(ECX), gpr.R(b));
- XOR(32, R(EAX), R(EAX));
TEST(32, R(ECX), Imm32(32));
- FixupBranch branch = J_CC(CC_NZ);
- MOV(32, R(EAX), gpr.R(s));
- SHR(32, R(EAX), R(ECX));
+ if (a != s)
+ {
+ MOV(32, gpr.R(a), gpr.R(s));
+ }
+ FixupBranch branch = J_CC(CC_Z);
+ XOR(32, gpr.R(a), gpr.R(a));
SetJumpTarget(branch);
- MOV(32, gpr.R(a), R(EAX));
+ SHR(32, gpr.R(a), R(ECX));
+ if (inst.Rc)
+ {
+ GenerateRC();
+ }
gpr.UnlockAll();
gpr.UnlockAllX();
}
-
- if (inst.Rc)
- {
- ComputeRC(gpr.R(a));
- }
}
void Jit64::slwx(UGeckoInstruction inst)
@@ -1688,28 +1693,33 @@ void Jit64::slwx(UGeckoInstruction inst)
{
u32 amount = (u32)gpr.R(b).offset;
gpr.SetImmediate32(a, (amount & 0x20) ? 0 : (u32)gpr.R(s).offset << amount);
+ if (inst.Rc)
+ {
+ ComputeRC(gpr.R(a));
+ }
}
else
{
gpr.FlushLockX(ECX);
gpr.Lock(a, b, s);
- gpr.BindToRegister(a, a == s || a == b || s == b, true);
+ gpr.BindToRegister(a, true, true);
MOV(32, R(ECX), gpr.R(b));
- XOR(32, R(EAX), R(EAX));
TEST(32, R(ECX), Imm32(32));
- FixupBranch branch = J_CC(CC_NZ);
- MOV(32, R(EAX), gpr.R(s));
- SHL(32, R(EAX), R(ECX));
+ if (a != s)
+ {
+ MOV(32, gpr.R(a), gpr.R(s));
+ }
+ FixupBranch branch = J_CC(CC_Z);
+ XOR(32, gpr.R(a), gpr.R(a));
SetJumpTarget(branch);
- MOV(32, gpr.R(a), R(EAX));
+ SHL(32, gpr.R(a), R(ECX));
+ if (inst.Rc)
+ {
+ GenerateRC();
+ }
gpr.UnlockAll();
gpr.UnlockAllX();
}
-
- if (inst.Rc)
- {
- ComputeRC(gpr.R(a));
- }
}
void Jit64::srawx(UGeckoInstruction inst)