diff options
author | Lioncash <mathew1800@gmail.com> | 2016-03-09 08:41:07 +0100 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2016-03-09 09:13:01 +0100 |
commit | e3f9d09b28f662c699d14706f738c5f7881bf13c (patch) | |
tree | acd43362203b206f0623d5af3ebc392ce0c953df /src/common | |
parent | emitter: constexpr-ify helper functions (diff) | |
download | yuzu-e3f9d09b28f662c699d14706f738c5f7881bf13c.tar yuzu-e3f9d09b28f662c699d14706f738c5f7881bf13c.tar.gz yuzu-e3f9d09b28f662c699d14706f738c5f7881bf13c.tar.bz2 yuzu-e3f9d09b28f662c699d14706f738c5f7881bf13c.tar.lz yuzu-e3f9d09b28f662c699d14706f738c5f7881bf13c.tar.xz yuzu-e3f9d09b28f662c699d14706f738c5f7881bf13c.tar.zst yuzu-e3f9d09b28f662c699d14706f738c5f7881bf13c.zip |
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/x64/emitter.h | 8 |
1 files changed, 6 insertions, 2 deletions
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 <typename T> +OpArg ImmPtr(const T* imm) +{ #ifdef _ARCH_64 -inline OpArg ImmPtr(const void* imm) {return Imm64((u64)imm);} + return Imm64(reinterpret_cast<u64>(imm)); #else -inline OpArg ImmPtr(const void* imm) {return Imm32((u32)imm);} + return Imm32(reinterpret_cast<u32>(imm)); #endif +} inline u32 PtrOffset(const void* ptr, const void* base) { |