summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorTillmann Karras <tilkax@gmail.com>2015-08-14 05:51:31 +0200
committerTillmann Karras <tilkax@gmail.com>2015-08-14 05:51:31 +0200
commitf9129c0e08aff295a3718c718840dcc2dd118506 (patch)
treebdc2c7870c05b818b0faac009bb7a1ca703b639d /Source/Core
parent7c944f83cc547342701e0017ff5dcf3f191adff5 (diff)
Jit64: use BMI1's ANDN for andcx
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp21
1 files changed, 17 insertions, 4 deletions
diff --git a/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp b/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp
index 407a39b867..f98afc83f3 100644
--- a/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp
+++ b/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp
@@ -676,7 +676,12 @@ void Jit64::boolX(UGeckoInstruction inst)
}
else if (inst.SUBOP10 == 60) // andcx
{
- if (a == b)
+ if (cpu_info.bBMI1 && (gpr.R(b).IsSimpleReg() || a == s))
+ {
+ gpr.BindToRegister(b, true, false);
+ ANDN(32, gpr.RX(a), gpr.RX(b), gpr.R(s));
+ }
+ else if (a == b)
{
NOT(32, gpr.R(a));
AND(32, gpr.R(a), operand);
@@ -745,9 +750,17 @@ void Jit64::boolX(UGeckoInstruction inst)
}
else if (inst.SUBOP10 == 60) // andcx
{
- MOV(32, gpr.R(a), gpr.R(b));
- NOT(32, gpr.R(a));
- AND(32, gpr.R(a), gpr.R(s));
+ if (cpu_info.bBMI1)
+ {
+ gpr.BindToRegister(b, true, false);
+ ANDN(32, gpr.RX(a), gpr.RX(b), gpr.R(s));
+ }
+ else
+ {
+ MOV(32, gpr.R(a), gpr.R(b));
+ NOT(32, gpr.R(a));
+ AND(32, gpr.R(a), gpr.R(s));
+ }
}
else if (inst.SUBOP10 == 444) // orx
{