diff options
| author | dok.slade <dok.slade@gmail.com> | 2010-08-23 22:26:00 +0000 |
|---|---|---|
| committer | dok.slade <dok.slade@gmail.com> | 2010-08-23 22:26:00 +0000 |
| commit | cf5088c37e5cd486b031faa6fdfc4f4ff7b28082 (patch) | |
| tree | c1e2c3fcaddacd5e3c0418375df0854ffe2f412a /Source/Core/Common | |
| parent | 430380eac64bef858b39c890ef6e960319529948 (diff) | |
JIT compiler:
* Improved constants folding in load/store instructions
* Merged load instructions
This is almost the same commit as r6076/r6077 but x64 build has been fixed.
Thanks a lot to skidau and BHaaL!!
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6120 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/Common')
| -rw-r--r-- | Source/Core/Common/Src/ABI.cpp | 17 | ||||
| -rw-r--r-- | Source/Core/Common/Src/x64Emitter.h | 1 |
2 files changed, 17 insertions, 1 deletions
diff --git a/Source/Core/Common/Src/ABI.cpp b/Source/Core/Common/Src/ABI.cpp index f565a77633..d18e5b1e41 100644 --- a/Source/Core/Common/Src/ABI.cpp +++ b/Source/Core/Common/Src/ABI.cpp @@ -127,12 +127,20 @@ void XEmitter::ABI_CallFunctionRR(void *func, Gen::X64Reg reg1, Gen::X64Reg reg2 void XEmitter::ABI_CallFunctionAC(void *func, const Gen::OpArg &arg1, u32 param2) { ABI_AlignStack(2 * 4); - PUSH(32, arg1); PUSH(32, Imm32(param2)); + PUSH(32, arg1); CALL(func); ABI_RestoreStack(2 * 4); } +void XEmitter::ABI_CallFunctionA(void *func, const Gen::OpArg &arg1) +{ + ABI_AlignStack(1 * 4); + PUSH(32, arg1); + CALL(func); + ABI_RestoreStack(1 * 4); +} + void XEmitter::ABI_PushAllCalleeSavedRegsAndAdjustStack() { // Note: 4 * 4 = 16 bytes, so alignment is preserved. PUSH(EBP); @@ -259,6 +267,13 @@ void XEmitter::ABI_CallFunctionAC(void *func, const Gen::OpArg &arg1, u32 param2 CALL(func); } +void XEmitter::ABI_CallFunctionA(void *func, const Gen::OpArg &arg1) +{ + if (!arg1.IsSimpleReg(ABI_PARAM1)) + MOV(32, R(ABI_PARAM1), arg1); + CALL(func); +} + unsigned int XEmitter::ABI_GetAlignedFrameSize(unsigned int frameSize) { return frameSize; } diff --git a/Source/Core/Common/Src/x64Emitter.h b/Source/Core/Common/Src/x64Emitter.h index 36f5ea0b61..308c3021eb 100644 --- a/Source/Core/Common/Src/x64Emitter.h +++ b/Source/Core/Common/Src/x64Emitter.h @@ -600,6 +600,7 @@ public: void ABI_CallFunctionCCC(void *func, u32 param1, u32 param2, u32 param3); void ABI_CallFunctionCCP(void *func, u32 param1, u32 param2, void *param3); void ABI_CallFunctionAC(void *func, const Gen::OpArg &arg1, u32 param2); + void ABI_CallFunctionA(void *func, const Gen::OpArg &arg1); // Pass a register as a paremeter. void ABI_CallFunctionR(void *func, Gen::X64Reg reg1); |
