diff --git a/rpcs3/util/endian.hpp b/rpcs3/util/endian.hpp index aee04c1e55..6cd586e96b 100644 --- a/rpcs3/util/endian.hpp +++ b/rpcs3/util/endian.hpp @@ -252,6 +252,12 @@ namespace stx template se_t& operator&=(const T1& rhs) { + if constexpr (std::is_integral_v) + { + m_data = std::bit_cast(static_cast(std::bit_cast(m_data) & std::bit_cast(static_cast(rhs)))); + return *this; + } + *this = value() & rhs; return *this; } @@ -259,6 +265,12 @@ namespace stx template se_t& operator|=(const T1& rhs) { + if constexpr (std::is_integral_v) + { + m_data = std::bit_cast(static_cast(std::bit_cast(m_data) | std::bit_cast(static_cast(rhs)))); + return *this; + } + *this = value() | rhs; return *this; } @@ -266,6 +278,12 @@ namespace stx template se_t& operator^=(const T1& rhs) { + if constexpr (std::is_integral_v) + { + m_data = std::bit_cast(static_cast(std::bit_cast(m_data) ^ std::bit_cast(static_cast(rhs)))); + return *this; + } + *this = value() ^ rhs; return *this; }