3 more activated instructions in the jit = maybe 1% more speed ;P

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@163 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard 2008-08-09 18:32:10 +00:00
parent e3d21c0b11
commit 12b37ba323
5 changed files with 59 additions and 17 deletions

View File

@ -391,7 +391,7 @@ void CInterpreter::srawix(UGeckoInstruction _inst)
void CInterpreter::srwx(UGeckoInstruction _inst) void CInterpreter::srwx(UGeckoInstruction _inst)
{ {
u32 amount = m_GPR[_inst.RB]; u32 amount = m_GPR[_inst.RB];
m_GPR[_inst.RA] = (amount&0x20) ? 0 : m_GPR[_inst.RS] >> amount; m_GPR[_inst.RA] = (amount & 0x20) ? 0 : (m_GPR[_inst.RS] >> amount);
if (_inst.Rc) Helper_UpdateCR0(m_GPR[_inst.RA]); if (_inst.Rc) Helper_UpdateCR0(m_GPR[_inst.RA]);
} }

View File

@ -147,6 +147,8 @@ namespace Jit64
void rlwinmx(UGeckoInstruction inst); void rlwinmx(UGeckoInstruction inst);
void rlwimix(UGeckoInstruction inst); void rlwimix(UGeckoInstruction inst);
void rlwnmx(UGeckoInstruction inst); void rlwnmx(UGeckoInstruction inst);
void negx(UGeckoInstruction inst);
void slwx(UGeckoInstruction inst);
void srwx(UGeckoInstruction inst); void srwx(UGeckoInstruction inst);
void dcbz(UGeckoInstruction inst); void dcbz(UGeckoInstruction inst);
void lfsx(UGeckoInstruction inst); void lfsx(UGeckoInstruction inst);

View File

@ -67,7 +67,7 @@ namespace Jit64
} }
else else
{ {
_assert_msg_(DYNA_REC,0,"WTF"); _assert_msg_(DYNA_REC, 0, "WTF");
} }
if (Rc) if (Rc)
{ {
@ -93,10 +93,10 @@ namespace Jit64
case 25: regimmop(a, s, true, inst.UIMM << 16, Or, OR, false); break;//oris case 25: regimmop(a, s, true, inst.UIMM << 16, Or, OR, false); break;//oris
case 28: regimmop(a, s, true, inst.UIMM, And, AND, true); break; case 28: regimmop(a, s, true, inst.UIMM, And, AND, true); break;
case 29: regimmop(a, s, true, inst.UIMM << 16, And, AND, true); break; case 29: regimmop(a, s, true, inst.UIMM << 16, And, AND, true); break;
case 26: regimmop(a, s, true, inst.UIMM, Xor, XOR, false); break; //xori
case 27: regimmop(a, s, true, inst.UIMM << 16, Xor, XOR, false); break; //xoris
case 12: //addic case 12: //addic
case 13: //addic_rc case 13: //addic_rc
case 26: //xori
case 27: //xoris
default: default:
Default(inst); Default(inst);
break; break;
@ -633,7 +633,6 @@ namespace Jit64
} }
u32 mask = Helper_Mask(inst.MB, inst.ME); u32 mask = Helper_Mask(inst.MB, inst.ME);
gpr.FlushR(ECX); gpr.FlushR(ECX);
gpr.LockX(ECX); gpr.LockX(ECX);
gpr.Lock(a, b, s); gpr.Lock(a, b, s);
@ -652,21 +651,34 @@ namespace Jit64
} }
} }
void negx(UGeckoInstruction inst)
{
INSTRUCTION_START;
int a = inst.RA;
int d = inst.RD;
gpr.Lock(a, d);
gpr.LoadToX64(d, a == d, true);
if (a != d)
MOV(32, gpr.R(d), gpr.R(a));
NEG(32, gpr.R(d));
gpr.UnlockAll();
if (inst.Rc)
{
MOV(32, R(EAX), gpr.R(a));
CALL((u8*)Asm::computeRc);
}
}
void srwx(UGeckoInstruction inst) void srwx(UGeckoInstruction inst)
{ {
INSTRUCTION_START; INSTRUCTION_START;
// BUGGY?
Default(inst); return;
int a = inst.RA; int a = inst.RA;
int b = inst.RB; int b = inst.RB;
int s = inst.RS; int s = inst.RS;
gpr.FlushR(ECX); gpr.FlushR(ECX);
gpr.LockX(ECX); gpr.LockX(ECX);
gpr.Lock(a, b, s); gpr.Lock(a, b, s);
if (a == s) gpr.LoadToX64(a, a == s || a == b || s == b, true);
gpr.LoadToX64(a, true, true);
else
gpr.LoadToX64(a, false, true);
MOV(32, R(ECX), gpr.R(b)); MOV(32, R(ECX), gpr.R(b));
AND(32, R(ECX), Imm8(63)); AND(32, R(ECX), Imm8(63));
XOR(32, R(EAX), R(EAX)); XOR(32, R(EAX), R(EAX));
@ -685,6 +697,34 @@ namespace Jit64
} }
} }
void slwx(UGeckoInstruction inst)
{
INSTRUCTION_START;
int a = inst.RA;
int b = inst.RB;
int s = inst.RS;
gpr.FlushR(ECX);
gpr.LockX(ECX);
gpr.Lock(a, b, s);
gpr.LoadToX64(a, a == s || a == b || s == b, true);
MOV(32, R(ECX), gpr.R(b));
AND(32, R(ECX), Imm8(63));
XOR(32, R(EAX), R(EAX));
TEST(32, R(ECX), Imm32(32));
FixupBranch branch = J_CC(CC_NZ);
MOV(32, R(EAX), gpr.R(s));
SHL(32, R(EAX), R(ECX));
SetJumpTarget(branch);
MOV(32, gpr.R(a), R(EAX));
gpr.UnlockAll();
gpr.UnlockAllX();
if (inst.Rc)
{
MOV(32, R(EAX), gpr.R(a));
CALL((u8*)Asm::computeRc);
}
}
// another crazy instruction :( // another crazy instruction :(
void srawix(UGeckoInstruction inst) void srawix(UGeckoInstruction inst)
{ {

View File

@ -93,6 +93,7 @@ void lfs(UGeckoInstruction inst)
gpr.UnlockAll(); gpr.UnlockAll();
fpr.UnlockAll(); fpr.UnlockAll();
} }
void lfd(UGeckoInstruction inst) void lfd(UGeckoInstruction inst)
{ {
INSTRUCTION_START; INSTRUCTION_START;
@ -112,8 +113,7 @@ void lfd(UGeckoInstruction inst)
MOV(64, M(&temp64), R(EAX)); MOV(64, M(&temp64), R(EAX));
fpr.Lock(d); fpr.Lock(d);
fpr.LoadToX64(d, false); fpr.LoadToX64(d, false);
MOVSD(fpr.RX(d), M(&temp64)); MOVDDUP(fpr.RX(d), M(&temp64));
MOVDDUP(fpr.RX(d), fpr.R(d));
gpr.UnlockAll(); gpr.UnlockAll();
fpr.UnlockAll(); fpr.UnlockAll();
} }

View File

@ -155,8 +155,8 @@ GekkoOPTemplate primarytable[] =
{24, CInterpreter::ori, Jit64::reg_imm, {"ori", OPTYPE_INTEGER, 0}}, {24, CInterpreter::ori, Jit64::reg_imm, {"ori", OPTYPE_INTEGER, 0}},
{25, CInterpreter::oris, Jit64::reg_imm, {"oris", OPTYPE_INTEGER, 0}}, {25, CInterpreter::oris, Jit64::reg_imm, {"oris", OPTYPE_INTEGER, 0}},
{26, CInterpreter::xori, Jit64::Default, {"xori", OPTYPE_INTEGER, 0}}, {26, CInterpreter::xori, Jit64::reg_imm, {"xori", OPTYPE_INTEGER, 0}},
{27, CInterpreter::xoris, Jit64::Default, {"xoris", OPTYPE_INTEGER, 0}}, {27, CInterpreter::xoris, Jit64::reg_imm, {"xoris", OPTYPE_INTEGER, 0}},
{28, CInterpreter::andi_rc, Jit64::reg_imm, {"andi_rc", OPTYPE_INTEGER, FL_SET_CR0}}, {28, CInterpreter::andi_rc, Jit64::reg_imm, {"andi_rc", OPTYPE_INTEGER, FL_SET_CR0}},
{29, CInterpreter::andis_rc, Jit64::reg_imm, {"andis_rc", OPTYPE_INTEGER, FL_SET_CR0}}, {29, CInterpreter::andis_rc, Jit64::reg_imm, {"andis_rc", OPTYPE_INTEGER, FL_SET_CR0}},
@ -291,7 +291,7 @@ GekkoOPTemplate table31[] =
{536, CInterpreter::srwx, Jit64::srwx, {"srwx", OPTYPE_INTEGER, FL_RC_BIT}}, {536, CInterpreter::srwx, Jit64::srwx, {"srwx", OPTYPE_INTEGER, FL_RC_BIT}},
{792, CInterpreter::srawx, Jit64::Default, {"srawx", OPTYPE_INTEGER, FL_RC_BIT}}, {792, CInterpreter::srawx, Jit64::Default, {"srawx", OPTYPE_INTEGER, FL_RC_BIT}},
{824, CInterpreter::srawix, Jit64::srawix, {"srawix", OPTYPE_INTEGER, FL_RC_BIT}}, {824, CInterpreter::srawix, Jit64::srawix, {"srawix", OPTYPE_INTEGER, FL_RC_BIT}},
{24, CInterpreter::slwx, Jit64::Default, {"slwx", OPTYPE_INTEGER, FL_RC_BIT}}, {24, CInterpreter::slwx, Jit64::slwx, {"slwx", OPTYPE_INTEGER, FL_RC_BIT}},
{54, CInterpreter::dcbst, Jit64::Default, {"dcbst", OPTYPE_DCACHE, 0, 4}}, {54, CInterpreter::dcbst, Jit64::Default, {"dcbst", OPTYPE_DCACHE, 0, 4}},
{86, CInterpreter::dcbf, Jit64::Default, {"dcbf", OPTYPE_DCACHE, 0, 4}}, {86, CInterpreter::dcbf, Jit64::Default, {"dcbf", OPTYPE_DCACHE, 0, 4}},
@ -396,7 +396,7 @@ GekkoOPTemplate table31_2[] =
{75, CInterpreter::mulhwx, Jit64::Default, {"mulhwx", OPTYPE_INTEGER, FL_OUT_D | FL_IN_A | FL_IN_B | FL_RC_BIT, 4}}, {75, CInterpreter::mulhwx, Jit64::Default, {"mulhwx", OPTYPE_INTEGER, FL_OUT_D | FL_IN_A | FL_IN_B | FL_RC_BIT, 4}},
{11, CInterpreter::mulhwux, Jit64::mulhwux, {"mulhwux", OPTYPE_INTEGER, FL_OUT_D | FL_IN_A | FL_IN_B | FL_RC_BIT, 4}}, {11, CInterpreter::mulhwux, Jit64::mulhwux, {"mulhwux", OPTYPE_INTEGER, FL_OUT_D | FL_IN_A | FL_IN_B | FL_RC_BIT, 4}},
{235, CInterpreter::mullwx, Jit64::mullwx, {"mullwx", OPTYPE_INTEGER, FL_OUT_D | FL_IN_A | FL_IN_B | FL_RC_BIT, 4}}, {235, CInterpreter::mullwx, Jit64::mullwx, {"mullwx", OPTYPE_INTEGER, FL_OUT_D | FL_IN_A | FL_IN_B | FL_RC_BIT, 4}},
{104, CInterpreter::negx, Jit64::Default, {"negx", OPTYPE_INTEGER, FL_OUT_D | FL_IN_A | FL_IN_B | FL_RC_BIT}}, {104, CInterpreter::negx, Jit64::negx, {"negx", OPTYPE_INTEGER, FL_OUT_D | FL_IN_A | FL_IN_B | FL_RC_BIT}},
{40, CInterpreter::subfx, Jit64::subfx, {"subfx", OPTYPE_INTEGER, FL_OUT_D | FL_IN_A | FL_IN_B | FL_RC_BIT}}, {40, CInterpreter::subfx, Jit64::subfx, {"subfx", OPTYPE_INTEGER, FL_OUT_D | FL_IN_A | FL_IN_B | FL_RC_BIT}},
{8, CInterpreter::subfcx, Jit64::Default, {"subfcx", OPTYPE_INTEGER, FL_OUT_D | FL_IN_A | FL_IN_B | FL_SET_CA | FL_RC_BIT}}, {8, CInterpreter::subfcx, Jit64::Default, {"subfcx", OPTYPE_INTEGER, FL_OUT_D | FL_IN_A | FL_IN_B | FL_SET_CA | FL_RC_BIT}},
{136, CInterpreter::subfex, Jit64::Default, {"subfex", OPTYPE_INTEGER, FL_OUT_D | FL_IN_A | FL_IN_B | FL_READ_CA | FL_SET_CA | FL_RC_BIT}}, {136, CInterpreter::subfex, Jit64::Default, {"subfex", OPTYPE_INTEGER, FL_OUT_D | FL_IN_A | FL_IN_B | FL_READ_CA | FL_SET_CA | FL_RC_BIT}},