From e3f9d09b28f662c699d14706f738c5f7881bf13c Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 9 Mar 2016 02:41:07 -0500 Subject: emitter: templatize ImmPtr --- src/common/x64/emitter.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/common') diff --git a/src/common/x64/emitter.h b/src/common/x64/emitter.h index 865b724a8..7c6548fb5 100644 --- a/src/common/x64/emitter.h +++ b/src/common/x64/emitter.h @@ -274,11 +274,15 @@ constexpr OpArg SImmAuto(s32 imm) { return OpArg(imm, (imm >= 128 || imm < -128) ? SCALE_IMM32 : SCALE_IMM8); } +template +OpArg ImmPtr(const T* imm) +{ #ifdef _ARCH_64 -inline OpArg ImmPtr(const void* imm) {return Imm64((u64)imm);} + return Imm64(reinterpret_cast(imm)); #else -inline OpArg ImmPtr(const void* imm) {return Imm32((u32)imm);} + return Imm32(reinterpret_cast(imm)); #endif +} inline u32 PtrOffset(const void* ptr, const void* base) { -- cgit v1.2.3