diff --git a/src/common/gsvector.h b/src/common/gsvector.h index 8dda3b369..04ff6f153 100644 --- a/src/common/gsvector.h +++ b/src/common/gsvector.h @@ -7,22 +7,6 @@ #include -enum Align_Mode -{ - Align_Outside, - Align_Inside, - Align_NegInf, - Align_PosInf -}; - -enum Round_Mode -{ - Round_NearestInt = 8, - Round_NegInf = 9, - Round_PosInf = 10, - Round_Truncate = 11 -}; - template class GSVector2T { diff --git a/src/common/gsvector_neon.h b/src/common/gsvector_neon.h index 622ba4ff4..6bfd89e2a 100644 --- a/src/common/gsvector_neon.h +++ b/src/common/gsvector_neon.h @@ -141,50 +141,6 @@ public: ALWAYS_INLINE bool rintersects(const GSVector4i& v) const { return !rintersect(v).rempty(); } ALWAYS_INLINE bool rcontains(const GSVector4i& v) const { return rintersect(v).eq(v); } - template - GSVector4i _ralign_helper(const GSVector4i& mask) const - { - GSVector4i v; - - switch (mode) - { - case Align_Inside: - v = add32(mask); - break; - case Align_Outside: - v = add32(mask.zwxy()); - break; - case Align_NegInf: - v = *this; - break; - case Align_PosInf: - v = add32(mask.xyxy()); - break; - - default: - break; - } - - return v.andnot(mask.xyxy()); - } - - /// Align the rect using mask values that already have one subtracted (1 << n - 1 aligns to 1 << n) - template - GSVector4i ralign_presub(const GSVector2i& a) const - { - return _ralign_helper(GSVector4i(a)); - } - - template - GSVector4i ralign(const GSVector2i& a) const - { - // a must be 1 << n - - return _ralign_helper(GSVector4i(a) - GSVector4i(1, 1)); - } - - // - ALWAYS_INLINE u32 rgba32() const { GSVector4i v = *this; @@ -1347,19 +1303,6 @@ public: return GSVector4(recip); } - template - ALWAYS_INLINE GSVector4 round() const - { - if constexpr (mode == Round_NegInf) - return floor(); - else if constexpr (mode == Round_PosInf) - return ceil(); - else if constexpr (mode == Round_NearestInt) - return GSVector4(vrndnq_f32(v4s)); - else - return GSVector4(vrndq_f32(v4s)); - } - ALWAYS_INLINE GSVector4 floor() const { return GSVector4(vrndmq_f32(v4s)); } ALWAYS_INLINE GSVector4 ceil() const { return GSVector4(vrndpq_f32(v4s)); } diff --git a/src/common/gsvector_nosimd.h b/src/common/gsvector_nosimd.h index debaf164c..bf2a9a0c9 100644 --- a/src/common/gsvector_nosimd.h +++ b/src/common/gsvector_nosimd.h @@ -187,50 +187,6 @@ public: ALWAYS_INLINE bool rintersects(const GSVector4i& v) const { return !rintersect(v).rempty(); } ALWAYS_INLINE bool rcontains(const GSVector4i& v) const { return rintersect(v).eq(v); } - template - GSVector4i _ralign_helper(const GSVector4i& mask) const - { - GSVector4i v; - - switch (mode) - { - case Align_Inside: - v = add32(mask); - break; - case Align_Outside: - v = add32(mask.zwxy()); - break; - case Align_NegInf: - v = *this; - break; - case Align_PosInf: - v = add32(mask.xyxy()); - break; - - default: - break; - } - - return v.andnot(mask.xyxy()); - } - - /// Align the rect using mask values that already have one subtracted (1 << n - 1 aligns to 1 << n) - template - GSVector4i ralign_presub(const GSVector2i& v) const - { - return _ralign_helper(GSVector4i(v)); - } - - template - GSVector4i ralign(const GSVector2i& v) const - { - // a must be 1 << n - - return _ralign_helper(GSVector4i(v).sub32(GSVector4i(1, 1))); - } - - // - ALWAYS_INLINE u32 rgba32() const { GSVector4i v = *this; diff --git a/src/common/gsvector_sse.h b/src/common/gsvector_sse.h index 41351cc4f..213c4b92f 100644 --- a/src/common/gsvector_sse.h +++ b/src/common/gsvector_sse.h @@ -141,47 +141,6 @@ public: ALWAYS_INLINE bool rintersects(const GSVector4i& v) const { return !rintersect(v).rempty(); } ALWAYS_INLINE bool rcontains(const GSVector4i& v) const { return rintersect(v).eq(v); } - template - GSVector4i _ralign_helper(const GSVector4i& mask) const - { - GSVector4i v; - - switch (mode) - { - case Align_Inside: - v = add32(mask); - break; - case Align_Outside: - v = add32(mask.zwxy()); - break; - case Align_NegInf: - v = *this; - break; - case Align_PosInf: - v = add32(mask.xyxy()); - break; - - default: - break; - } - - return v.andnot(mask.xyxy()); - } - - /// Align the rect using mask values that already have one subtracted (1 << n - 1 aligns to 1 << n) - template - GSVector4i ralign_presub(const GSVector2i& v) const - { - return _ralign_helper(GSVector4i(v)); - } - - template - GSVector4i ralign(const GSVector2i& v) const - { - // a must be 1 << n - - return _ralign_helper(GSVector4i(v).sub32(GSVector4i(1, 1))); - } // @@ -989,15 +948,9 @@ public: return (v_ + v_) - (v_ * v_) * *this; } - template - ALWAYS_INLINE GSVector4 round() const - { - return GSVector4(_mm_round_ps(m, mode)); - } + ALWAYS_INLINE GSVector4 floor() const { return GSVector4(_mm_round_ps(m, _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC)); } - ALWAYS_INLINE GSVector4 floor() const { return round(); } - - ALWAYS_INLINE GSVector4 ceil() const { return round(); } + ALWAYS_INLINE GSVector4 ceil() const { return GSVector4(_mm_round_ps(m, _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC)); } ALWAYS_INLINE GSVector4 madd(const GSVector4& a_, const GSVector4& b_) const {