Merge pull request #2848 from Tilka/andn

Jit64: make use of ANDN again
This commit is contained in:
flacs 2015-08-14 21:59:47 +02:00
commit 0674e344c4
2 changed files with 18 additions and 5 deletions

View File

@ -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);
}

View File

@ -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);
@ -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
{