Merge pull request #2792 from degasus/arm

JitArm64: fix cmpli and disable addzex
This commit is contained in:
Markus Wick 2015-08-13 12:43:29 +02:00
commit 63480da4ee
2 changed files with 22 additions and 12 deletions

View File

@ -240,8 +240,8 @@ private:
FixupBranch JumpIfCRFieldBit(int field, int bit, bool jump_if_set); FixupBranch JumpIfCRFieldBit(int field, int bit, bool jump_if_set);
void ComputeRC(Arm64Gen::ARM64Reg reg, int crf = 0); void ComputeRC(Arm64Gen::ARM64Reg reg, int crf = 0, bool needs_sext = true);
void ComputeRC(u32 imm, int crf = 0); void ComputeRC(u64 imm, int crf = 0, bool needs_sext = true);
void ComputeCarry(bool Carry); void ComputeCarry(bool Carry);
void ComputeCarry(); void ComputeCarry();

View File

@ -15,24 +15,31 @@
using namespace Arm64Gen; using namespace Arm64Gen;
void JitArm64::ComputeRC(ARM64Reg reg, int crf) void JitArm64::ComputeRC(ARM64Reg reg, int crf, bool needs_sext)
{ {
ARM64Reg WA = gpr.GetReg(); if (needs_sext)
ARM64Reg XA = EncodeRegTo64(WA); {
ARM64Reg WA = gpr.GetReg();
ARM64Reg XA = EncodeRegTo64(WA);
SXTW(XA, reg); SXTW(XA, reg);
STR(INDEX_UNSIGNED, XA, X29, PPCSTATE_OFF(cr_val[crf])); STR(INDEX_UNSIGNED, XA, X29, PPCSTATE_OFF(cr_val[crf]));
gpr.Unlock(WA); gpr.Unlock(WA);
}
else
{
STR(INDEX_UNSIGNED, EncodeRegTo64(reg), X29, PPCSTATE_OFF(cr_val[crf]));
}
} }
void JitArm64::ComputeRC(u32 imm, int crf) void JitArm64::ComputeRC(u64 imm, int crf, bool needs_sext)
{ {
ARM64Reg WA = gpr.GetReg(); ARM64Reg WA = gpr.GetReg();
ARM64Reg XA = EncodeRegTo64(WA); ARM64Reg XA = EncodeRegTo64(WA);
MOVI2R(XA, imm); MOVI2R(XA, imm);
if (imm & 0x80000000) if (imm & 0x80000000 && needs_sext)
SXTW(XA, WA); SXTW(XA, WA);
STR(INDEX_UNSIGNED, XA, X29, PPCSTATE_OFF(cr_val[crf])); STR(INDEX_UNSIGNED, XA, X29, PPCSTATE_OFF(cr_val[crf]));
@ -472,13 +479,13 @@ void JitArm64::cmpli(UGeckoInstruction inst)
if (gpr.IsImm(a)) if (gpr.IsImm(a))
{ {
ComputeRC(gpr.GetImm(a) - inst.UIMM, crf); ComputeRC((u64)gpr.GetImm(a) - inst.UIMM, crf, false);
return; return;
} }
if (!inst.UIMM) if (!inst.UIMM)
{ {
ComputeRC(gpr.R(a), crf); ComputeRC(gpr.R(a), crf, false);
return; return;
} }
@ -671,6 +678,9 @@ void JitArm64::addzex(UGeckoInstruction inst)
JITDISABLE(bJITIntegerOff); JITDISABLE(bJITIntegerOff);
FALLBACK_IF(inst.OE); FALLBACK_IF(inst.OE);
// breaks Kirby
FALLBACK_IF(1);
int a = inst.RA, d = inst.RD; int a = inst.RA, d = inst.RD;
gpr.BindToRegister(d, d == a); gpr.BindToRegister(d, d == a);