mirror of
https://github.com/libretro/ppsspp.git
synced 2025-04-12 17:23:16 +00:00
ARMJIT: Compare functions are now jitted.
This commit is contained in:
parent
13288a5de6
commit
2d5783eb7f
@ -101,75 +101,66 @@ void Jit::Comp_FPULS(u32 op)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Jit::Comp_FPUComp(u32 op) {
|
void Jit::Comp_FPUComp(u32 op) {
|
||||||
|
int opc = op & 0xF;
|
||||||
|
if (opc > 8) opc -= 8; // alias
|
||||||
|
if (opc == 0)//f, sf (signalling false)
|
||||||
|
{
|
||||||
|
MOVI2R(R0, 0);
|
||||||
|
STR(CTXREG, R0, offsetof(MIPSState, fpcond));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int fs = _FS;
|
int fs = _FS;
|
||||||
int ft = _FT;
|
int ft = _FT;
|
||||||
|
fpr.MapInIn(fs, ft);
|
||||||
// See http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0204j/Chdhcfbc.html
|
VCMP(fpr.R(fs), fpr.R(ft), false);
|
||||||
// for the flags after VCMP.
|
VMRS_APSR(); // Move FP flags from FPSCR to APSR (regular flags).
|
||||||
// Also, need to copy the flags from FPSCR to the APSR through VMRS.
|
switch(opc)
|
||||||
|
{
|
||||||
switch (op & 0xf) {
|
case 1: // un, ngle (unordered)
|
||||||
case 0: //f
|
SetCC(CC_VS);
|
||||||
case 8: //sf
|
MOVI2R(R0, 1);
|
||||||
|
SetCC(CC_VC);
|
||||||
|
break;
|
||||||
|
case 2: // eq, seq (equal, ordered)
|
||||||
|
SetCC(CC_EQ);
|
||||||
|
MOVI2R(R0, 1);
|
||||||
|
SetCC(CC_NEQ);
|
||||||
|
break;
|
||||||
|
case 3: // ueq, ngl (equal, unordered)
|
||||||
|
SetCC(CC_EQ);
|
||||||
|
MOVI2R(R0, 1);
|
||||||
|
SetCC(CC_NEQ);
|
||||||
MOVI2R(R0, 0);
|
MOVI2R(R0, 0);
|
||||||
STR(CTXREG, R0, offsetof(MIPSState, fpcond));
|
SetCC(CC_VC);
|
||||||
break;
|
break;
|
||||||
|
case 4: // olt, lt (less than, ordered)
|
||||||
case 1: //un
|
SetCC(CC_LO);
|
||||||
case 9: //ngle
|
MOVI2R(R0, 1);
|
||||||
// CompFPComp(fs, ft, CMPUNORDSS);
|
SetCC(CC_HS);
|
||||||
DISABLE;
|
|
||||||
break;
|
break;
|
||||||
|
case 5: // ult, nge (less than, unordered)
|
||||||
case 2: //eq
|
SetCC(CC_LT);
|
||||||
case 10: //seq
|
MOVI2R(R0, 1);
|
||||||
// CompFPComp(fs, ft, CMPEQSS);
|
SetCC(CC_GE);
|
||||||
DISABLE;
|
|
||||||
break;
|
break;
|
||||||
|
case 6: // ole, le (less equal, ordered)
|
||||||
case 3: //ueq
|
SetCC(CC_LS);
|
||||||
case 11: //ngl
|
MOVI2R(R0, 1);
|
||||||
// CompFPComp(fs, ft, CMPEQSS, true);
|
SetCC(CC_HI);
|
||||||
DISABLE;
|
|
||||||
break;
|
break;
|
||||||
|
case 7: // ule, ngt (less equal, unordered)
|
||||||
case 4: //olt
|
|
||||||
case 12: //lt
|
|
||||||
// CompFPComp(fs, ft, CMPLTSS);
|
|
||||||
DISABLE;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 5: //ult
|
|
||||||
case 13: //nge
|
|
||||||
// CompFPComp(ft, fs, CMPNLESS);
|
|
||||||
DISABLE;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 6: //ole
|
|
||||||
case 14: //le
|
|
||||||
DISABLE;
|
|
||||||
// ?? This VCMP crashes on ARM11 with an exception.
|
|
||||||
// Also, this doesn't actually work correctly yet. I'm not sure why.
|
|
||||||
fpr.MapInIn(fs, ft);
|
|
||||||
VCMP(fpr.R(fs), fpr.R(ft));
|
|
||||||
VMRS_APSR(); // Move FP flags from FPSCR to APSR (regular flags).
|
|
||||||
SetCC(CC_GT);
|
|
||||||
MOVI2R(R0, 0);
|
|
||||||
SetCC(CC_LE);
|
SetCC(CC_LE);
|
||||||
MOVI2R(R0, 1);
|
MOVI2R(R0, 1);
|
||||||
SetCC(CC_AL);
|
SetCC(CC_GT);
|
||||||
STR(CTXREG, R0, offsetof(MIPSState, fpcond));
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 7: //ule
|
|
||||||
case 15: //ngt
|
|
||||||
// CompFPComp(ft, fs, CMPNLTSS);
|
|
||||||
DISABLE;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
DISABLE;
|
Comp_Generic(op);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
MOVI2R(R0, 0);
|
||||||
|
SetCC(CC_AL);
|
||||||
|
STR(CTXREG, R0, offsetof(MIPSState, fpcond));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Jit::Comp_FPU2op(u32 op)
|
void Jit::Comp_FPU2op(u32 op)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user