From 13506d3c12c49b1f0456fce6a985068bdfae8e48 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 31 Aug 2016 20:51:02 -0400 Subject: [PATCH] x64Emitter: Generify ABI_CallFunction variants Gets rid of the need to cast to void* just to use the functions. --- Source/Core/Common/Common.vcxproj | 1 + Source/Core/Common/Common.vcxproj.filters | 1 + Source/Core/Common/x64ABI.cpp | 120 --------- Source/Core/Common/x64ABI.h | 2 +- Source/Core/Common/x64Emitter.cpp | 1 + Source/Core/Common/x64Emitter.h | 246 ++++++++++-------- Source/Core/Common/x64Reg.h | 96 +++++++ Source/Core/Core/DSP/DSPEmitter.cpp | 12 +- Source/Core/Core/DSP/Jit/DSPJitUtil.cpp | 8 +- Source/Core/Core/PowerPC/Jit64/Jit.cpp | 26 +- Source/Core/Core/PowerPC/Jit64/JitAsm.cpp | 6 +- .../Core/Core/PowerPC/Jit64/Jit_LoadStore.cpp | 8 +- .../PowerPC/Jit64/Jit_SystemRegisters.cpp | 2 +- .../PowerPC/Jit64Common/Jit64AsmCommon.cpp | 4 +- Source/Core/Core/PowerPC/Jit64IL/IR_X86.cpp | 12 +- Source/Core/Core/PowerPC/Jit64IL/JitIL.cpp | 22 +- .../Core/Core/PowerPC/JitCommon/Jit_Util.cpp | 35 ++- Source/Core/Core/PowerPC/Profiler.h | 4 +- 18 files changed, 308 insertions(+), 298 deletions(-) create mode 100644 Source/Core/Common/x64Reg.h diff --git a/Source/Core/Common/Common.vcxproj b/Source/Core/Common/Common.vcxproj index 07daa25fb8..fd47fe52ff 100644 --- a/Source/Core/Common/Common.vcxproj +++ b/Source/Core/Common/Common.vcxproj @@ -135,6 +135,7 @@ + diff --git a/Source/Core/Common/Common.vcxproj.filters b/Source/Core/Common/Common.vcxproj.filters index 634730bf0a..27410191d8 100644 --- a/Source/Core/Common/Common.vcxproj.filters +++ b/Source/Core/Common/Common.vcxproj.filters @@ -63,6 +63,7 @@ + Logging diff --git a/Source/Core/Common/x64ABI.cpp b/Source/Core/Common/x64ABI.cpp index 2a19934e29..921b6e71c2 100644 --- a/Source/Core/Common/x64ABI.cpp +++ b/Source/Core/Common/x64ABI.cpp @@ -85,111 +85,6 @@ void XEmitter::ABI_PopRegistersAndAdjustStack(BitSet32 mask, size_t rsp_alignmen } } -// Common functions -void XEmitter::ABI_CallFunction(const void* func) -{ - u64 distance = u64(func) - (u64(code) + 5); - if (distance >= 0x0000000080000000ULL && distance < 0xFFFFFFFF80000000ULL) - { - // Far call - MOV(64, R(RAX), Imm64((u64)func)); - CALLptr(R(RAX)); - } - else - { - CALL(func); - } -} - -void XEmitter::ABI_CallFunctionC16(const void* func, u16 param1) -{ - MOV(32, R(ABI_PARAM1), Imm32((u32)param1)); - ABI_CallFunction(func); -} - -void XEmitter::ABI_CallFunctionCC16(const void* func, u32 param1, u16 param2) -{ - MOV(32, R(ABI_PARAM1), Imm32(param1)); - MOV(32, R(ABI_PARAM2), Imm32((u32)param2)); - ABI_CallFunction(func); -} - -void XEmitter::ABI_CallFunctionC(const void* func, u32 param1) -{ - MOV(32, R(ABI_PARAM1), Imm32(param1)); - ABI_CallFunction(func); -} - -void XEmitter::ABI_CallFunctionCC(const void* func, u32 param1, u32 param2) -{ - MOV(32, R(ABI_PARAM1), Imm32(param1)); - MOV(32, R(ABI_PARAM2), Imm32(param2)); - ABI_CallFunction(func); -} - -void XEmitter::ABI_CallFunctionCP(const void* func, u32 param1, void* param2) -{ - MOV(32, R(ABI_PARAM1), Imm32(param1)); - MOV(64, R(ABI_PARAM2), Imm64((u64)param2)); - ABI_CallFunction(func); -} - -void XEmitter::ABI_CallFunctionCCC(const void* func, u32 param1, u32 param2, u32 param3) -{ - MOV(32, R(ABI_PARAM1), Imm32(param1)); - MOV(32, R(ABI_PARAM2), Imm32(param2)); - MOV(32, R(ABI_PARAM3), Imm32(param3)); - ABI_CallFunction(func); -} - -void XEmitter::ABI_CallFunctionCCP(const void* func, u32 param1, u32 param2, void* param3) -{ - MOV(32, R(ABI_PARAM1), Imm32(param1)); - MOV(32, R(ABI_PARAM2), Imm32(param2)); - MOV(64, R(ABI_PARAM3), Imm64((u64)param3)); - ABI_CallFunction(func); -} - -void XEmitter::ABI_CallFunctionCCCP(const void* func, u32 param1, u32 param2, u32 param3, - void* param4) -{ - MOV(32, R(ABI_PARAM1), Imm32(param1)); - MOV(32, R(ABI_PARAM2), Imm32(param2)); - MOV(32, R(ABI_PARAM3), Imm32(param3)); - MOV(64, R(ABI_PARAM4), Imm64((u64)param4)); - ABI_CallFunction(func); -} - -void XEmitter::ABI_CallFunctionPC(const void* func, void* param1, u32 param2) -{ - MOV(64, R(ABI_PARAM1), Imm64((u64)param1)); - MOV(32, R(ABI_PARAM2), Imm32(param2)); - ABI_CallFunction(func); -} - -void XEmitter::ABI_CallFunctionPPC(const void* func, void* param1, void* param2, u32 param3) -{ - MOV(64, R(ABI_PARAM1), Imm64((u64)param1)); - MOV(64, R(ABI_PARAM2), Imm64((u64)param2)); - MOV(32, R(ABI_PARAM3), Imm32(param3)); - ABI_CallFunction(func); -} - -// Pass a register as a parameter. -void XEmitter::ABI_CallFunctionR(const void* func, X64Reg reg1) -{ - if (reg1 != ABI_PARAM1) - MOV(32, R(ABI_PARAM1), R(reg1)); - ABI_CallFunction(func); -} - -// Pass two registers as parameters. -void XEmitter::ABI_CallFunctionRR(const void* func, X64Reg reg1, X64Reg reg2) -{ - MOVTwo(64, ABI_PARAM1, reg1, 0, ABI_PARAM2, reg2); - ABI_CallFunction(func); -} - void XEmitter::MOVTwo(int bits, Gen::X64Reg dst1, Gen::X64Reg src1, s32 offset1, Gen::X64Reg dst2, Gen::X64Reg src2) { @@ -222,18 +117,3 @@ void XEmitter::MOVTwo(int bits, Gen::X64Reg dst1, Gen::X64Reg src1, s32 offset1, ADD(bits, R(dst1), Imm32(offset1)); } } - -void XEmitter::ABI_CallFunctionAC(int bits, const void* func, const Gen::OpArg& arg1, u32 param2) -{ - if (!arg1.IsSimpleReg(ABI_PARAM1)) - MOV(bits, R(ABI_PARAM1), arg1); - MOV(32, R(ABI_PARAM2), Imm32(param2)); - ABI_CallFunction(func); -} - -void XEmitter::ABI_CallFunctionA(int bits, const void* func, const Gen::OpArg& arg1) -{ - if (!arg1.IsSimpleReg(ABI_PARAM1)) - MOV(bits, R(ABI_PARAM1), arg1); - ABI_CallFunction(func); -} diff --git a/Source/Core/Common/x64ABI.h b/Source/Core/Common/x64ABI.h index 99459dd2c8..1e7c97afc4 100644 --- a/Source/Core/Common/x64ABI.h +++ b/Source/Core/Common/x64ABI.h @@ -5,7 +5,7 @@ #pragma once #include "Common/BitSet.h" -#include "Common/x64Emitter.h" +#include "Common/x64Reg.h" // x64 ABI:s, and helpers to help follow them when JIT-ing code. // All convensions return values in EAX (+ possibly EDX). diff --git a/Source/Core/Common/x64Emitter.cpp b/Source/Core/Common/x64Emitter.cpp index 1baa6b7d9b..395477a18c 100644 --- a/Source/Core/Common/x64Emitter.cpp +++ b/Source/Core/Common/x64Emitter.cpp @@ -9,6 +9,7 @@ #include "Common/CommonTypes.h" #include "Common/Logging/Log.h" #include "Common/x64Emitter.h" +#include "Common/x64Reg.h" namespace Gen { diff --git a/Source/Core/Common/x64Emitter.h b/Source/Core/Common/x64Emitter.h index 7e717ad62c..bceb7c2daf 100644 --- a/Source/Core/Common/x64Emitter.h +++ b/Source/Core/Common/x64Emitter.h @@ -9,101 +9,16 @@ #include #include #include +#include #include "Common/Assert.h" #include "Common/BitSet.h" #include "Common/CodeBlock.h" #include "Common/CommonTypes.h" +#include "Common/x64ABI.h" namespace Gen { -enum X64Reg -{ - EAX = 0, - EBX = 3, - ECX = 1, - EDX = 2, - ESI = 6, - EDI = 7, - EBP = 5, - ESP = 4, - - RAX = 0, - RBX = 3, - RCX = 1, - RDX = 2, - RSI = 6, - RDI = 7, - RBP = 5, - RSP = 4, - R8 = 8, - R9 = 9, - R10 = 10, - R11 = 11, - R12 = 12, - R13 = 13, - R14 = 14, - R15 = 15, - - AL = 0, - BL = 3, - CL = 1, - DL = 2, - SIL = 6, - DIL = 7, - BPL = 5, - SPL = 4, - AH = 0x104, - BH = 0x107, - CH = 0x105, - DH = 0x106, - - AX = 0, - BX = 3, - CX = 1, - DX = 2, - SI = 6, - DI = 7, - BP = 5, - SP = 4, - - XMM0 = 0, - XMM1, - XMM2, - XMM3, - XMM4, - XMM5, - XMM6, - XMM7, - XMM8, - XMM9, - XMM10, - XMM11, - XMM12, - XMM13, - XMM14, - XMM15, - - YMM0 = 0, - YMM1, - YMM2, - YMM3, - YMM4, - YMM5, - YMM6, - YMM7, - YMM8, - YMM9, - YMM10, - YMM11, - YMM12, - YMM13, - YMM14, - YMM15, - - INVALID_REG = 0xFFFFFFFF -}; - enum CCFlags { CC_O = 0, @@ -1090,29 +1005,148 @@ public: // Utility functions // The difference between this and CALL is that this aligns the stack // where appropriate. - void ABI_CallFunction(const void* func); + template + void ABI_CallFunction(FunctionPointer func) + { + static_assert(std::is_pointer() && + std::is_function>(), + "Supplied type must be a function pointer."); - void ABI_CallFunctionC16(const void* func, u16 param1); - void ABI_CallFunctionCC16(const void* func, u32 param1, u16 param2); + const void* ptr = reinterpret_cast(func); + const u64 address = reinterpret_cast(ptr); + const u64 distance = address - (reinterpret_cast(code) + 5); - // These only support u32 parameters, but that's enough for a lot of uses. - // These will destroy the 1 or 2 first "parameter regs". - void ABI_CallFunctionC(const void* func, u32 param1); - void ABI_CallFunctionCC(const void* func, u32 param1, u32 param2); - void ABI_CallFunctionCP(const void* func, u32 param1, void* param2); - void ABI_CallFunctionCCC(const void* func, u32 param1, u32 param2, u32 param3); - void ABI_CallFunctionCCP(const void* func, u32 param1, u32 param2, void* param3); - void ABI_CallFunctionCCCP(const void* func, u32 param1, u32 param2, u32 param3, void* param4); - void ABI_CallFunctionPC(const void* func, void* param1, u32 param2); - void ABI_CallFunctionPPC(const void* func, void* param1, void* param2, u32 param3); - void ABI_CallFunctionAC(int bits, const void* func, const OpArg& arg1, u32 param2); - void ABI_CallFunctionA(int bits, const void* func, const OpArg& arg1); + if (distance >= 0x0000000080000000ULL && distance < 0xFFFFFFFF80000000ULL) + { + // Far call + MOV(64, R(RAX), Imm64(address)); + CALLptr(R(RAX)); + } + else + { + CALL(ptr); + } + } + + template + void ABI_CallFunctionC16(FunctionPointer func, u16 param1) + { + MOV(32, R(ABI_PARAM1), Imm32(param1)); + ABI_CallFunction(func); + } + + template + void ABI_CallFunctionCC16(FunctionPointer func, u32 param1, u16 param2) + { + MOV(32, R(ABI_PARAM1), Imm32(param1)); + MOV(32, R(ABI_PARAM2), Imm32(param2)); + ABI_CallFunction(func); + } + + template + void ABI_CallFunctionC(FunctionPointer func, u32 param1) + { + MOV(32, R(ABI_PARAM1), Imm32(param1)); + ABI_CallFunction(func); + } + + template + void ABI_CallFunctionCC(FunctionPointer func, u32 param1, u32 param2) + { + MOV(32, R(ABI_PARAM1), Imm32(param1)); + MOV(32, R(ABI_PARAM2), Imm32(param2)); + ABI_CallFunction(func); + } + + template + void ABI_CallFunctionCP(FunctionPointer func, u32 param1, const void* param2) + { + MOV(32, R(ABI_PARAM1), Imm32(param1)); + MOV(64, R(ABI_PARAM2), Imm64(reinterpret_cast(param2))); + ABI_CallFunction(func); + } + + template + void ABI_CallFunctionCCC(FunctionPointer func, u32 param1, u32 param2, u32 param3) + { + MOV(32, R(ABI_PARAM1), Imm32(param1)); + MOV(32, R(ABI_PARAM2), Imm32(param2)); + MOV(32, R(ABI_PARAM3), Imm32(param3)); + ABI_CallFunction(func); + } + + template + void ABI_CallFunctionCCP(FunctionPointer func, u32 param1, u32 param2, const void* param3) + { + MOV(32, R(ABI_PARAM1), Imm32(param1)); + MOV(32, R(ABI_PARAM2), Imm32(param2)); + MOV(64, R(ABI_PARAM3), Imm64(reinterpret_cast(param3))); + ABI_CallFunction(func); + } + + template + void ABI_CallFunctionCCCP(FunctionPointer func, u32 param1, u32 param2, u32 param3, + const void* param4) + { + MOV(32, R(ABI_PARAM1), Imm32(param1)); + MOV(32, R(ABI_PARAM2), Imm32(param2)); + MOV(32, R(ABI_PARAM3), Imm32(param3)); + MOV(64, R(ABI_PARAM4), Imm64(reinterpret_cast(param4))); + ABI_CallFunction(func); + } + + template + void ABI_CallFunctionPC(FunctionPointer func, const void* param1, u32 param2) + { + MOV(64, R(ABI_PARAM1), Imm64(reinterpret_cast(param1))); + MOV(32, R(ABI_PARAM2), Imm32(param2)); + ABI_CallFunction(func); + } + + template + void ABI_CallFunctionPPC(FunctionPointer func, const void* param1, const void* param2, u32 param3) + { + MOV(64, R(ABI_PARAM1), Imm64(reinterpret_cast(param1))); + MOV(64, R(ABI_PARAM2), Imm64(reinterpret_cast(param2))); + MOV(32, R(ABI_PARAM3), Imm32(param3)); + ABI_CallFunction(func); + } // Pass a register as a parameter. - void ABI_CallFunctionR(const void* func, X64Reg reg1); - void ABI_CallFunctionRR(const void* func, X64Reg reg1, X64Reg reg2); + template + void ABI_CallFunctionR(FunctionPointer func, X64Reg reg1) + { + if (reg1 != ABI_PARAM1) + MOV(32, R(ABI_PARAM1), R(reg1)); + ABI_CallFunction(func); + } - // Helper method for the above, or can be used separately. + // Pass two registers as parameters. + template + void ABI_CallFunctionRR(FunctionPointer func, X64Reg reg1, X64Reg reg2) + { + MOVTwo(64, ABI_PARAM1, reg1, 0, ABI_PARAM2, reg2); + ABI_CallFunction(func); + } + + template + void ABI_CallFunctionAC(int bits, FunctionPointer func, const Gen::OpArg& arg1, u32 param2) + { + if (!arg1.IsSimpleReg(ABI_PARAM1)) + MOV(bits, R(ABI_PARAM1), arg1); + MOV(32, R(ABI_PARAM2), Imm32(param2)); + ABI_CallFunction(func); + } + + template + void ABI_CallFunctionA(int bits, FunctionPointer func, const Gen::OpArg& arg1) + { + if (!arg1.IsSimpleReg(ABI_PARAM1)) + MOV(bits, R(ABI_PARAM1), arg1); + ABI_CallFunction(func); + } + + // Helper method for ABI functions related to calling functions. May be used by itself as well. void MOVTwo(int bits, X64Reg dst1, X64Reg src1, s32 offset, X64Reg dst2, X64Reg src2); // Saves/restores the registers and adjusts the stack to be aligned as @@ -1138,7 +1172,7 @@ public: void ABI_CallLambdaC(const std::function* f, u32 p1) { auto trampoline = &XEmitter::CallLambdaTrampoline; - ABI_CallFunctionPC((void*)trampoline, const_cast((const void*)f), p1); + ABI_CallFunctionPC(trampoline, reinterpret_cast(f), p1); } }; // class XEmitter diff --git a/Source/Core/Common/x64Reg.h b/Source/Core/Common/x64Reg.h new file mode 100644 index 0000000000..695f8056d9 --- /dev/null +++ b/Source/Core/Common/x64Reg.h @@ -0,0 +1,96 @@ +// Copyright 2016 Dolphin Emulator Project +// Licensed under GPLv2+ +// Refer to the license.txt file included. + +#pragma once + +namespace Gen +{ +enum X64Reg +{ + EAX = 0, + EBX = 3, + ECX = 1, + EDX = 2, + ESI = 6, + EDI = 7, + EBP = 5, + ESP = 4, + + RAX = 0, + RBX = 3, + RCX = 1, + RDX = 2, + RSI = 6, + RDI = 7, + RBP = 5, + RSP = 4, + R8 = 8, + R9 = 9, + R10 = 10, + R11 = 11, + R12 = 12, + R13 = 13, + R14 = 14, + R15 = 15, + + AL = 0, + BL = 3, + CL = 1, + DL = 2, + SIL = 6, + DIL = 7, + BPL = 5, + SPL = 4, + AH = 0x104, + BH = 0x107, + CH = 0x105, + DH = 0x106, + + AX = 0, + BX = 3, + CX = 1, + DX = 2, + SI = 6, + DI = 7, + BP = 5, + SP = 4, + + XMM0 = 0, + XMM1, + XMM2, + XMM3, + XMM4, + XMM5, + XMM6, + XMM7, + XMM8, + XMM9, + XMM10, + XMM11, + XMM12, + XMM13, + XMM14, + XMM15, + + YMM0 = 0, + YMM1, + YMM2, + YMM3, + YMM4, + YMM5, + YMM6, + YMM7, + YMM8, + YMM9, + YMM10, + YMM11, + YMM12, + YMM13, + YMM14, + YMM15, + + INVALID_REG = 0xFFFFFFFF +}; + +} // namespace Gen diff --git a/Source/Core/Core/DSP/DSPEmitter.cpp b/Source/Core/Core/DSP/DSPEmitter.cpp index 6c3913ee75..46ce02a75e 100644 --- a/Source/Core/Core/DSP/DSPEmitter.cpp +++ b/Source/Core/Core/DSP/DSPEmitter.cpp @@ -89,7 +89,7 @@ void DSPEmitter::checkExceptions(u32 retval) DSPJitRegCache c(gpr); gpr.SaveRegs(); - ABI_CallFunction((void*)&DSPCore_CheckExceptions); + ABI_CallFunction(DSPCore_CheckExceptions); MOV(32, R(EAX), Imm32(retval)); JMP(returnDispatcher, true); gpr.LoadRegs(false); @@ -121,7 +121,7 @@ void DSPEmitter::FallBackToInterpreter(UDSPInstruction inst) // Fall back to interpreter gpr.PushRegs(); _assert_msg_(DSPLLE, opTable[inst]->intFunc, "No function for %04x", inst); - ABI_CallFunctionC16((void*)opTable[inst]->intFunc, inst); + ABI_CallFunctionC16(opTable[inst]->intFunc, inst); gpr.PopRegs(); } @@ -139,7 +139,7 @@ void DSPEmitter::EmitInstruction(UDSPInstruction inst) { // Fall back to interpreter gpr.PushRegs(); - ABI_CallFunctionC16((void*)extOpTable[inst & 0x7F]->intFunc, inst); + ABI_CallFunctionC16(extOpTable[inst & 0x7F]->intFunc, inst); gpr.PopRegs(); INFO_LOG(DSPLLE, "Instruction not JITed(ext part): %04x\n", inst); ext_is_jit = false; @@ -156,7 +156,7 @@ void DSPEmitter::EmitInstruction(UDSPInstruction inst) { // Fall back to interpreter gpr.PushRegs(); - ABI_CallFunctionC16((void*)extOpTable[inst & 0xFF]->intFunc, inst); + ABI_CallFunctionC16(extOpTable[inst & 0xFF]->intFunc, inst); gpr.PopRegs(); INFO_LOG(DSPLLE, "Instruction not JITed(ext part): %04x\n", inst); ext_is_jit = false; @@ -188,7 +188,7 @@ void DSPEmitter::EmitInstruction(UDSPInstruction inst) // need to call the online cleanup function because // the writeBackLog gets populated at runtime gpr.PushRegs(); - ABI_CallFunction((void*)::applyWriteBackLog); + ABI_CallFunction(::applyWriteBackLog); gpr.PopRegs(); } else @@ -376,7 +376,7 @@ void DSPEmitter::Compile(u16 start_addr) const u8* DSPEmitter::CompileStub() { const u8* entryPoint = AlignCode16(); - ABI_CallFunction((void*)&CompileCurrent); + ABI_CallFunction(CompileCurrent); XOR(32, R(EAX), R(EAX)); // Return 0 cycles executed JMP(returnDispatcher); return entryPoint; diff --git a/Source/Core/Core/DSP/Jit/DSPJitUtil.cpp b/Source/Core/Core/DSP/Jit/DSPJitUtil.cpp index bb59f74b34..3db3927629 100644 --- a/Source/Core/Core/DSP/Jit/DSPJitUtil.cpp +++ b/Source/Core/Core/DSP/Jit/DSPJitUtil.cpp @@ -518,7 +518,7 @@ void DSPEmitter::dmem_write(X64Reg value) DSPJitRegCache c(gpr); X64Reg abisafereg = gpr.MakeABICallSafe(value); gpr.PushRegs(); - ABI_CallFunctionRR((void*)gdsp_ifx_write, EAX, abisafereg); + ABI_CallFunctionRR(gdsp_ifx_write, EAX, abisafereg); gpr.PopRegs(); gpr.FlushRegs(c); SetJumpTarget(end); @@ -538,7 +538,7 @@ void DSPEmitter::dmem_write_imm(u16 address, X64Reg value) MOV(16, R(EAX), Imm16(address)); X64Reg abisafereg = gpr.MakeABICallSafe(value); gpr.PushRegs(); - ABI_CallFunctionRR((void*)gdsp_ifx_write, EAX, abisafereg); + ABI_CallFunctionRR(gdsp_ifx_write, EAX, abisafereg); gpr.PopRegs(); break; } @@ -604,7 +604,7 @@ void DSPEmitter::dmem_read(X64Reg address) DSPJitRegCache c(gpr); X64Reg abisafereg = gpr.MakeABICallSafe(address); gpr.PushRegs(); - ABI_CallFunctionR((void*)gdsp_ifx_read, abisafereg); + ABI_CallFunctionR(gdsp_ifx_read, abisafereg); gpr.PopRegs(); gpr.FlushRegs(c); SetJumpTarget(end); @@ -628,7 +628,7 @@ void DSPEmitter::dmem_read_imm(u16 address) case 0xf: // Fxxx HW regs { gpr.PushRegs(); - ABI_CallFunctionC16((void*)gdsp_ifx_read, address); + ABI_CallFunctionC16(gdsp_ifx_read, address); gpr.PopRegs(); break; } diff --git a/Source/Core/Core/PowerPC/Jit64/Jit.cpp b/Source/Core/Core/PowerPC/Jit64/Jit.cpp index daf0faed3e..e750b508aa 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit.cpp @@ -285,7 +285,7 @@ void Jit64::FallBackToInterpreter(UGeckoInstruction inst) } Interpreter::Instruction instr = GetInterpreterOp(inst); ABI_PushRegistersAndAdjustStack({}, 0); - ABI_CallFunctionC((void*)instr, inst.hex); + ABI_CallFunctionC(instr, inst.hex); ABI_PopRegistersAndAdjustStack({}, 0); if (js.op->opinfo->flags & FL_ENDBLOCK) { @@ -312,7 +312,7 @@ void Jit64::HLEFunction(UGeckoInstruction _inst) gpr.Flush(); fpr.Flush(); ABI_PushRegistersAndAdjustStack({}, 0); - ABI_CallFunctionCC((void*)&HLE::Execute, js.compilerPC, _inst.hex); + ABI_CallFunctionCC(HLE::Execute, js.compilerPC, _inst.hex); ABI_PopRegistersAndAdjustStack({}, 0); } @@ -352,7 +352,7 @@ bool Jit64::Cleanup() if (jo.optimizeGatherPipe && js.fifoBytesThisBlock > 0) { ABI_PushRegistersAndAdjustStack({}, 0); - ABI_CallFunction((void*)&GPFifo::FastCheckGatherPipe); + ABI_CallFunction(GPFifo::FastCheckGatherPipe); ABI_PopRegistersAndAdjustStack({}, 0); did_something = true; } @@ -361,8 +361,8 @@ bool Jit64::Cleanup() if (MMCR0.Hex || MMCR1.Hex) { ABI_PushRegistersAndAdjustStack({}, 0); - ABI_CallFunctionCCC((void*)&PowerPC::UpdatePerformanceMonitor, js.downcountAmount, - js.numLoadStoreInst, js.numFloatingPointInst); + ABI_CallFunctionCCC(PowerPC::UpdatePerformanceMonitor, js.downcountAmount, js.numLoadStoreInst, + js.numFloatingPointInst); ABI_PopRegistersAndAdjustStack({}, 0); did_something = true; } @@ -462,7 +462,7 @@ void Jit64::WriteRfiExitDestInRSCRATCH() MOV(32, PPCSTATE(npc), R(RSCRATCH)); Cleanup(); ABI_PushRegistersAndAdjustStack({}, 0); - ABI_CallFunction(reinterpret_cast(&PowerPC::CheckExceptions)); + ABI_CallFunction(PowerPC::CheckExceptions); ABI_PopRegistersAndAdjustStack({}, 0); SUB(32, PPCSTATE(downcount), Imm32(js.downcountAmount)); JMP(asm_routines.dispatcher, true); @@ -474,7 +474,7 @@ void Jit64::WriteExceptionExit() MOV(32, R(RSCRATCH), PPCSTATE(pc)); MOV(32, PPCSTATE(npc), R(RSCRATCH)); ABI_PushRegistersAndAdjustStack({}, 0); - ABI_CallFunction(reinterpret_cast(&PowerPC::CheckExceptions)); + ABI_CallFunction(PowerPC::CheckExceptions); ABI_PopRegistersAndAdjustStack({}, 0); SUB(32, PPCSTATE(downcount), Imm32(js.downcountAmount)); JMP(asm_routines.dispatcher, true); @@ -486,7 +486,7 @@ void Jit64::WriteExternalExceptionExit() MOV(32, R(RSCRATCH), PPCSTATE(pc)); MOV(32, PPCSTATE(npc), R(RSCRATCH)); ABI_PushRegistersAndAdjustStack({}, 0); - ABI_CallFunction(reinterpret_cast(&PowerPC::CheckExternalExceptions)); + ABI_CallFunction(PowerPC::CheckExternalExceptions); ABI_PopRegistersAndAdjustStack({}, 0); SUB(32, PPCSTATE(downcount), Imm32(js.downcountAmount)); JMP(asm_routines.dispatcher, true); @@ -620,11 +620,11 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer* code_buf, JitBloc const u8* normalEntry = GetCodePtr(); b->normalEntry = normalEntry; + // Used to get a trace of the last few blocks before a crash, sometimes VERY useful if (ImHereDebug) { ABI_PushRegistersAndAdjustStack({}, 0); - ABI_CallFunction((void*)&ImHere); // Used to get a trace of the last few blocks before a crash, - // sometimes VERY useful + ABI_CallFunction(ImHere); ABI_PopRegistersAndAdjustStack({}, 0); } @@ -672,7 +672,7 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer* code_buf, JitBloc const u8* target = GetCodePtr(); MOV(32, PPCSTATE(pc), Imm32(js.blockStart)); ABI_PushRegistersAndAdjustStack({}, 0); - ABI_CallFunctionC((void*)&JitInterface::CompileExceptionCheck, + ABI_CallFunctionC(JitInterface::CompileExceptionCheck, (u32)JitInterface::ExceptionType::EXCEPTIONS_PAIRED_QUANTIZE); ABI_PopRegistersAndAdjustStack({}, 0); JMP(asm_routines.dispatcher, true); @@ -731,7 +731,7 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer* code_buf, JitBloc js.mustCheckFifo = false; BitSet32 registersInUse = CallerSavedRegistersInUse(); ABI_PushRegistersAndAdjustStack(registersInUse, 0); - ABI_CallFunction((void*)&GPFifo::FastCheckGatherPipe); + ABI_CallFunction(GPFifo::FastCheckGatherPipe); ABI_PopRegistersAndAdjustStack(registersInUse, 0); gatherPipeIntCheck = true; } @@ -820,7 +820,7 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer* code_buf, JitBloc MOV(32, PPCSTATE(pc), Imm32(ops[i].address)); ABI_PushRegistersAndAdjustStack({}, 0); - ABI_CallFunction(reinterpret_cast(&PowerPC::CheckBreakPoints)); + ABI_CallFunction(PowerPC::CheckBreakPoints); ABI_PopRegistersAndAdjustStack({}, 0); TEST(32, M(CPU::GetStatePtr()), Imm32(0xFFFFFFFF)); FixupBranch noBreakpoint = J_CC(CC_Z); diff --git a/Source/Core/Core/PowerPC/Jit64/JitAsm.cpp b/Source/Core/Core/PowerPC/Jit64/JitAsm.cpp index 7c030d8e77..15e2c82bfc 100644 --- a/Source/Core/Core/PowerPC/Jit64/JitAsm.cpp +++ b/Source/Core/Core/PowerPC/Jit64/JitAsm.cpp @@ -50,7 +50,7 @@ void Jit64AsmRoutineManager::Generate() const u8* outerLoop = GetCodePtr(); ABI_PushRegistersAndAdjustStack({}, 0); - ABI_CallFunction(reinterpret_cast(&CoreTiming::Advance)); + ABI_CallFunction(CoreTiming::Advance); ABI_PopRegistersAndAdjustStack({}, 0); FixupBranch skipToRealDispatch = J(SConfig::GetInstance().bEnableDebugging); // skip the sync and compare first time @@ -80,7 +80,7 @@ void Jit64AsmRoutineManager::Generate() TEST(32, M(CPU::GetStatePtr()), Imm32(CPU::CPU_STEPPING)); FixupBranch notStepping = J_CC(CC_Z); ABI_PushRegistersAndAdjustStack({}, 0); - ABI_CallFunction(reinterpret_cast(&PowerPC::CheckBreakPoints)); + ABI_CallFunction(PowerPC::CheckBreakPoints); ABI_PopRegistersAndAdjustStack({}, 0); TEST(32, M(CPU::GetStatePtr()), Imm32(0xFFFFFFFF)); dbg_exit = J_CC(CC_NZ, true); @@ -154,7 +154,7 @@ void Jit64AsmRoutineManager::Generate() // Ok, no block, let's call the slow dispatcher ABI_PushRegistersAndAdjustStack({}, 0); - ABI_CallFunction(reinterpret_cast(&JitBase::Dispatch)); + ABI_CallFunction(JitBase::Dispatch); ABI_PopRegistersAndAdjustStack({}, 0); // JMPptr(R(ABI_RETURN)); JMP(dispatcherNoCheck, true); diff --git a/Source/Core/Core/PowerPC/Jit64/Jit_LoadStore.cpp b/Source/Core/Core/PowerPC/Jit64/Jit_LoadStore.cpp index 2059587dd6..b2a4af93a5 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit_LoadStore.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit_LoadStore.cpp @@ -149,7 +149,7 @@ void Jit64::lXXx(UGeckoInstruction inst) BitSet32 registersInUse = CallerSavedRegistersInUse(); ABI_PushRegistersAndAdjustStack(registersInUse, 0); - ABI_CallFunction((void*)&CoreTiming::Idle); + ABI_CallFunction(CoreTiming::Idle); ABI_PopRegistersAndAdjustStack(registersInUse, 0); @@ -308,7 +308,7 @@ void Jit64::dcbx(UGeckoInstruction inst) SHL(32, R(ABI_PARAM1), Imm8(5)); MOV(32, R(ABI_PARAM2), Imm32(32)); XOR(32, R(ABI_PARAM3), R(ABI_PARAM3)); - ABI_CallFunction((void*)JitInterface::InvalidateICache); + ABI_CallFunction(JitInterface::InvalidateICache); ABI_PopRegistersAndAdjustStack(registersInUse, 0); asm_routines.ResetStack(*this); c = J(true); @@ -325,7 +325,7 @@ void Jit64::dcbx(UGeckoInstruction inst) SetJumpTarget(c); ABI_PushRegistersAndAdjustStack(registersInUse, 0); SHL(32, R(addr), Imm8(5)); - ABI_CallFunctionR((void*)DSP::FlushInstantDMA, addr); + ABI_CallFunctionR(DSP::FlushInstantDMA, addr); ABI_PopRegistersAndAdjustStack(registersInUse, 0); c = J(true); SwitchToNearCode(); @@ -384,7 +384,7 @@ void Jit64::dcbz(UGeckoInstruction inst) MOV(32, M(&PC), Imm32(jit->js.compilerPC)); BitSet32 registersInUse = CallerSavedRegistersInUse(); ABI_PushRegistersAndAdjustStack(registersInUse, 0); - ABI_CallFunctionR((void*)&PowerPC::ClearCacheLine, RSCRATCH); + ABI_CallFunctionR(PowerPC::ClearCacheLine, RSCRATCH); ABI_PopRegistersAndAdjustStack(registersInUse, 0); FixupBranch exit = J(true); SwitchToNearCode(); diff --git a/Source/Core/Core/PowerPC/Jit64/Jit_SystemRegisters.cpp b/Source/Core/Core/PowerPC/Jit64/Jit_SystemRegisters.cpp index 78f8e190e2..f952fae751 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit_SystemRegisters.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit_SystemRegisters.cpp @@ -243,7 +243,7 @@ void Jit64::mtspr(UGeckoInstruction inst) FixupBranch dont_reset_icache = J_CC(CC_NC); BitSet32 regs = CallerSavedRegistersInUse(); ABI_PushRegistersAndAdjustStack(regs, 0); - ABI_CallFunction((void*)DoICacheReset); + ABI_CallFunction(DoICacheReset); ABI_PopRegistersAndAdjustStack(regs, 0); SetJumpTarget(dont_reset_icache); break; diff --git a/Source/Core/Core/PowerPC/Jit64Common/Jit64AsmCommon.cpp b/Source/Core/Core/PowerPC/Jit64Common/Jit64AsmCommon.cpp index 1dacdca430..0c48263528 100644 --- a/Source/Core/Core/PowerPC/Jit64Common/Jit64AsmCommon.cpp +++ b/Source/Core/Core/PowerPC/Jit64Common/Jit64AsmCommon.cpp @@ -101,7 +101,7 @@ void CommonAsmRoutines::GenFrsqrte() SetJumpTarget(complex2); SetJumpTarget(complex3); ABI_PushRegistersAndAdjustStack(QUANTIZED_REGS_TO_SAVE, 8); - ABI_CallFunction((void*)&MathUtil::ApproximateReciprocalSquareRoot); + ABI_CallFunction(MathUtil::ApproximateReciprocalSquareRoot); ABI_PopRegistersAndAdjustStack(QUANTIZED_REGS_TO_SAVE, 8); RET(); @@ -163,7 +163,7 @@ void CommonAsmRoutines::GenFres() SetJumpTarget(complex); ABI_PushRegistersAndAdjustStack(QUANTIZED_REGS_TO_SAVE, 8); - ABI_CallFunction((void*)&MathUtil::ApproximateReciprocal); + ABI_CallFunction(MathUtil::ApproximateReciprocal); ABI_PopRegistersAndAdjustStack(QUANTIZED_REGS_TO_SAVE, 8); RET(); diff --git a/Source/Core/Core/PowerPC/Jit64IL/IR_X86.cpp b/Source/Core/Core/PowerPC/Jit64IL/IR_X86.cpp index dbcd3c6e91..20b7919891 100644 --- a/Source/Core/Core/PowerPC/Jit64IL/IR_X86.cpp +++ b/Source/Core/Core/PowerPC/Jit64IL/IR_X86.cpp @@ -984,7 +984,7 @@ static void DoWriteCode(IRBuilder* ibuild, JitIL* Jit, u32 exitAddress) regSpillCallerSaved(RI); Jit->MOV(32, PPCSTATE(pc), Imm32(InstLoc)); Jit->MOV(32, PPCSTATE(npc), Imm32(InstLoc + 4)); - Jit->ABI_CallFunctionC((void*)GetInterpreterOp(InstCode), InstCode); + Jit->ABI_CallFunctionC(GetInterpreterOp(InstCode), InstCode); break; } case LoadGReg: @@ -1940,7 +1940,7 @@ static void DoWriteCode(IRBuilder* ibuild, JitIL* Jit, u32 exitAddress) Jit->MOVSD(XMM0, loc2); Jit->MOVSD(M(isSNANTemp[1]), XMM0); } - Jit->ABI_CallFunction((void*)checkIsSNAN); + Jit->ABI_CallFunction(checkIsSNAN); Jit->TEST(8, R(ABI_RETURN), R(ABI_RETURN)); FixupBranch ok = Jit->J_CC(CC_Z); Jit->OR(32, PPCSTATE(fpscr), Imm32(FPSCR_FX)); // FPSCR.FX = 1; @@ -1969,7 +1969,7 @@ static void DoWriteCode(IRBuilder* ibuild, JitIL* Jit, u32 exitAddress) Jit->MOVSD(XMM0, loc2); Jit->MOVSD(M(isSNANTemp[1]), XMM0); } - Jit->ABI_CallFunction((void*)checkIsSNAN); + Jit->ABI_CallFunction(checkIsSNAN); Jit->TEST(8, R(ABI_RETURN), R(ABI_RETURN)); FixupBranch finish = Jit->J_CC(CC_Z); Jit->OR(32, PPCSTATE(fpscr), Imm32(FPSCR_FX)); // FPSCR.FX = 1; @@ -2123,7 +2123,7 @@ static void DoWriteCode(IRBuilder* ibuild, JitIL* Jit, u32 exitAddress) FixupBranch noidle = Jit->J_CC(CC_NZ); RI.Jit->Cleanup(); // is it needed? - Jit->ABI_CallFunction((void*)&CoreTiming::Idle); + Jit->ABI_CallFunction(CoreTiming::Idle); Jit->MOV(32, PPCSTATE(pc), Imm32(ibuild->GetImmValue(getOp2(I)))); Jit->WriteExceptionExit(); @@ -2209,7 +2209,7 @@ static void DoWriteCode(IRBuilder* ibuild, JitIL* Jit, u32 exitAddress) case ShortIdleLoop: { unsigned InstLoc = ibuild->GetImmValue(getOp1(I)); - Jit->ABI_CallFunction((void*)&CoreTiming::Idle); + Jit->ABI_CallFunction(CoreTiming::Idle); Jit->MOV(32, PPCSTATE(pc), Imm32(InstLoc)); Jit->WriteExceptionExit(); break; @@ -2307,7 +2307,7 @@ static void DoWriteCode(IRBuilder* ibuild, JitIL* Jit, u32 exitAddress) unsigned InstLoc = ibuild->GetImmValue(getOp1(I)); Jit->MOV(32, PPCSTATE(pc), Imm32(InstLoc)); - Jit->ABI_CallFunction(reinterpret_cast(&PowerPC::CheckBreakPoints)); + Jit->ABI_CallFunction(PowerPC::CheckBreakPoints); Jit->TEST(32, M(CPU::GetStatePtr()), Imm32(0xFFFFFFFF)); FixupBranch noBreakpoint = Jit->J_CC(CC_Z); Jit->WriteExit(InstLoc); diff --git a/Source/Core/Core/PowerPC/Jit64IL/JitIL.cpp b/Source/Core/Core/PowerPC/Jit64IL/JitIL.cpp index 03d8253493..cd5f4620a5 100644 --- a/Source/Core/Core/PowerPC/Jit64IL/JitIL.cpp +++ b/Source/Core/Core/PowerPC/Jit64IL/JitIL.cpp @@ -310,7 +310,7 @@ void JitIL::FallBackToInterpreter(UGeckoInstruction _inst) void JitIL::HLEFunction(UGeckoInstruction _inst) { - ABI_CallFunctionCC((void*)&HLE::Execute, js.compilerPC, _inst.hex); + ABI_CallFunctionCC(HLE::Execute, js.compilerPC, _inst.hex); MOV(32, R(RSCRATCH), PPCSTATE(npc)); WriteExitDestInOpArg(R(RSCRATCH)); } @@ -353,7 +353,7 @@ void JitIL::Cleanup() { // SPEED HACK: MMCR0/MMCR1 should be checked at run-time, not at compile time. if (MMCR0.Hex || MMCR1.Hex) - ABI_CallFunctionCCC((void*)&PowerPC::UpdatePerformanceMonitor, js.downcountAmount, + ABI_CallFunctionCCC(PowerPC::UpdatePerformanceMonitor, js.downcountAmount, jit->js.numLoadStoreInst, jit->js.numFloatingPointInst); } @@ -362,7 +362,7 @@ void JitIL::WriteExit(u32 destination) Cleanup(); if (SConfig::GetInstance().bJITILTimeProfiling) { - ABI_CallFunction((void*)JitILProfiler::End); + ABI_CallFunction(JitILProfiler::End); } SUB(32, PPCSTATE(downcount), Imm32(js.downcountAmount)); @@ -385,7 +385,7 @@ void JitIL::WriteExitDestInOpArg(const OpArg& arg) Cleanup(); if (SConfig::GetInstance().bJITILTimeProfiling) { - ABI_CallFunction((void*)JitILProfiler::End); + ABI_CallFunction(JitILProfiler::End); } SUB(32, PPCSTATE(downcount), Imm32(js.downcountAmount)); JMP(asm_routines.dispatcher, true); @@ -398,9 +398,9 @@ void JitIL::WriteRfiExitDestInOpArg(const OpArg& arg) Cleanup(); if (SConfig::GetInstance().bJITILTimeProfiling) { - ABI_CallFunction((void*)JitILProfiler::End); + ABI_CallFunction(JitILProfiler::End); } - ABI_CallFunction(reinterpret_cast(&PowerPC::CheckExceptions)); + ABI_CallFunction(PowerPC::CheckExceptions); SUB(32, PPCSTATE(downcount), Imm32(js.downcountAmount)); JMP(asm_routines.dispatcher, true); } @@ -410,11 +410,11 @@ void JitIL::WriteExceptionExit() Cleanup(); if (SConfig::GetInstance().bJITILTimeProfiling) { - ABI_CallFunction((void*)JitILProfiler::End); + ABI_CallFunction(JitILProfiler::End); } MOV(32, R(EAX), PPCSTATE(pc)); MOV(32, PPCSTATE(npc), R(EAX)); - ABI_CallFunction(reinterpret_cast(&PowerPC::CheckExceptions)); + ABI_CallFunction(PowerPC::CheckExceptions); SUB(32, PPCSTATE(downcount), Imm32(js.downcountAmount)); JMP(asm_routines.dispatcher, true); } @@ -537,9 +537,9 @@ const u8* JitIL::DoJit(u32 em_address, PPCAnalyst::CodeBuffer* code_buf, JitBloc const u8* normalEntry = GetCodePtr(); b->normalEntry = normalEntry; + // Used to get a trace of the last few blocks before a crash, sometimes VERY useful. if (ImHereDebug) - ABI_CallFunction((void*)&ImHere); // Used to get a trace of the last few blocks before a crash, - // sometimes VERY useful + ABI_CallFunction(ImHere); if (js.fpa.any) { @@ -573,7 +573,7 @@ const u8* JitIL::DoJit(u32 em_address, PPCAnalyst::CodeBuffer* code_buf, JitBloc if (SConfig::GetInstance().bJITILTimeProfiling) { JitILProfiler::Block& block = JitILProfiler::Add(codeHash); - ABI_CallFunctionC((void*)JitILProfiler::Begin, block.index); + ABI_CallFunctionC(JitILProfiler::Begin, block.index); } // Start up IR builder (structure that collects the diff --git a/Source/Core/Core/PowerPC/JitCommon/Jit_Util.cpp b/Source/Core/Core/PowerPC/JitCommon/Jit_Util.cpp index fb0998f284..e08b60b7f9 100644 --- a/Source/Core/Core/PowerPC/JitCommon/Jit_Util.cpp +++ b/Source/Core/Core/PowerPC/JitCommon/Jit_Util.cpp @@ -325,16 +325,16 @@ void EmuCodeBlock::SafeLoadToReg(X64Reg reg_value, const Gen::OpArg& opAddress, switch (accessSize) { case 64: - ABI_CallFunctionR((void*)&PowerPC::Read_U64, reg_addr); + ABI_CallFunctionR(PowerPC::Read_U64, reg_addr); break; case 32: - ABI_CallFunctionR((void*)&PowerPC::Read_U32, reg_addr); + ABI_CallFunctionR(PowerPC::Read_U32, reg_addr); break; case 16: - ABI_CallFunctionR((void*)&PowerPC::Read_U16_ZX, reg_addr); + ABI_CallFunctionR(PowerPC::Read_U16_ZX, reg_addr); break; case 8: - ABI_CallFunctionR((void*)&PowerPC::Read_U8_ZX, reg_addr); + ABI_CallFunctionR(PowerPC::Read_U8_ZX, reg_addr); break; } ABI_PopRegistersAndAdjustStack(registersInUse, rsp_alignment); @@ -385,16 +385,16 @@ void EmuCodeBlock::SafeLoadToRegImmediate(X64Reg reg_value, u32 address, int acc switch (accessSize) { case 64: - ABI_CallFunctionC(reinterpret_cast(&PowerPC::Read_U64), address); + ABI_CallFunctionC(PowerPC::Read_U64, address); break; case 32: - ABI_CallFunctionC(reinterpret_cast(&PowerPC::Read_U32), address); + ABI_CallFunctionC(PowerPC::Read_U32, address); break; case 16: - ABI_CallFunctionC(reinterpret_cast(&PowerPC::Read_U16_ZX), address); + ABI_CallFunctionC(PowerPC::Read_U16_ZX, address); break; case 8: - ABI_CallFunctionC(reinterpret_cast(&PowerPC::Read_U8_ZX), address); + ABI_CallFunctionC(PowerPC::Read_U8_ZX, address); break; } ABI_PopRegistersAndAdjustStack(registersInUse, 0); @@ -507,16 +507,16 @@ bool EmuCodeBlock::WriteToConstAddress(int accessSize, OpArg arg, u32 address, switch (accessSize) { case 64: - ABI_CallFunctionAC(64, (void*)&PowerPC::Write_U64, arg, address); + ABI_CallFunctionAC(64, PowerPC::Write_U64, arg, address); break; case 32: - ABI_CallFunctionAC(32, (void*)&PowerPC::Write_U32, arg, address); + ABI_CallFunctionAC(32, PowerPC::Write_U32, arg, address); break; case 16: - ABI_CallFunctionAC(16, (void*)&PowerPC::Write_U16, arg, address); + ABI_CallFunctionAC(16, PowerPC::Write_U16, arg, address); break; case 8: - ABI_CallFunctionAC(8, (void*)&PowerPC::Write_U8, arg, address); + ABI_CallFunctionAC(8, PowerPC::Write_U8, arg, address); break; } ABI_PopRegistersAndAdjustStack(registersInUse, 0); @@ -613,19 +613,16 @@ void EmuCodeBlock::SafeWriteRegToReg(OpArg reg_value, X64Reg reg_addr, int acces switch (accessSize) { case 64: - ABI_CallFunctionRR(swap ? ((void*)&PowerPC::Write_U64) : ((void*)&PowerPC::Write_U64_Swap), reg, - reg_addr); + ABI_CallFunctionRR(swap ? PowerPC::Write_U64 : PowerPC::Write_U64_Swap, reg, reg_addr); break; case 32: - ABI_CallFunctionRR(swap ? ((void*)&PowerPC::Write_U32) : ((void*)&PowerPC::Write_U32_Swap), reg, - reg_addr); + ABI_CallFunctionRR(swap ? PowerPC::Write_U32 : PowerPC::Write_U32_Swap, reg, reg_addr); break; case 16: - ABI_CallFunctionRR(swap ? ((void*)&PowerPC::Write_U16) : ((void*)&PowerPC::Write_U16_Swap), reg, - reg_addr); + ABI_CallFunctionRR(swap ? PowerPC::Write_U16 : PowerPC::Write_U16_Swap, reg, reg_addr); break; case 8: - ABI_CallFunctionRR((void*)&PowerPC::Write_U8, reg, reg_addr); + ABI_CallFunctionRR(PowerPC::Write_U8, reg, reg_addr); break; } ABI_PopRegistersAndAdjustStack(registersInUse, rsp_alignment); diff --git a/Source/Core/Core/PowerPC/Profiler.h b/Source/Core/Core/PowerPC/Profiler.h index bf4e368476..4c11af58ed 100644 --- a/Source/Core/Core/PowerPC/Profiler.h +++ b/Source/Core/Core/PowerPC/Profiler.h @@ -15,8 +15,8 @@ #if defined(_M_X86_64) #define PROFILER_QUERY_PERFORMANCE_COUNTER(pt) \ - MOV(64, R(ABI_PARAM1), Imm64((u64)pt)); \ - ABI_CallFunction((const void*)QueryPerformanceCounter) + MOV(64, R(ABI_PARAM1), Imm64(reinterpret_cast(pt))); \ + ABI_CallFunction(QueryPerformanceCounter) // block->ticCounter += block->ticStop - block->ticStart #define PROFILER_UPDATE_TIME(block) \