mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-09 15:49:25 +01:00
JitArm64: Port some crXXX optimizations from Jit64
This commit is contained in:
parent
bbe271eec6
commit
7fddd39d97
@ -591,18 +591,43 @@ void JitArm64::crXXX(UGeckoInstruction inst)
|
|||||||
INSTRUCTION_START
|
INSTRUCTION_START
|
||||||
JITDISABLE(bJITSystemRegistersOff);
|
JITDISABLE(bJITSystemRegistersOff);
|
||||||
|
|
||||||
// Special case: crclr
|
if (inst.CRBA == inst.CRBB)
|
||||||
if (inst.CRBA == inst.CRBB && inst.CRBA == inst.CRBD && inst.SUBOP10 == 193)
|
|
||||||
{
|
{
|
||||||
ClearCRFieldBit(inst.CRBD >> 2, 3 - (inst.CRBD & 3));
|
switch (inst.SUBOP10)
|
||||||
return;
|
{
|
||||||
}
|
// crclr
|
||||||
|
case 129: // crandc: A && ~B => 0
|
||||||
// Special case: crset
|
case 193: // crxor: A ^ B => 0
|
||||||
if (inst.CRBA == inst.CRBB && inst.CRBA == inst.CRBD && inst.SUBOP10 == 289)
|
{
|
||||||
{
|
ClearCRFieldBit(inst.CRBD >> 2, 3 - (inst.CRBD & 3));
|
||||||
SetCRFieldBit(inst.CRBD >> 2, 3 - (inst.CRBD & 3));
|
return;
|
||||||
return;
|
}
|
||||||
|
// crset
|
||||||
|
case 289: // creqv: ~(A ^ B) => 1
|
||||||
|
case 417: // crorc: A || ~B => 1
|
||||||
|
{
|
||||||
|
SetCRFieldBit(inst.CRBD >> 2, 3 - (inst.CRBD & 3));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
case 257: // crand: A && B => A
|
||||||
|
case 449: // cror: A || B => A
|
||||||
|
{
|
||||||
|
auto WA = gpr.GetScopedReg();
|
||||||
|
ARM64Reg XA = EncodeRegTo64(WA);
|
||||||
|
GetCRFieldBit(inst.CRBA >> 2, 3 - (inst.CRBA & 3), XA, false);
|
||||||
|
SetCRFieldBit(inst.CRBD >> 2, 3 - (inst.CRBD & 3), XA);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
case 33: // crnor: ~(A || B) => ~A
|
||||||
|
case 225: // crnand: ~(A && B) => ~A
|
||||||
|
{
|
||||||
|
auto WA = gpr.GetScopedReg();
|
||||||
|
ARM64Reg XA = EncodeRegTo64(WA);
|
||||||
|
GetCRFieldBit(inst.CRBA >> 2, 3 - (inst.CRBA & 3), XA, true);
|
||||||
|
SetCRFieldBit(inst.CRBD >> 2, 3 - (inst.CRBD & 3), XA);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto WA = gpr.GetScopedReg();
|
auto WA = gpr.GetScopedReg();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user