From 018c85c24876e2d87faa6567764a6005b1743f3a Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 22 Oct 2015 15:20:35 -0400 Subject: Arm64Emitter: Mark trivial functions as constexpr --- Source/Core/Common/Arm64Emitter.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Source/Core/Common/Arm64Emitter.cpp') diff --git a/Source/Core/Common/Arm64Emitter.cpp b/Source/Core/Common/Arm64Emitter.cpp index 16031372f4..1c173731cf 100644 --- a/Source/Core/Common/Arm64Emitter.cpp +++ b/Source/Core/Common/Arm64Emitter.cpp @@ -815,32 +815,32 @@ void ARM64XEmitter::EncodeLoadStoreUnscaled(u32 size, u32 op, ARM64Reg Rt, ARM64 Write32((size << 30) | (0b111 << 27) | (op << 22) | ((imm & 0x1FF) << 12) | (Rn << 5) | Rt); } -static inline bool IsInRangeImm19(s64 distance) +static constexpr bool IsInRangeImm19(s64 distance) { return (distance >= -0x40000 && distance <= 0x3FFFF); } -static inline bool IsInRangeImm14(s64 distance) +static constexpr bool IsInRangeImm14(s64 distance) { return (distance >= -0x2000 && distance <= 0x1FFF); } -static inline bool IsInRangeImm26(s64 distance) +static constexpr bool IsInRangeImm26(s64 distance) { return (distance >= -0x2000000 && distance <= 0x1FFFFFF); } -static inline u32 MaskImm19(s64 distance) +static constexpr u32 MaskImm19(s64 distance) { return distance & 0x7FFFF; } -static inline u32 MaskImm14(s64 distance) +static constexpr u32 MaskImm14(s64 distance) { return distance & 0x3FFF; } -static inline u32 MaskImm26(s64 distance) +static constexpr u32 MaskImm26(s64 distance) { return distance & 0x3FFFFFF; } -- cgit v1.2.3 From 2630752ffea63ecc1ddffa8a4fc18ec63bae22bc Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 22 Oct 2015 15:32:11 -0400 Subject: Arm64Emitter: Get rid of a pointer cast --- Source/Core/Common/Arm64Emitter.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Source/Core/Common/Arm64Emitter.cpp') diff --git a/Source/Core/Common/Arm64Emitter.cpp b/Source/Core/Common/Arm64Emitter.cpp index 1c173731cf..6546686716 100644 --- a/Source/Core/Common/Arm64Emitter.cpp +++ b/Source/Core/Common/Arm64Emitter.cpp @@ -3,6 +3,7 @@ // Refer to the license.txt file included. #include +#include #include #include "Common/Arm64Emitter.h" @@ -312,6 +313,12 @@ const u8* ARM64XEmitter::AlignCodePage() return m_code; } +void ARM64XEmitter::Write32(u32 value) +{ + std::memcpy(m_code, &value, sizeof(u32)); + m_code += sizeof(u32); +} + void ARM64XEmitter::FlushIcache() { FlushIcacheSection(m_lastCacheFlushEnd, m_code); -- cgit v1.2.3