3PL_ALWAYS_INLINE plSimdVec4i::plSimdVec4i()
5#if PL_ENABLED(PL_MATH_CHECK_FOR_NAN)
10PL_ALWAYS_INLINE plSimdVec4i::plSimdVec4i(plInt32 xyzw)
15PL_ALWAYS_INLINE plSimdVec4i::plSimdVec4i(plInt32 x, plInt32 y, plInt32 z, plInt32 w)
30PL_ALWAYS_INLINE
void plSimdVec4i::Set(plInt32 xyzw)
35PL_ALWAYS_INLINE
void plSimdVec4i::Set(plInt32 x, plInt32 y, plInt32 z, plInt32 w)
40PL_ALWAYS_INLINE
void plSimdVec4i::SetZero()
46PL_ALWAYS_INLINE
void plSimdVec4i::Load(
const plInt32* pInts)
49 for (
int i = 0; i < N; ++i)
51 (&m_v.x)[i] = pInts[i];
56PL_ALWAYS_INLINE
void plSimdVec4i::Store(plInt32* pInts)
const
58 for (
int i = 0; i < N; ++i)
60 pInts[i] = (&m_v.x)[i];
64PL_ALWAYS_INLINE
plSimdVec4f plSimdVec4i::ToFloat()
const
67 result.m_v.x = (float)m_v.x;
68 result.m_v.y = (float)m_v.y;
69 result.m_v.z = (float)m_v.z;
70 result.m_v.w = (float)m_v.w;
79 result.m_v.x = (plInt32)f.m_v.x;
80 result.m_v.y = (plInt32)f.m_v.y;
81 result.m_v.z = (plInt32)f.m_v.z;
82 result.m_v.w = (plInt32)f.m_v.w;
88PL_ALWAYS_INLINE plInt32 plSimdVec4i::GetComponent()
const
93PL_ALWAYS_INLINE plInt32 plSimdVec4i::x()
const
98PL_ALWAYS_INLINE plInt32 plSimdVec4i::y()
const
103PL_ALWAYS_INLINE plInt32 plSimdVec4i::z()
const
108PL_ALWAYS_INLINE plInt32 plSimdVec4i::w()
const
113template <plSwizzle::Enum s>
114PL_ALWAYS_INLINE
plSimdVec4i plSimdVec4i::Get()
const
118 const plInt32* v = &m_v.x;
119 result.m_v.x = v[(s & 0x3000) >> 12];
120 result.m_v.y = v[(s & 0x0300) >> 8];
121 result.m_v.z = v[(s & 0x0030) >> 4];
122 result.m_v.w = v[(s & 0x0003)];
127template <plSwizzle::Enum s>
132 const plInt32* v = &m_v.x;
133 const plInt32* o = &other.m_v.x;
134 result.m_v.x = v[(s & 0x3000) >> 12];
135 result.m_v.y = v[(s & 0x0300) >> 8];
136 result.m_v.z = o[(s & 0x0030) >> 4];
137 result.m_v.w = o[(s & 0x0003)];
142PL_ALWAYS_INLINE
plSimdVec4i plSimdVec4i::operator-()
const
170 result.m_v.x = m_v.x | v.m_v.x;
171 result.m_v.y = m_v.y | v.m_v.y;
172 result.m_v.z = m_v.z | v.m_v.z;
173 result.m_v.w = m_v.w | v.m_v.w;
181 result.m_v.x = m_v.x & v.m_v.x;
182 result.m_v.y = m_v.y & v.m_v.y;
183 result.m_v.z = m_v.z & v.m_v.z;
184 result.m_v.w = m_v.w & v.m_v.w;
192 result.m_v.x = m_v.x ^ v.m_v.x;
193 result.m_v.y = m_v.y ^ v.m_v.y;
194 result.m_v.z = m_v.z ^ v.m_v.z;
195 result.m_v.w = m_v.w ^ v.m_v.w;
200PL_ALWAYS_INLINE
plSimdVec4i plSimdVec4i::operator~()
const
203 result.m_v.x = ~m_v.x;
204 result.m_v.y = ~m_v.y;
205 result.m_v.z = ~m_v.z;
206 result.m_v.w = ~m_v.w;
211PL_ALWAYS_INLINE
plSimdVec4i plSimdVec4i::operator<<(plUInt32 uiShift)
const
214 result.m_v.x = m_v.x << uiShift;
215 result.m_v.y = m_v.y << uiShift;
216 result.m_v.z = m_v.z << uiShift;
217 result.m_v.w = m_v.w << uiShift;
222PL_ALWAYS_INLINE
plSimdVec4i plSimdVec4i::operator>>(plUInt32 uiShift)
const
225 result.m_v.x = m_v.x >> uiShift;
226 result.m_v.y = m_v.y >> uiShift;
227 result.m_v.z = m_v.z >> uiShift;
228 result.m_v.w = m_v.w >> uiShift;
236 result.m_v.x = m_v.x << v.m_v.x;
237 result.m_v.y = m_v.y << v.m_v.y;
238 result.m_v.z = m_v.z << v.m_v.z;
239 result.m_v.w = m_v.w << v.m_v.w;
247 result.m_v.x = m_v.x >> v.m_v.x;
248 result.m_v.y = m_v.y >> v.m_v.y;
249 result.m_v.z = m_v.z >> v.m_v.z;
250 result.m_v.w = m_v.w >> v.m_v.w;
294PL_ALWAYS_INLINE
plSimdVec4i& plSimdVec4i::operator<<=(plUInt32 uiShift)
303PL_ALWAYS_INLINE
plSimdVec4i& plSimdVec4i::operator>>=(plUInt32 uiShift)
322PL_ALWAYS_INLINE
plSimdVec4i plSimdVec4i::Abs()
const
336 result[0] = m_v.x == v.m_v.x;
337 result[1] = m_v.y == v.m_v.y;
338 result[2] = m_v.z == v.m_v.z;
339 result[3] = m_v.w == v.m_v.w;
341 return plSimdVec4b(result[0], result[1], result[2], result[3]);
346 return !(*
this == v);
357 result[0] = m_v.x < v.m_v.x;
358 result[1] = m_v.y < v.m_v.y;
359 result[2] = m_v.z < v.m_v.z;
360 result[3] = m_v.w < v.m_v.w;
362 return plSimdVec4b(result[0], result[1], result[2], result[3]);
373 result[0] = m_v.x > v.m_v.x;
374 result[1] = m_v.y > v.m_v.y;
375 result[2] = m_v.z > v.m_v.z;
376 result[3] = m_v.w > v.m_v.w;
378 return plSimdVec4b(result[0], result[1], result[2], result[3]);
385 result.m_v.x = cmp.m_v.x ? ifTrue.m_v.x : ifFalse.m_v.x;
386 result.m_v.y = cmp.m_v.y ? ifTrue.m_v.y : ifFalse.m_v.y;
387 result.m_v.z = cmp.m_v.z ? ifTrue.m_v.z : ifFalse.m_v.z;
388 result.m_v.w = cmp.m_v.w ? ifTrue.m_v.w : ifFalse.m_v.w;
A 4-component SIMD vector class.
Definition SimdVec4f.h:8
A SIMD 4-component vector class of signed 32b integers.
Definition SimdVec4i.h:9
plSimdVec4i GetCombined(const plSimdVec4i &other) const
x = this[s0], y = this[s1], z = other[s2], w = other[s3]
static plSimdVec4i MakeZero()
Creates an plSimdVec4i that is initialized to zero.
Definition FPUVec4i_inl.h:25
const plVec4Template< Type > CompMin(const plVec4Template< Type > &rhs) const
Returns the component-wise minimum of *this and rhs.
Definition Vec4_inl.h:327
const plVec4Template< Type > CompDiv(const plVec4Template< Type > &rhs) const
Returns the component-wise division of *this and rhs.
Definition Vec4_inl.h:366
void SetZero()
Sets the vector to all zero.
Definition Vec4_inl.h:139
void Set(Type xyzw)
Sets all 4 components to this value.
Definition Vec4_inl.h:121
const plVec4Template< Type > CompMul(const plVec4Template< Type > &rhs) const
Returns the component-wise multiplication of *this and rhs.
Definition Vec4_inl.h:355
const plVec4Template< Type > CompMax(const plVec4Template< Type > &rhs) const
Returns the component-wise maximum of *this and rhs.
Definition Vec4_inl.h:336
constexpr PL_ALWAYS_INLINE T Abs(T f)
Returns the absolute value of f.
Definition Math_inl.h:21