Remove the inaccurately named ABI_PushAllCalleeSavedRegsAndAdjustStack (it didn't preserve FPRs!) and replace with ABI_PushRegistersAndAdjustStack.

To avoid FPRs being pushed unnecessarily, I checked the uses: DSPEmitter
doesn't use FPRs, and VertexLoader doesn't use anything but RAX, so I
specified the register list accordingly.  The regular JIT, however, does
use FPRs, and as far as I can tell, it was incorrect not to save them in
the outer routine.  Since the dispatcher loop is only exited when
pausing or stopping, this should have no noticeable performance impact.
This commit is contained in:
comex
2014-09-07 14:21:16 -04:00
parent 2dafbfb3ef
commit c5c0b36046
4 changed files with 10 additions and 67 deletions

View File

@ -453,63 +453,3 @@ void XEmitter::ABI_CallFunctionA(void *func, const Gen::OpArg &arg1)
ABI_RestoreStack(0);
}
#ifdef _WIN32
// Win64 Specific Code
void XEmitter::ABI_PushAllCalleeSavedRegsAndAdjustStack()
{
//we only want to do this once
PUSH(RBP);
MOV(64, R(RBP), R(RSP));
PUSH(RBX);
PUSH(RSI);
PUSH(RDI);
PUSH(R12);
PUSH(R13);
PUSH(R14);
PUSH(R15);
SUB(64, R(RSP), Imm8(0x28));
//TODO: Also preserve XMM0-3?
}
void XEmitter::ABI_PopAllCalleeSavedRegsAndAdjustStack()
{
ADD(64, R(RSP), Imm8(0x28));
POP(R15);
POP(R14);
POP(R13);
POP(R12);
POP(RDI);
POP(RSI);
POP(RBX);
POP(RBP);
}
#else
// Unix64 Specific Code
void XEmitter::ABI_PushAllCalleeSavedRegsAndAdjustStack()
{
PUSH(RBP);
MOV(64, R(RBP), R(RSP));
PUSH(RBX);
PUSH(R12);
PUSH(R13);
PUSH(R14);
PUSH(R15);
SUB(64, R(RSP), Imm8(8));
}
void XEmitter::ABI_PopAllCalleeSavedRegsAndAdjustStack()
{
ADD(64, R(RSP), Imm8(8));
POP(R15);
POP(R14);
POP(R13);
POP(R12);
POP(RBX);
POP(RBP);
}
#endif // WIN32