summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2018-03-25 16:01:48 -0400
committerLioncash <mathew1800@gmail.com>2018-03-26 18:21:21 -0400
commit964201f2d3f67d389faa06556322bc04a554be3e (patch)
tree85eb476a520c31ca1bf1be3c0bb8567a930ef365 /Source
parent7f583b66cbb32b0a5c02d53e78540b72d0bda316 (diff)
x64Emitter: Use std::tie in OpArg's operator==. Provide operator!= for symmetry
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/Common/x64Emitter.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/Source/Core/Common/x64Emitter.h b/Source/Core/Common/x64Emitter.h
index 648fafe08e..d7ebc058e6 100644
--- a/Source/Core/Common/x64Emitter.h
+++ b/Source/Core/Common/x64Emitter.h
@@ -9,6 +9,7 @@
#include <cstddef>
#include <cstring>
#include <functional>
+#include <tuple>
#include <type_traits>
#include "Common/Assert.h"
@@ -117,11 +118,12 @@ struct OpArg
indexReg{static_cast<u16>(scaled_reg)}, offset{offset_}
{
}
- bool operator==(const OpArg& b) const
+ constexpr bool operator==(const OpArg& b) const
{
- return operandReg == b.operandReg && scale == b.scale && offsetOrBaseReg == b.offsetOrBaseReg &&
- indexReg == b.indexReg && offset == b.offset;
+ return std::tie(scale, offsetOrBaseReg, indexReg, offset, operandReg) ==
+ std::tie(b.scale, b.offsetOrBaseReg, b.indexReg, b.offset, b.operandReg);
}
+ constexpr bool operator!=(const OpArg& b) const { return !operator==(b); }
u64 Imm64() const
{
DEBUG_ASSERT(scale == SCALE_IMM64);