GS: Make vector types POD

Generates the same code in Release, but slightly difference code in Debug.
In Debug, with the default copy assignment operator, it turns into two
8-byte moves. With the overloaded operator, it turns into a function call
with a vector move.
This commit is contained in:
Stenzek 2024-01-08 22:39:36 +10:00 committed by Connor McLaughlin
parent 2e07328878
commit 50d8d06a94
4 changed files with 1 additions and 35 deletions

View File

@ -55,8 +55,6 @@ public:
GSVector4() = default;
constexpr GSVector4(const GSVector4&) = default;
constexpr static GSVector4 cxpr(float x, float y, float z, float w)
{
return GSVector4(cxpr_init, x, y, z, w);
@ -177,11 +175,6 @@ public:
return GSVector4(_mm_castpd_ps(_mm_set_pd(y, x)));
}
__forceinline void operator=(const GSVector4& v)
{
m = v.m;
}
__forceinline void operator=(float f)
{
#if _M_SSE >= 0x501

View File

@ -43,10 +43,7 @@ public:
__m128i m;
};
__forceinline constexpr GSVector4i()
: x(0), y(0), z(0), w(0)
{
}
GSVector4i() = default;
constexpr static GSVector4i cxpr(int x, int y, int z, int w)
{
@ -88,11 +85,6 @@ public:
{
}
__forceinline GSVector4i(const GSVector4i& v)
{
m = v.m;
}
__forceinline explicit GSVector4i(const GSVector2i& v)
{
m = _mm_loadl_epi64((__m128i*)&v);
@ -125,11 +117,6 @@ public:
#endif
__forceinline void operator=(const GSVector4i& v)
{
m = v.m;
}
__forceinline void operator=(int i)
{
#if _M_SSE >= 0x501

View File

@ -115,8 +115,6 @@ public:
#endif
}
constexpr GSVector8(const GSVector8& v) = default;
__forceinline explicit GSVector8(float f)
{
*this = f;
@ -163,11 +161,6 @@ public:
__forceinline static GSVector8 cast(const GSVector4& v);
__forceinline static GSVector8 cast(const GSVector4i& v);
__forceinline void operator=(const GSVector8& v)
{
m = v.m;
}
__forceinline void operator=(float f)
{
#if _M_SSE >= 0x501

View File

@ -90,8 +90,6 @@ public:
#endif
}
GSVector8i(const GSVector8i& v) = default;
__forceinline explicit GSVector8i(int i)
{
*this = i;
@ -107,11 +105,6 @@ public:
{
}
__forceinline void operator=(const GSVector8i& v)
{
m = v.m;
}
__forceinline void operator=(int i)
{
m = _mm256_broadcastd_epi32(_mm_cvtsi32_si128(i)); // m = _mm256_set1_epi32(i);