Common: SSE2 backsupport for vector classes

shuffle8() sucks, the rest aren't _too_ bad.
This commit is contained in:
Stenzek
2024-09-22 17:03:58 +10:00
parent e1c876671a
commit c439de6364
5 changed files with 446 additions and 64 deletions

View File

@@ -11,7 +11,6 @@
#include <cmath>
#include <cstring>
#define GSVECTOR_HAS_UNSIGNED 1
#define GSVECTOR_HAS_SRLV 1
class GSVector2;
@@ -951,8 +950,10 @@ public:
ALWAYS_INLINE bool rempty() const { return lt32(zwzw()).mask() != 0x00ff; }
// TODO: Optimize for no-simd, this generates crap code.
ALWAYS_INLINE GSVector4i runion(const GSVector4i& v) const { return min_s32(v).upl64(max_s32(v).srl<8>()); }
GSVector4i runion(const GSVector4i& v) const
{
return GSVector4i(std::min(x, v.x), std::min(y, v.y), std::max(z, v.z), std::max(w, v.w));
}
ALWAYS_INLINE GSVector4i rintersect(const GSVector4i& v) const { return sat_s32(v); }
ALWAYS_INLINE bool rintersects(const GSVector4i& v) const { return !rintersect(v).rempty(); }