diff options
| author | Léo Lam <leo@leolam.fr> | 2020-12-28 15:48:11 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-28 15:48:11 +0100 |
| commit | 3f68aceaca2837f55844abeb1923faee5e7a7ff9 (patch) | |
| tree | 7af41a623b5d2dd0d28273d39ad920e0b9ec9b0a /Source/Core/Common | |
| parent | e509353eb04eafc5df0c659188be9680ba043759 (diff) | |
| parent | 5f65bad68c66586f2b86bae934a123518b726254 (diff) | |
Merge pull request #9348 from lioncash/dsp-deglobal
DSP: Eliminate most global state
Diffstat (limited to 'Source/Core/Common')
| -rw-r--r-- | Source/Core/Common/x64Emitter.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Source/Core/Common/x64Emitter.h b/Source/Core/Common/x64Emitter.h index 6e675e2958..97874dd72c 100644 --- a/Source/Core/Common/x64Emitter.h +++ b/Source/Core/Common/x64Emitter.h @@ -1097,6 +1097,13 @@ public: } template <typename FunctionPointer> + void ABI_CallFunctionP(FunctionPointer func, const void* param1) + { + MOV(64, R(ABI_PARAM1), Imm64(reinterpret_cast<u64>(param1))); + ABI_CallFunction(func); + } + + template <typename FunctionPointer> void ABI_CallFunctionPC(FunctionPointer func, const void* param1, u32 param2) { MOV(64, R(ABI_PARAM1), Imm64(reinterpret_cast<u64>(param1))); @@ -1122,6 +1129,15 @@ public: ABI_CallFunction(func); } + // Pass a pointer and register as a parameter. + template <typename FunctionPointer> + void ABI_CallFunctionPR(FunctionPointer func, const void* ptr, X64Reg reg1) + { + MOV(64, R(ABI_PARAM2), R(reg1)); + MOV(64, R(ABI_PARAM1), Imm64(reinterpret_cast<u64>(ptr))); + ABI_CallFunction(func); + } + // Pass two registers as parameters. template <typename FunctionPointer> void ABI_CallFunctionRR(FunctionPointer func, X64Reg reg1, X64Reg reg2) @@ -1130,6 +1146,15 @@ public: ABI_CallFunction(func); } + // Pass a pointer and two registers as parameters. + template <typename FunctionPointer> + void ABI_CallFunctionPRR(FunctionPointer func, const void* ptr, X64Reg reg1, X64Reg reg2) + { + MOVTwo(64, ABI_PARAM2, reg1, 0, ABI_PARAM3, reg2); + MOV(64, R(ABI_PARAM1), Imm64(reinterpret_cast<u64>(ptr))); + ABI_CallFunction(func); + } + template <typename FunctionPointer> void ABI_CallFunctionAC(int bits, FunctionPointer func, const Gen::OpArg& arg1, u32 param2) { |
