More linux prep

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@121 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard
2008-08-01 09:30:04 +00:00
parent 73a8bb9b2f
commit 814af6c7b9
4 changed files with 82 additions and 65 deletions

View File

@ -29,6 +29,14 @@ void ABI_CallFunctionR(void *func, X64Reg reg1) {
ADD(32, R(ESP), Imm8(4));
}
void ABI_CallFunctionRR(void *func, Gen::X64Reg reg1, Gen::X64Reg reg2)
{
PUSH(32, R(reg2));
PUSH(32, R(reg1));
CALL(func);
ADD(32, R(ESP), Imm8(8));
}
void ABI_CallFunctionAC(void *func, const Gen::OpArg &arg1, u32 param2)
{
PUSH(32, arg1);
@ -74,6 +82,15 @@ void ABI_CallFunctionR(void *func, X64Reg reg1) {
CALL(func);
}
// Pass a register as a paremeter.
void ABI_CallFunctionRR(void *func, X64Reg reg1, X64Reg reg2) {
if (reg1 != ABI_PARAM1)
MOV(32, R(ABI_PARAM1), R(reg1));
if (reg2 != ABI_PARAM2)
MOV(32, R(ABI_PARAM2), R(reg2));
CALL(func);
}
void ABI_CallFunctionAC(void *func, const Gen::OpArg &arg1, u32 param2)
{
if (!arg1.IsSimpleReg(ABI_PARAM1))