Factor code from ABI_CallFunctionRR and GetWriteTrampoline into a helper, and fix a special case.

The special case is where the registers are actually to be swapped (i.e.
func(ABI_PARAM2, ABI_PARAM1); this was previously impossible but would
be ugly not to handle anyway.
This commit is contained in:
comex
2014-09-06 13:16:20 -04:00
parent 487eb967eb
commit 67cdb6e07a
3 changed files with 29 additions and 30 deletions
+3
View File
@@ -753,6 +753,9 @@ public:
void ABI_CallFunctionR(void *func, X64Reg reg1);
void ABI_CallFunctionRR(void *func, X64Reg reg1, X64Reg reg2, bool noProlog = false);
// Helper method for the above, or can be used separately.
void MOVTwo(int bits, Gen::X64Reg dst1, Gen::X64Reg src1, Gen::X64Reg dst2, Gen::X64Reg src2, Gen::X64Reg temp);
// A function that doesn't have any control over what it will do to regs,
// such as the dispatcher, should be surrounded by these.
void ABI_PushAllCalleeSavedRegsAndAdjustStack();