Plasma Engine  2.0
Loading...
Searching...
No Matches
SimdVec4i.h
1#pragma once
2
3#include <Foundation/SimdMath/SimdVec4f.h>
4
5class plSimdVec4u;
6
8class PL_FOUNDATION_DLL plSimdVec4i
9{
10public:
11 PL_DECLARE_POD_TYPE();
12
13 plSimdVec4i(); // [tested]
14
15 explicit plSimdVec4i(plInt32 iXyzw); // [tested]
16
17 plSimdVec4i(plInt32 x, plInt32 y, plInt32 z, plInt32 w = 1); // [tested]
18
19 plSimdVec4i(plInternal::QuadInt v); // [tested]
20
22 [[nodiscard]] static plSimdVec4i MakeZero(); // [tested]
23
24 void Set(plInt32 iXyzw); // [tested]
25
26 void Set(plInt32 x, plInt32 y, plInt32 z, plInt32 w); // [tested]
27
28 void SetZero(); // [tested]
29
30 template <int N>
31 void Load(const plInt32* pInts); // [tested]
32
33 template <int N>
34 void Store(plInt32* pInts) const; // [tested]
35
36public:
37 explicit plSimdVec4i(const plSimdVec4u& u); // [tested]
38
39public:
40 plSimdVec4f ToFloat() const; // [tested]
41
42 [[nodiscard]] static plSimdVec4i Truncate(const plSimdVec4f& f); // [tested]
43
44public:
45 template <int N>
46 plInt32 GetComponent() const; // [tested]
47
48 plInt32 x() const; // [tested]
49 plInt32 y() const; // [tested]
50 plInt32 z() const; // [tested]
51 plInt32 w() const; // [tested]
52
53 template <plSwizzle::Enum s>
54 plSimdVec4i Get() const; // [tested]
55
57 template <plSwizzle::Enum s>
58 [[nodiscard]] plSimdVec4i GetCombined(const plSimdVec4i& other) const; // [tested]
59
60public:
61 [[nodiscard]] plSimdVec4i operator-() const; // [tested]
62 [[nodiscard]] plSimdVec4i operator+(const plSimdVec4i& v) const; // [tested]
63 [[nodiscard]] plSimdVec4i operator-(const plSimdVec4i& v) const; // [tested]
64
65 [[nodiscard]] plSimdVec4i CompMul(const plSimdVec4i& v) const; // [tested]
66 [[nodiscard]] plSimdVec4i CompDiv(const plSimdVec4i& v) const; // [tested]
67
68 [[nodiscard]] plSimdVec4i operator|(const plSimdVec4i& v) const; // [tested]
69 [[nodiscard]] plSimdVec4i operator&(const plSimdVec4i& v) const; // [tested]
70 [[nodiscard]] plSimdVec4i operator^(const plSimdVec4i& v) const; // [tested]
71 [[nodiscard]] plSimdVec4i operator~() const; // [tested]
72
73 [[nodiscard]] plSimdVec4i operator<<(plUInt32 uiShift) const; // [tested]
74 [[nodiscard]] plSimdVec4i operator>>(plUInt32 uiShift) const; // [tested]
75 [[nodiscard]] plSimdVec4i operator<<(const plSimdVec4i& v) const; // [tested]
76 [[nodiscard]] plSimdVec4i operator>>(const plSimdVec4i& v) const; // [tested]
77
78 plSimdVec4i& operator+=(const plSimdVec4i& v); // [tested]
79 plSimdVec4i& operator-=(const plSimdVec4i& v); // [tested]
80
81 plSimdVec4i& operator|=(const plSimdVec4i& v); // [tested]
82 plSimdVec4i& operator&=(const plSimdVec4i& v); // [tested]
83 plSimdVec4i& operator^=(const plSimdVec4i& v); // [tested]
84
85 plSimdVec4i& operator<<=(plUInt32 uiShift); // [tested]
86 plSimdVec4i& operator>>=(plUInt32 uiShift); // [tested]
87
88 [[nodiscard]] plSimdVec4i CompMin(const plSimdVec4i& v) const; // [tested]
89 [[nodiscard]] plSimdVec4i CompMax(const plSimdVec4i& v) const; // [tested]
90 [[nodiscard]] plSimdVec4i Abs() const; // [tested]
91
92 [[nodiscard]] plSimdVec4b operator==(const plSimdVec4i& v) const; // [tested]
93 [[nodiscard]] plSimdVec4b operator!=(const plSimdVec4i& v) const; // [tested]
94 [[nodiscard]] plSimdVec4b operator<=(const plSimdVec4i& v) const; // [tested]
95 [[nodiscard]] plSimdVec4b operator<(const plSimdVec4i& v) const; // [tested]
96 [[nodiscard]] plSimdVec4b operator>=(const plSimdVec4i& v) const; // [tested]
97 [[nodiscard]] plSimdVec4b operator>(const plSimdVec4i& v) const; // [tested]
98
99 [[nodiscard]] static plSimdVec4i Select(const plSimdVec4b& vCmp, const plSimdVec4i& vTrue, const plSimdVec4i& vFalse); // [tested]
100
101public:
103};
104
105#if PL_SIMD_IMPLEMENTATION == PL_SIMD_IMPLEMENTATION_SSE
106# include <Foundation/SimdMath/Implementation/SSE/SSEVec4i_inl.h>
107#elif PL_SIMD_IMPLEMENTATION == PL_SIMD_IMPLEMENTATION_FPU
108# include <Foundation/SimdMath/Implementation/FPU/FPUVec4i_inl.h>
109#elif PL_SIMD_IMPLEMENTATION == PL_SIMD_IMPLEMENTATION_NEON
110# include <Foundation/SimdMath/Implementation/NEON/NEONVec4i_inl.h>
111#else
112# error "Unknown SIMD implementation."
113#endif
Definition SimdVec4b.h:7
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]
A SIMD 4-component vector class of unsigned 32b integers.
Definition SimdVec4u.h:7