diff --git a/src/common/gsvector_neon.h b/src/common/gsvector_neon.h index bcde43d49..04f8dc0dc 100644 --- a/src/common/gsvector_neon.h +++ b/src/common/gsvector_neon.h @@ -2346,6 +2346,8 @@ public: return GSVector4i(vcombine_s32(xy.v2s, zw.v2s)); } + ALWAYS_INLINE static GSVector4i xyxy(const GSVector2i& xyzw) { return GSVector4i(vcombine_s32(xyzw.v2s, xyzw.v2s)); } + ALWAYS_INLINE GSVector2i xy() const { return GSVector2i(vget_low_s32(v4s)); } ALWAYS_INLINE GSVector2i zw() const { return GSVector2i(vget_high_s32(v4s)); } @@ -3153,6 +3155,8 @@ public: return GSVector4(vcombine_f32(l.v2s, h.v2s)); } + ALWAYS_INLINE static GSVector4 xyxy(const GSVector2& l) { return GSVector4(vcombine_f32(l.v2s, l.v2s)); } + #define VECTOR4_SHUFFLE_4(xs, xn, ys, yn, zs, zn, ws, wn) \ ALWAYS_INLINE GSVector4 xs##ys##zs##ws() const \ { \ diff --git a/src/common/gsvector_nosimd.h b/src/common/gsvector_nosimd.h index 8293131ea..32817ed1f 100644 --- a/src/common/gsvector_nosimd.h +++ b/src/common/gsvector_nosimd.h @@ -1665,6 +1665,8 @@ public: return GSVector4i(xy.x, xy.y, zw.x, zw.y); } + ALWAYS_INLINE static GSVector4i xyxy(const GSVector2i& xyzw) { return GSVector4i(xyzw.x, xyzw.y, xyzw.x, xyzw.y); } + ALWAYS_INLINE GSVector2i xy() const { return GSVector2i(x, y); } ALWAYS_INLINE GSVector2i zw() const { return GSVector2i(z, w); } @@ -2320,6 +2322,8 @@ public: ALWAYS_INLINE static GSVector4 xyxy(const GSVector2& l, const GSVector2& h) { return GSVector4(l.x, l.y, h.x, h.y); } + ALWAYS_INLINE static GSVector4 xyxy(const GSVector2& l) { return GSVector4(l.x, l.y, l.x, l.y); } + #define VECTOR4_SHUFFLE_4(xs, xn, ys, yn, zs, zn, ws, wn) \ ALWAYS_INLINE GSVector4 xs##ys##zs##ws() const { return GSVector4(F32[xn], F32[yn], F32[zn], F32[wn]); } diff --git a/src/common/gsvector_sse.h b/src/common/gsvector_sse.h index a3fd46f83..358acb8ca 100644 --- a/src/common/gsvector_sse.h +++ b/src/common/gsvector_sse.h @@ -1831,6 +1831,11 @@ public: ALWAYS_INLINE GSVector4i xyxy(const GSVector4i& v) const { return upl64(v); } + ALWAYS_INLINE static GSVector4i xyxy(const GSVector2i& xyzw) + { + return GSVector4i(_mm_unpacklo_epi64(xyzw.m, xyzw.m)); + } + ALWAYS_INLINE static GSVector4i xyxy(const GSVector2i& xy, const GSVector2i& zw) { return GSVector4i(_mm_unpacklo_epi64(xy.m, zw.m)); @@ -2421,6 +2426,11 @@ public: return GSVector4(_mm_movelh_ps(l.m, h.m)); } + ALWAYS_INLINE static GSVector4 xyxy(const GSVector2& l) + { + return GSVector4(_mm_movelh_ps(l.m, l.m)); + } + #define VECTOR4_SHUFFLE_4(xs, xn, ys, yn, zs, zn, ws, wn) \ ALWAYS_INLINE GSVector4 xs##ys##zs##ws() const \ { \