diff --git a/Utilities/address_range.h b/Utilities/address_range.h index e7128c2286..c12a388711 100644 --- a/Utilities/address_range.h +++ b/Utilities/address_range.h @@ -239,16 +239,11 @@ namespace utils } // Comparison Operators - bool operator ==(const address_range &other) const + bool operator ==(const address_range& other) const { return (start == other.start && end == other.end); } - bool operator !=(const address_range &other) const - { - return (start != other.start || end != other.end); - } - /** * Debug */ diff --git a/Utilities/bit_set.h b/Utilities/bit_set.h index 6daf762c2d..ce795e8eba 100644 --- a/Utilities/bit_set.h +++ b/Utilities/bit_set.h @@ -138,14 +138,9 @@ public: return bs_t(0, lhs.m_data ^ rhs.m_data); } - friend constexpr bool operator ==(bs_t lhs, bs_t rhs) + constexpr bool operator ==(bs_t rhs) const { - return lhs.m_data == rhs.m_data; - } - - friend constexpr bool operator !=(bs_t lhs, bs_t rhs) - { - return lhs.m_data != rhs.m_data; + return m_data == rhs.m_data; } constexpr bool test_and_set(T bit) diff --git a/Utilities/geometry.h b/Utilities/geometry.h index b0cd54d2ed..e37ab7ed16 100644 --- a/Utilities/geometry.h +++ b/Utilities/geometry.h @@ -102,14 +102,6 @@ struct size2_base return width == rhs.width && height == rhs.height; } -#if __cpp_impl_three_way_comparison >= 201711 -#else - constexpr bool operator !=(const size2_base& rhs) const - { - return width != rhs.width || height != rhs.height; - } -#endif - template explicit constexpr operator size2_base() const { @@ -211,19 +203,6 @@ struct position1_base return x == rhs; } -#if __cpp_impl_three_way_comparison >= 201711 -#else - bool operator !=(const position1_base& rhs) const - { - return !(*this == rhs); - } - - bool operator !=(T rhs) const - { - return !(*this == rhs); - } -#endif - template explicit operator position1_base() const { @@ -383,19 +362,6 @@ struct position2_base return x == rhs && y == rhs; } -#if __cpp_impl_three_way_comparison >= 201711 -#else - constexpr bool operator !=(const position2_base& rhs) const - { - return !(*this == rhs); - } - - constexpr bool operator !=(T rhs) const - { - return !(*this == rhs); - } -#endif - template explicit constexpr operator position2_base() const { @@ -478,19 +444,6 @@ struct position3_base return x == rhs && y == rhs && z == rhs; } -#if __cpp_impl_three_way_comparison >= 201711 -#else - bool operator !=(const position3_base& rhs) const - { - return !(*this == rhs); - } - - bool operator !=(T rhs) const - { - return !(*this == rhs); - } -#endif - template explicit operator position3_base() const { @@ -571,19 +524,6 @@ struct position4_base return x == rhs && y == rhs && z == rhs && w == rhs; } -#if __cpp_impl_three_way_comparison >= 201711 -#else - constexpr bool operator !=(const position4_base& rhs) const - { - return !(*this == rhs); - } - - constexpr bool operator !=(T rhs) const - { - return !(*this == rhs); - } -#endif - template explicit constexpr operator position4_base() const { @@ -639,14 +579,6 @@ struct coord_base return position == rhs.position && size == rhs.size; } -#if __cpp_impl_three_way_comparison >= 201711 -#else - constexpr bool operator != (const coord_base& rhs) const - { - return position != rhs.position || size != rhs.size; - } -#endif - template explicit constexpr operator coord_base() const { @@ -718,14 +650,6 @@ struct area_base return x1 == rhs.x1 && x2 == rhs.x2 && y1 == rhs.y1 && y2 == rhs.y2; } -#if __cpp_impl_three_way_comparison >= 201711 -#else - constexpr bool operator != (const area_base& rhs) const - { - return !(*this == rhs); - } -#endif - constexpr area_base operator - (const size2_base& size) const { return{ x1 - size.width, y1 - size.height, x2 - size.width, y2 - size.height }; @@ -864,17 +788,10 @@ struct color4_base { } - constexpr bool operator == (const color4_base& rhs) const + constexpr bool operator ==(const color4_base& rhs) const { return r == rhs.r && g == rhs.g && b == rhs.b && a == rhs.a; } -#if __cpp_impl_three_way_comparison >= 201711 -#else - constexpr bool operator != (const color4_base& rhs) const - { - return !(*this == rhs); - } -#endif void operator *= (const color4_base& rhs) { @@ -940,17 +857,10 @@ struct color3_base { } - constexpr bool operator == (const color3_base& rhs) const + constexpr bool operator ==(const color3_base& rhs) const { return r == rhs.r && g == rhs.g && b == rhs.b; } -#if __cpp_impl_three_way_comparison >= 201711 -#else - constexpr bool operator != (const color3_base& rhs) const - { - return !(*this == rhs); - } -#endif template explicit constexpr operator color3_base() const @@ -984,19 +894,11 @@ struct color2_base { } - constexpr bool operator == (const color2_base& rhs) const + constexpr bool operator ==(const color2_base& rhs) const { return r == rhs.r && g == rhs.g; } -#if __cpp_impl_three_way_comparison >= 201711 -#else - constexpr bool operator != (const color2_base& rhs) const - { - return !(*this == rhs); - } -#endif - template explicit constexpr operator color2_base() const { @@ -1018,19 +920,11 @@ struct color1_base { } - constexpr bool operator == (const color1_base& rhs) const + constexpr bool operator ==(const color1_base& rhs) const { return r == rhs.r; } -#if __cpp_impl_three_way_comparison >= 201711 -#else - constexpr bool operator != (const color1_base& rhs) const - { - return !(*this == rhs); - } -#endif - template explicit constexpr operator color1_base() const { diff --git a/Utilities/lockless.h b/Utilities/lockless.h index d3df6d9710..b86377ee98 100644 --- a/Utilities/lockless.h +++ b/Utilities/lockless.h @@ -161,11 +161,6 @@ public: return m_ptr == rhs.m_ptr; } - bool operator !=(const lf_queue_iterator& rhs) const - { - return m_ptr != rhs.m_ptr; - } - T& operator *() const { return m_ptr->m_data; diff --git a/rpcs3/Emu/Cell/SPURecompiler.h b/rpcs3/Emu/Cell/SPURecompiler.h index fd35375b11..2bec70cb42 100644 --- a/rpcs3/Emu/Cell/SPURecompiler.h +++ b/rpcs3/Emu/Cell/SPURecompiler.h @@ -51,11 +51,6 @@ struct spu_program bool operator==(const spu_program& rhs) const noexcept; - bool operator!=(const spu_program& rhs) const noexcept - { - return !(*this == rhs); - } - bool operator<(const spu_program& rhs) const noexcept; }; diff --git a/rpcs3/Emu/Memory/vm_ptr.h b/rpcs3/Emu/Memory/vm_ptr.h index f7f4500fc2..8b2128196c 100644 --- a/rpcs3/Emu/Memory/vm_ptr.h +++ b/rpcs3/Emu/Memory/vm_ptr.h @@ -354,75 +354,15 @@ namespace vm } template - friend bool operator ==(const null_t&, const _ptr_base& ptr) + constexpr bool operator ==(const _ptr_base& ptr) const { return !ptr; } template - friend bool operator ==(const _ptr_base& ptr, const null_t&) + constexpr bool operator <(const _ptr_base& ptr) const { - return !ptr; - } - - template - friend bool operator !=(const null_t&, const _ptr_base& ptr) - { - return ptr.operator bool(); - } - - template - friend bool operator !=(const _ptr_base& ptr, const null_t&) - { - return ptr.operator bool(); - } - - template - friend bool operator <(const null_t&, const _ptr_base& ptr) - { - return ptr.operator bool(); - } - - template - friend bool operator <(const _ptr_base&, const null_t&) - { - return false; - } - - template - friend bool operator <=(const null_t&, const _ptr_base&) - { - return true; - } - - template - friend bool operator <=(const _ptr_base& ptr, const null_t&) - { - return !ptr.operator bool(); - } - - template - friend bool operator >(const null_t&, const _ptr_base&) - { - return false; - } - - template - friend bool operator >(const _ptr_base& ptr, const null_t&) - { - return ptr.operator bool(); - } - - template - friend bool operator >=(const null_t&, const _ptr_base& ptr) - { - return !ptr; - } - - template - friend bool operator >=(const _ptr_base&, const null_t&) - { - return true; + return 0 < ptr.addr(); } }; @@ -436,12 +376,6 @@ inline vm::if_comparable_t operator ==(const vm::_ptr_base -inline vm::if_comparable_t operator !=(const vm::_ptr_base& left, const vm::_ptr_base& right) -{ - return left.addr() != right.addr(); -} - template inline vm::if_comparable_t operator <(const vm::_ptr_base& left, const vm::_ptr_base& right) { diff --git a/rpcs3/Emu/RSX/Common/texture_cache_predictor.h b/rpcs3/Emu/RSX/Common/texture_cache_predictor.h index 133e98088b..73a87d324b 100644 --- a/rpcs3/Emu/RSX/Common/texture_cache_predictor.h +++ b/rpcs3/Emu/RSX/Common/texture_cache_predictor.h @@ -101,11 +101,6 @@ namespace rsx { return cpu_range == other.cpu_range && format == other.format && context == other.context; } - - bool operator!=(const texture_cache_predictor_key& other) const - { - return !operator==(other); - } }; /** diff --git a/rpcs3/Emu/RSX/Common/texture_cache_utils.h b/rpcs3/Emu/RSX/Common/texture_cache_utils.h index 72657f51d4..01f2c32b1b 100644 --- a/rpcs3/Emu/RSX/Common/texture_cache_utils.h +++ b/rpcs3/Emu/RSX/Common/texture_cache_utils.h @@ -106,7 +106,6 @@ namespace rsx inline reference operator++() { next(); return **this; } inline reference operator++(int) { auto &res = **this; next(); return res; } inline bool operator==(const iterator_tmpl &rhs) const { return idx == rhs.idx; } - inline bool operator!=(const iterator_tmpl &rhs) const { return idx != rhs.idx; } }; using iterator = iterator_tmpl; @@ -819,7 +818,6 @@ namespace rsx inline reference operator++() { next(); return *obj; } inline reference operator++(int) { auto *ptr = obj; next(); return *ptr; } inline bool operator==(const range_iterator_tmpl &rhs) const { return obj == rhs.obj && unowned_remaining == rhs.unowned_remaining; } - inline bool operator!=(const range_iterator_tmpl &rhs) const { return !operator==(rhs); } inline void set_end(u32 new_end) { diff --git a/rpcs3/Emu/RSX/gcm_enums.h b/rpcs3/Emu/RSX/gcm_enums.h index d30fad47f7..264b84db73 100644 --- a/rpcs3/Emu/RSX/gcm_enums.h +++ b/rpcs3/Emu/RSX/gcm_enums.h @@ -68,8 +68,7 @@ namespace rsx surface_depth_format to_surface_depth_format(u8 in); - constexpr - bool operator == (surface_depth_format2 rhs, surface_depth_format lhs) + constexpr bool operator ==(surface_depth_format2 rhs, surface_depth_format lhs) { switch (lhs) { @@ -82,25 +81,6 @@ namespace rsx } } - // GCC requires every operator declared explicitly - constexpr - bool operator == (surface_depth_format rhs, surface_depth_format2 lhs) - { - return lhs == rhs; - } - - constexpr - bool operator != (surface_depth_format2 rhs, surface_depth_format lhs) - { - return !(rhs == lhs); - } - - constexpr - bool operator != (surface_depth_format rhs, surface_depth_format2 lhs) - { - return !(lhs == rhs); - } - enum class surface_raster_type : u8 { undefined = 0, diff --git a/rpcs3/util/endian.hpp b/rpcs3/util/endian.hpp index e55812180d..f7a0542f39 100644 --- a/rpcs3/util/endian.hpp +++ b/rpcs3/util/endian.hpp @@ -285,15 +285,6 @@ public: return value() == rhs; } -#if __cpp_impl_three_way_comparison >= 201711 -#else - template ())> - constexpr bool operator!=(const T2& rhs) const noexcept - { - return !operator==(rhs); - } -#endif - private: template static constexpr bool check_args_for_bitwise_op() diff --git a/rpcs3/util/typeindices.hpp b/rpcs3/util/typeindices.hpp index 768ae16df1..dc3611f21d 100644 --- a/rpcs3/util/typeindices.hpp +++ b/rpcs3/util/typeindices.hpp @@ -140,11 +140,6 @@ namespace stx { return ptr == r.ptr; } - - bool operator!=(const const_iterator& r) const - { - return ptr != r.ptr; - } }; const_iterator begin() const diff --git a/rpcs3/util/v128.hpp b/rpcs3/util/v128.hpp index fbfd102e58..e31d9446b1 100644 --- a/rpcs3/util/v128.hpp +++ b/rpcs3/util/v128.hpp @@ -207,8 +207,6 @@ union alignas(16) v128 bool operator==(const v128& right) const; - bool operator!=(const v128& right) const; - // result = (~left) & (right) static inline v128 andnot(const v128& left, const v128& right); diff --git a/rpcs3/util/v128sse.hpp b/rpcs3/util/v128sse.hpp index 4dfe036c32..7d4de80c2f 100644 --- a/rpcs3/util/v128sse.hpp +++ b/rpcs3/util/v128sse.hpp @@ -151,11 +151,6 @@ inline bool v128::operator==(const v128& right) const return _mm_movemask_epi8(v128::eq32(*this, right).vi) == 0xffff; } -inline bool v128::operator!=(const v128& right) const -{ - return !operator==(right); -} - // result = (~left) & (right) inline v128 v128::andnot(const v128& left, const v128& right) {