Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jit64: make use of ANDN again #2848

Merged
merged 2 commits into from Aug 14, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion Source/Core/Common/x64Emitter.cpp
Expand Up @@ -1447,8 +1447,10 @@ void XEmitter::WriteFMA4Op(u8 op, X64Reg dest, X64Reg regOp1, X64Reg regOp2, con
void XEmitter::WriteBMIOp(int size, u8 opPrefix, u16 op, X64Reg regOp1, X64Reg regOp2, const OpArg& arg, int extrabytes)
{
CheckFlags();
if (arg.IsImm())
PanicAlert("BMI1/2 instructions don't support immediate operands.");
if (size != 32 && size != 64)
PanicAlert("VEX GPR instructions only support 32-bit and 64-bit modes!");
PanicAlert("BMI1/2 instructions only support 32-bit and 64-bit modes!");
int W = size == 64;
WriteVEXOp(opPrefix, op, regOp1, regOp2, arg, W, extrabytes);
}
Expand Down
19 changes: 15 additions & 4 deletions Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp
Expand Up @@ -676,7 +676,11 @@ void Jit64::boolX(UGeckoInstruction inst)
}
else if (inst.SUBOP10 == 60) // andcx
{
if (a == b)
if (cpu_info.bBMI1 && gpr.R(b).IsSimpleReg() && !gpr.R(s).IsImm())
{
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);
Expand Down Expand Up @@ -745,9 +749,16 @@ 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.R(b).IsSimpleReg() && !gpr.R(s).IsImm())
{
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
{
Expand Down