From 9f683f9bb15aa865dd4168fbc40b8c314d852d6f Mon Sep 17 00:00:00 2001 From: MerryMage Date: Mon, 15 Oct 2018 21:02:17 +0100 Subject: [PATCH] BitSet: Add << operator --- Source/Core/Common/BitSet.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/Core/Common/BitSet.h b/Source/Core/Common/BitSet.h index 4425b6067c..5154735f86 100644 --- a/Source/Core/Common/BitSet.h +++ b/Source/Core/Common/BitSet.h @@ -193,10 +193,14 @@ public: constexpr BitSet operator&(BitSet other) const { return BitSet(m_val & other.m_val); } constexpr BitSet operator^(BitSet other) const { return BitSet(m_val ^ other.m_val); } constexpr BitSet operator~() const { return BitSet(~m_val); } + constexpr BitSet operator<<(IntTy shift) const { return BitSet(m_val << shift); } + constexpr BitSet operator>>(IntTy shift) const { return BitSet(m_val >> shift); } constexpr explicit operator bool() const { return m_val != 0; } BitSet& operator|=(BitSet other) { return *this = *this | other; } BitSet& operator&=(BitSet other) { return *this = *this & other; } BitSet& operator^=(BitSet other) { return *this = *this ^ other; } + BitSet& operator<<=(IntTy shift) { return *this = *this << shift; } + BitSet& operator>>=(IntTy shift) { return *this = *this >> shift; } // Warning: Even though on modern CPUs this is a single fast instruction, // Dolphin's official builds do not currently assume POPCNT support on x86, // so slower explicit bit twiddling is generated. Still should generally