diff --git a/src/xenia/base/vec128.h b/src/xenia/base/vec128.h index 0d5e985eb..139227cc5 100644 --- a/src/xenia/base/vec128.h +++ b/src/xenia/base/vec128.h @@ -105,12 +105,54 @@ typedef struct alignas(16) vec128_s { }; }; + vec128_s() = default; + vec128_s(const vec128_s& other) { + high = other.high; + low = other.low; + } + + vec128_s& operator=(const vec128_s& b) { + high = b.high; + low = b.low; + return *this; + } + bool operator==(const vec128_s& b) const { return low == b.low && high == b.high; } bool operator!=(const vec128_s& b) const { return low != b.low || high != b.high; } + vec128_s operator^(const vec128_s& b) const { + vec128_s a = *this; + a.high ^= b.high; + a.low ^= b.low; + return a; + }; + vec128_s& operator^=(const vec128_s& b) { + *this = *this ^ b; + return *this; + }; + vec128_s operator&(const vec128_s& b) const { + vec128_s a = *this; + a.high &= b.high; + a.low &= b.low; + return a; + }; + vec128_s& operator&=(const vec128_s& b) { + *this = *this & b; + return *this; + }; + vec128_s operator|(const vec128_s& b) const { + vec128_s a = *this; + a.high |= b.high; + a.low |= b.low; + return a; + }; + vec128_s& operator|=(const vec128_s& b) { + *this = *this | b; + return *this; + }; } vec128_t; static inline vec128_t vec128i(uint32_t src) {