21 static_assert(
false,
"AVX2 is not supported yet.");
24#elif defined(__ARM_NEON__) || defined(__ARM_NEON)
27 static_assert(
false,
"No SIMD Intrinsics found which are necessary for compilation");
31 #include <immintrin.h>
36#if !defined(force_inline)
38#define force_inline __forceinline
39 #define vector_call __vectorcall
41 #define force_inline inline __attribute__((always_inline))
58 static constexpr size_t kSize = 8;
59 typedef __m256i simd_type;
61 static constexpr size_t kSize = 4;
62 typedef __m128i simd_type;
64 static constexpr size_t kSize = 4;
65 typedef uint32x4_t simd_type;
86 static constexpr uint32_t
kFullMask = (
unsigned int)-1;
97 return _mm256_set1_epi32((int32_t)scalar);
99 return _mm_set1_epi32((int32_t)scalar);
101 return vdupq_n_u32(scalar);
112 return _mm256_loadu_si256((
const __m256i*)scalar);
114 return _mm_loadu_si128((
const __m128i*)memory);
116 return vld1q_u32(memory);
128 return _mm256_add_epi32(one, two);
130 return _mm_add_epi32(one, two);
132 return vaddq_u32(one, two);
144 return _mm256_sub_epi32(one, two);
146 return _mm_sub_epi32(one, two);
148 return vsubq_u32(one, two);
159 return _mm256_sub_epi32(_mm256_set1_epi32(0),
value);
161 return _mm_sub_epi32(_mm_set1_epi32(0),
value);
163 return vmulq_n_u32(
value, -1);
175 return _mm256_mul_epi32(one, two);
178 simd_type mul0_2 = _mm_mul_epu32(one, two);
179 simd_type mul1_3 = _mm_mul_epu32(
180 _mm_shuffle_epi32(one, _MM_SHUFFLE(2, 3, 0, 1)),
181 _mm_shuffle_epi32(two, _MM_SHUFFLE(2, 3, 0, 1)));
182 return _mm_unpacklo_epi32(
183 _mm_shuffle_epi32(mul0_2, _MM_SHUFFLE (0, 0, 2, 0)),
184 _mm_shuffle_epi32(mul1_3, _MM_SHUFFLE (0, 0, 2, 0)));
186 return vmulq_u32(one, two);
198 return _mm256_and_si256(
value, mask);
200 return _mm_and_si128(
value, mask);
202 return vandq_u32(
value, mask);
214 return _mm256_or_si256(
value, mask);
216 return _mm_or_si128(
value, mask);
218 return vorrq_u32(
value, mask);
230 return _mm256_xor_si256(
value, mask);
232 return _mm_xor_si128(
value, mask);
234 return veorq_u32(
value, mask);
255 return _mm256_max_epi32(one, two);
257 simd_type greater_than_mask =
greaterThan(one, two);
259 return _mm_or_si128(_mm_and_si128(greater_than_mask, one),
260 _mm_andnot_si128(greater_than_mask, two));
262 return vmaxq_u32(one, two);
274 return _mm256_min_epi32(one, two);
276 simd_type less_than_mask = _mm_cmpgt_epi32(two, one);
278 return _mm_or_si128(_mm_and_si128(less_than_mask, one),
279 _mm_andnot_si128(less_than_mask, two));
281 return vminq_u32(one, two);
293 return _mm256_cmpeq_epi32(one, two);
295 return _mm_cmpeq_epi32(one, two);
297 return vceqq_u32(one, two);
311 return _mm256_cmpgt_epi32(_mm256_xor_si256(one,
init(
kSignMask)),
317 return vcgtq_u32(one, two);
333 #error "AVX2 version not fully implemented in code snippet"
337 for (
int i = 0; i < kSize; ++i)
338 total += union_value.
scalar[i];
341 uint32x2_t partial_sum = vpadd_u32(vget_low_u32(
value), vget_high_u32(
value));
342 partial_sum = vpadd_u32(partial_sum, partial_sum);
343 return vget_lane_u32(partial_sum, 0);
354 return _mm256_movemask_epi8(
value);
356 return _mm_movemask_epi8(
value);
359 uint32x2_t max_vals = vpmax_u32(vget_low_u32(
value), vget_high_u32(
value));
360 max_vals = vpmax_u32(max_vals, max_vals);
361 return vget_lane_u32(max_vals, 0);
414 scalar_simd_union union_value { (int32_t)first, (int32_t)second, (int32_t)third, (int32_t)fourth };
424 :
poly_int(first, second, first, second) { }
438 simd_union union_value {
value };
439 return union_value.scalar[index];
442 return union_value.
scalar[index];
455 simd_union union_value {
value };
456 union_value.scalar[index] = new_value;
457 value = union_value.simd;
460 union_value.
scalar[index] = (int32_t)new_value;
461 value = union_value.simd;
463 value[index] = new_value;
602 static constexpr size_t kSize = 8;
603 typedef __m256 simd_type;
604 typedef __m256i mask_simd_type;
606 static constexpr size_t kSize = 4;
607 typedef __m128 simd_type;
608 typedef __m128i mask_simd_type;
610 static constexpr size_t kSize = 4;
611 typedef float32x4_t simd_type;
612 typedef uint32x4_t mask_simd_type;
640 return _mm256_castps_si256(
value);
642 return _mm_castps_si128(
value);
644 return vreinterpretq_u32_f32(
value);
655 return _mm256_castsi256_ps(mask);
657 return _mm_castsi128_ps(mask);
659 return vreinterpretq_f32_u32(mask);
670 return _mm256_broadcast_ss(&scalar);
672 return _mm_set1_ps(scalar);
674 return vdupq_n_f32(scalar);
685 return _mm256_loadu_ps(&scalar);
687 return _mm_loadu_ps(memory);
689 return vld1q_f32(memory);
701 return _mm256_add_ps(one, two);
703 return _mm_add_ps(one, two);
705 return vaddq_f32(one, two);
717 return _mm256_sub_ps(one, two);
719 return _mm_sub_ps(one, two);
721 return vsubq_f32(one, two);
732 return _mm256_xor_ps(
value, _mm256_set1_ps(-0.f));
734 return _mm_xor_ps(
value, _mm_set1_ps(-0.f));
736 return vmulq_n_f32(
value, -1.0f);
748 return _mm256_mul_ps(one, two);
750 return _mm_mul_ps(one, two);
752 return vmulq_f32(one, two);
764 return _mm256_mul_ps(
value, _mm_set1_ps(scalar));
766 return _mm_mul_ps(
value, _mm_set1_ps(scalar));
768 return vmulq_n_f32(
value, scalar);
781 return _mm256_fmadd_ps(two, three, one);
783 return _mm_add_ps(one, _mm_mul_ps(two, three));
785#if defined(NEON_VFP_V3)
786 return vaddq_f32(one, vmulq_f32(two, three));
788 return vmlaq_f32(one, two, three);
805 #error "AVX2 mulSub is not implemented in this snippet"
807 return _mm_sub_ps(one, _mm_mul_ps(two, three));
809#if defined(NEON_VFP_V3)
810 return vsubq_f32(one, vmulq_f32(two, three));
812 return vmlsq_f32(one, two, three);
825 return _mm256_div_ps(one, two);
827 return _mm_div_ps(one, two);
829#if defined(NEON_ARM32)
831 simd_type reciprocal = vrecpeq_f32(two);
832 reciprocal = vmulq_f32(vrecpsq_f32(two, reciprocal), reciprocal);
833 reciprocal = vmulq_f32(vrecpsq_f32(two, reciprocal), reciprocal);
834 return vmulq_f32(one, reciprocal);
836 return vdivq_f32(one, two);
906 return _mm256_max_ps(one, two);
908 return _mm_max_ps(one, two);
910 return vmaxq_f32(one, two);
922 return _mm256_min_ps(one, two);
924 return _mm_min_ps(one, two);
926 return vminq_f32(one, two);
957 return toMask(_mm256_cmp_ps(one, two, _CMP_EQ_OQ));
959 return toMask(_mm_cmpeq_ps(one, two));
961 return vceqq_f32(one, two);
973 return toMask(_mm256_cmp_ps(one, two, _CMP_GT_OQ));
975 return toMask(_mm_cmpgt_ps(one, two));
977 return vcgtq_f32(one, two);
989 return toMask(_mm256_cmp_ps(one, two, _CMP_GE_OQ));
991 return toMask(_mm_cmpge_ps(one, two));
993 return vcgeq_f32(one, two);
1005 return toMask(_mm256_cmp_ps(one, two, _CMP_NEQ_OQ));
1007 return toMask(_mm_cmpneq_ps(one, two));
1027 #error "AVX2 version not fully implemented in code snippet"
1029 simd_type flip = _mm_shuffle_ps(
value,
value, _MM_SHUFFLE(1, 0, 3, 2));
1030 simd_type sum_vec = _mm_add_ps(
value, flip);
1031 simd_type swap = _mm_shuffle_ps(sum_vec, sum_vec, _MM_SHUFFLE(2, 3, 0, 1));
1032 return _mm_cvtss_f32(_mm_add_ps(sum_vec, swap));
1034 float32x2_t partial_sum = vpadd_f32(vget_low_f32(
value), vget_high_f32(
value));
1035 partial_sum = vpadd_f32(partial_sum, partial_sum);
1036 return vget_lane_f32(partial_sum, 0);
1049 simd_type& row2, simd_type& row3) {
1051 static_assert(
false,
"AVX2 transpose not supported yet");
1053 __m128 low0 = _mm_unpacklo_ps(row0, row1);
1054 __m128 low1 = _mm_unpacklo_ps(row2, row3);
1055 __m128 high0 = _mm_unpackhi_ps(row0, row1);
1056 __m128 high1 = _mm_unpackhi_ps(row2, row3);
1057 row0 = _mm_movelh_ps(low0, low1);
1058 row1 = _mm_movehl_ps(low1, low0);
1059 row2 = _mm_movelh_ps(high0, high1);
1060 row3 = _mm_movehl_ps(high1, high0);
1062 float32x4x2_t swap_low = vtrnq_f32(row0, row1);
1063 float32x4x2_t swap_high = vtrnq_f32(row2, row3);
1065 row0 = vextq_f32(vextq_f32(swap_low.val[0], swap_low.val[0], 2), swap_high.val[0], 2);
1066 row1 = vextq_f32(vextq_f32(swap_low.val[1], swap_low.val[1], 2), swap_high.val[1], 2);
1067 row2 = vextq_f32(swap_low.val[0], vextq_f32(swap_high.val[0], swap_high.val[0], 2), 2);
1068 row3 = vextq_f32(swap_low.val[1], vextq_f32(swap_high.val[1], swap_high.val[1], 2), 2);
1139 scalar_simd_union union_value { initial_value1, initial_value2, initial_value1, initial_value2 };
1167 simd_union union_value {
value };
1168 return union_value.scalar[index];
1171 return union_value.
scalar[index];
1173 return value[index];
1184 simd_union union_value {
value };
1185 union_value.scalar[index] = new_value;
1186 value = union_value.simd;
1189 union_value.
scalar[index] = new_value;
1190 value = union_value.simd;
1192 value[index] = new_value;
#define vector_call
Definition common.h:24
#define force_inline
Definition common.h:23
Contains classes and functions used within the Vital synthesizer framework.
poly_int poly_mask
Alias for clarity; used as a mask type in poly_float.
Definition poly_values.h:590
Represents a vector of floating-point values using SIMD instructions.
Definition poly_values.h:600
static force_inline poly_mask vector_call equal(poly_float one, poly_float two)
Definition poly_values.h:1093
static force_inline simd_type vector_call bitXor(simd_type value, mask_simd_type mask)
Bitwise XOR of a float SIMD register with a mask.
Definition poly_values.h:879
force_inline poly_float &vector_call operator^=(poly_mask other) noexcept
Definition poly_values.h:1230
force_inline float vector_call operator[](size_t index) const noexcept
Operator[] overload (read-only).
Definition poly_values.h:1201
force_inline poly_float &vector_call operator/=(float scalar) noexcept
Definition poly_values.h:1278
static force_inline void vector_call transpose(simd_type &row0, simd_type &row1, simd_type &row2, simd_type &row3)
Performs an in-place 4x4 transpose of four SSE/NEON registers containing float data.
Definition poly_values.h:1048
static force_inline mask_simd_type vector_call greaterThanOrEqual(simd_type one, simd_type two)
Compares two SIMD float registers, element-wise, for greater than or equal.
Definition poly_values.h:987
static force_inline poly_float vector_call min(poly_float one, poly_float two)
Definition poly_values.h:1084
force_inline poly_float &vector_call operator/=(simd_type other) noexcept
Definition poly_values.h:1248
static force_inline mask_simd_type vector_call toMask(simd_type value)
Interprets the bits of a float SIMD register as a mask (integer).
Definition poly_values.h:638
force_inline poly_float &vector_call operator|=(mask_simd_type other) noexcept
Definition poly_values.h:1256
static force_inline simd_type vector_call mulSub(simd_type one, simd_type two, simd_type three)
Fused multiply-sub operation: one = one - (two * three).
Definition poly_values.h:800
static force_inline poly_mask vector_call greaterThan(poly_float one, poly_float two)
Definition poly_values.h:1099
force_inline poly_float &vector_call operator&=(poly_mask other) noexcept
Definition poly_values.h:1222
static force_inline simd_type vector_call mul(simd_type one, simd_type two)
Multiplies two SIMD float registers element-wise.
Definition poly_values.h:746
force_inline poly_float &vector_call operator-=(poly_float other) noexcept
Definition poly_values.h:1210
static force_inline simd_type vector_call sub(simd_type one, simd_type two)
Subtracts one SIMD float register from another.
Definition poly_values.h:715
force_inline ~poly_float() noexcept
Destructor.
Definition poly_values.h:1158
static force_inline simd_type vector_call toSimd(mask_simd_type mask)
Interprets the bits of a mask SIMD register as float SIMD.
Definition poly_values.h:653
static force_inline poly_float vector_call mulAdd(poly_float one, poly_float two, poly_float three)
Convenience overloads returning poly_float instead of simd_type:
Definition poly_values.h:1075
force_inline poly_float &vector_call operator+=(poly_float other) noexcept
Compound assignment operators using poly_float.
Definition poly_values.h:1206
static force_inline mask_simd_type vector_call equal(simd_type one, simd_type two)
Compares two SIMD float registers for equality, element-wise.
Definition poly_values.h:954
force_inline poly_float &vector_call operator+=(float scalar) noexcept
Compound assignment operators using a scalar.
Definition poly_values.h:1266
static force_inline poly_mask vector_call notEqual(poly_float one, poly_float two)
Definition poly_values.h:1096
static force_inline poly_mask vector_call lessThan(poly_float one, poly_float two)
Definition poly_values.h:1105
force_inline poly_float &vector_call operator*=(simd_type other) noexcept
Definition poly_values.h:1244
force_inline poly_float &vector_call operator+=(simd_type other) noexcept
Compound assignment operators using simd_type.
Definition poly_values.h:1236
force_inline poly_float(simd_type initial_value) noexcept
Constructs from a raw SIMD register.
Definition poly_values.h:1123
static force_inline simd_type vector_call mulScalar(simd_type value, float scalar)
Multiplies a SIMD float register by a float scalar.
Definition poly_values.h:762
simd_type value
The underlying SIMD register for float.
Definition poly_values.h:1112
static force_inline mask_simd_type vector_call sign_mask(simd_type value)
Extracts the sign bit mask from each element in the SIMD float register.
Definition poly_values.h:944
force_inline poly_float vector_call operator+(poly_float other) const noexcept
Arithmetic operators.
Definition poly_values.h:1284
force_inline poly_float &vector_call operator|=(poly_mask other) noexcept
Definition poly_values.h:1226
static force_inline simd_type vector_call div(simd_type one, simd_type two)
Divides one SIMD float register by another, element-wise.
Definition poly_values.h:823
static force_inline simd_type vector_call min(simd_type one, simd_type two)
Returns the element-wise minimum of two SIMD float registers.
Definition poly_values.h:920
force_inline poly_float &vector_call operator^=(mask_simd_type other) noexcept
Definition poly_values.h:1260
force_inline poly_float &vector_call operator-=(simd_type other) noexcept
Definition poly_values.h:1240
force_inline poly_float &vector_call operator-=(float scalar) noexcept
Definition poly_values.h:1270
force_inline poly_float vector_call operator~() const noexcept
Definition poly_values.h:1313
static force_inline simd_type vector_call init(float scalar)
Initializes a SIMD register with the same float repeated.
Definition poly_values.h:668
force_inline poly_float vector_call operator-(poly_float other) const noexcept
Definition poly_values.h:1287
force_inline poly_float vector_call operator&(poly_mask other) const noexcept
Definition poly_values.h:1299
static force_inline poly_float vector_call max(poly_float one, poly_float two)
Definition poly_values.h:1081
static force_inline simd_type vector_call add(simd_type one, simd_type two)
Adds two SIMD float registers.
Definition poly_values.h:699
force_inline poly_float vector_call operator|(poly_mask other) const noexcept
Definition poly_values.h:1302
force_inline poly_float vector_call operator*(float scalar) const noexcept
Definition poly_values.h:1296
force_inline poly_float &vector_call operator*=(float scalar) noexcept
Definition poly_values.h:1274
static force_inline poly_mask vector_call sign_mask(poly_float value)
Definition poly_values.h:1090
force_inline poly_float() noexcept
Default constructor. Initializes to zero (0.0f).
Definition poly_values.h:1117
force_inline poly_float &vector_call operator&=(mask_simd_type other) noexcept
Definition poly_values.h:1252
force_inline poly_float &vector_call operator*=(poly_float other) noexcept
Definition poly_values.h:1214
force_inline poly_float(float initial_value) noexcept
Constructs the SIMD register by broadcasting a single float value.
Definition poly_values.h:1129
static force_inline poly_float vector_call abs(poly_float value)
Definition poly_values.h:1087
static force_inline simd_type vector_call max(simd_type one, simd_type two)
Returns the element-wise maximum of two SIMD float registers.
Definition poly_values.h:904
static force_inline float vector_call sum(simd_type value)
Computes the sum of all elements in a SIMD float register.
Definition poly_values.h:1020
static force_inline simd_type vector_call abs(simd_type value)
Computes the absolute value of each element in the SIMD float register.
Definition poly_values.h:935
force_inline poly_float vector_call operator-() const noexcept
Unary operators.
Definition poly_values.h:1310
force_inline float vector_call sum() const noexcept
Sums all elements in the SIMD float register.
Definition poly_values.h:1321
static force_inline poly_mask vector_call lessThanOrEqual(poly_float one, poly_float two)
Definition poly_values.h:1108
force_inline poly_float vector_call operator/(poly_float other) const noexcept
Definition poly_values.h:1293
force_inline float vector_call access(size_t index) const noexcept
Accessor for an element in the SIMD register.
Definition poly_values.h:1165
static force_inline mask_simd_type vector_call notEqual(simd_type one, simd_type two)
Compares two SIMD float registers for non-equality, element-wise.
Definition poly_values.h:1003
static force_inline simd_type vector_call bitOr(simd_type value, mask_simd_type mask)
Bitwise OR of a float SIMD register with a mask.
Definition poly_values.h:863
static force_inline simd_type vector_call mulAdd(simd_type one, simd_type two, simd_type three)
Fused multiply-add operation: one = one + (two * three).
Definition poly_values.h:779
force_inline poly_float vector_call operator*(poly_float other) const noexcept
Definition poly_values.h:1290
static force_inline simd_type vector_call load(const float *memory)
Loads floating-point values from memory into a SIMD register.
Definition poly_values.h:683
force_inline poly_float(float initial_value1, float initial_value2) noexcept
Constructs a SIMD register by repeating two float values (for SSE2/NEON).
Definition poly_values.h:1138
force_inline void vector_call set(size_t index, float new_value) noexcept
Sets a specific element in the SIMD register.
Definition poly_values.h:1182
force_inline poly_float(float first, float second, float third, float fourth) noexcept
Constructs a SIMD register with four specified floats (for SSE2/NEON).
Definition poly_values.h:1150
static force_inline poly_float vector_call mulSub(poly_float one, poly_float two, poly_float three)
Definition poly_values.h:1078
force_inline poly_float &vector_call operator/=(poly_float other) noexcept
Definition poly_values.h:1218
static force_inline simd_type vector_call bitAnd(simd_type value, mask_simd_type mask)
Bitwise AND of a float SIMD register with a mask.
Definition poly_values.h:847
static force_inline simd_type vector_call bitNot(simd_type value)
Bitwise NOT of a float SIMD register.
Definition poly_values.h:894
force_inline poly_float vector_call operator^(poly_mask other) const noexcept
Definition poly_values.h:1305
static force_inline simd_type vector_call neg(simd_type value)
Negates a SIMD float register.
Definition poly_values.h:730
static force_inline mask_simd_type vector_call greaterThan(simd_type one, simd_type two)
Compares two SIMD float registers, element-wise, for greater than.
Definition poly_values.h:971
static force_inline poly_mask vector_call greaterThanOrEqual(poly_float one, poly_float two)
Definition poly_values.h:1102
Represents a vector of integer values using SIMD instructions.
Definition poly_values.h:56
force_inline poly_int &vector_call operator&=(simd_type other) noexcept
Definition poly_values.h:515
force_inline poly_int &vector_call operator&=(poly_int other) noexcept
Definition poly_values.h:489
force_inline poly_int(uint32_t first, uint32_t second) noexcept
Constructs a 4-element SIMD register by repeating two values (for SSE2/NEON).
Definition poly_values.h:423
simd_type value
The underlying SIMD register.
Definition poly_values.h:385
static force_inline simd_type vector_call mul(simd_type one, simd_type two)
Multiplies two SIMD integer registers element-wise.
Definition poly_values.h:173
force_inline void vector_call set(size_t index, uint32_t new_value) noexcept
Sets a specific element in the SIMD register.
Definition poly_values.h:453
force_inline poly_int &vector_call operator-=(uint32_t scalar) noexcept
Definition poly_values.h:533
force_inline poly_int &vector_call operator*=(poly_int other) noexcept
Definition poly_values.h:485
static force_inline simd_type vector_call init(uint32_t scalar)
Initializes a SIMD register with the same integer repeated.
Definition poly_values.h:95
force_inline poly_int &vector_call operator|=(poly_int other) noexcept
Definition poly_values.h:493
force_inline poly_int &vector_call operator+=(poly_int other) noexcept
Compound assignment operators using poly_int.
Definition poly_values.h:477
static force_inline poly_int vector_call greaterThan(poly_int one, poly_int two)
Definition poly_values.h:375
force_inline poly_int &vector_call operator+=(uint32_t scalar) noexcept
Compound assignment operators using a scalar.
Definition poly_values.h:529
force_inline poly_int vector_call operator-(poly_int other) const noexcept
Definition poly_values.h:546
static force_inline simd_type vector_call max(simd_type one, simd_type two)
Returns the element-wise maximum of two SIMD integer registers.
Definition poly_values.h:253
force_inline poly_int vector_call operator+(poly_int other) const noexcept
Arithmetic operators.
Definition poly_values.h:543
static force_inline uint32_t vector_call anyMask(simd_type value)
Returns a bitmask that indicates which bytes/elements in the register are non-zero.
Definition poly_values.h:352
force_inline poly_int vector_call operator|(poly_int other) const noexcept
Definition poly_values.h:557
static force_inline uint32_t vector_call sum(simd_type value)
Computes the sum of all elements in a SIMD integer register.
Definition poly_values.h:326
force_inline uint32_t vector_call operator[](size_t index) const noexcept
Operator[] overload (read-only).
Definition poly_values.h:472
force_inline poly_int(simd_type initial_value) noexcept
Constructs from a raw SIMD register.
Definition poly_values.h:396
force_inline uint32_t vector_call access(size_t index) const noexcept
Accessor for an element in the SIMD register.
Definition poly_values.h:436
static force_inline simd_type vector_call add(simd_type one, simd_type two)
Adds two SIMD integer registers.
Definition poly_values.h:126
static force_inline simd_type vector_call load(const uint32_t *memory)
Loads integer values from memory into a SIMD register.
Definition poly_values.h:110
force_inline poly_int vector_call operator^(poly_int other) const noexcept
Definition poly_values.h:560
static force_inline simd_type vector_call bitNot(simd_type value)
Bitwise NOT of a SIMD integer register.
Definition poly_values.h:243
force_inline poly_int &vector_call operator*=(uint32_t scalar) noexcept
Definition poly_values.h:537
force_inline poly_int &vector_call operator+=(simd_type other) noexcept
Compound assignment operators using simd_type.
Definition poly_values.h:503
force_inline poly_int &vector_call operator*=(simd_type other) noexcept
Definition poly_values.h:511
force_inline poly_int() noexcept
Default constructor. Initializes to zero.
Definition poly_values.h:390
force_inline poly_int &vector_call operator|=(simd_type other) noexcept
Definition poly_values.h:519
static force_inline poly_int vector_call min(poly_int one, poly_int two)
Definition poly_values.h:369
static force_inline simd_type vector_call neg(simd_type value)
Negates a SIMD integer register.
Definition poly_values.h:157
force_inline poly_int(uint32_t first, uint32_t second, uint32_t third, uint32_t fourth) noexcept
Constructs the SIMD register with four specified integers.
Definition poly_values.h:413
force_inline poly_int &vector_call operator^=(simd_type other) noexcept
Definition poly_values.h:523
static constexpr uint32_t kSignMask
Sign bit mask.
Definition poly_values.h:87
static force_inline poly_int vector_call equal(poly_int one, poly_int two)
Definition poly_values.h:372
force_inline poly_int vector_call operator*(poly_int other) const noexcept
Definition poly_values.h:549
force_inline poly_int vector_call operator&(poly_int other) const noexcept
Bitwise operators.
Definition poly_values.h:554
static force_inline poly_int vector_call max(poly_int one, poly_int two)
Convenience overloads returning poly_int instead of simd_type:
Definition poly_values.h:366
static force_inline simd_type vector_call bitOr(simd_type value, simd_type mask)
Bitwise OR of a SIMD integer register with another.
Definition poly_values.h:212
static force_inline simd_type vector_call min(simd_type one, simd_type two)
Returns the element-wise minimum of two SIMD integer registers.
Definition poly_values.h:272
force_inline uint32_t vector_call anyMask() const noexcept
Returns a bitmask for elements that are non-zero.
Definition poly_values.h:584
static constexpr uint32_t kFullMask
All bits set.
Definition poly_values.h:86
static constexpr uint32_t kNotSignMask
Inverted sign bit mask.
Definition poly_values.h:88
force_inline uint32_t vector_call sum() const noexcept
Sums all elements in the SIMD register.
Definition poly_values.h:576
static force_inline simd_type vector_call greaterThan(simd_type one, simd_type two)
Compares two SIMD integer registers, element-wise, for greater than.
Definition poly_values.h:309
force_inline poly_int vector_call operator-() const noexcept
Unary operators.
Definition poly_values.h:565
static force_inline simd_type vector_call equal(simd_type one, simd_type two)
Compares two SIMD integer registers for equality, element-wise.
Definition poly_values.h:291
force_inline poly_int(uint32_t initial_value) noexcept
Constructs the SIMD register by broadcasting a single integer value.
Definition poly_values.h:402
force_inline poly_int &vector_call operator-=(simd_type other) noexcept
Definition poly_values.h:507
static force_inline simd_type vector_call sub(simd_type one, simd_type two)
Subtracts one SIMD integer register from another.
Definition poly_values.h:142
force_inline ~poly_int() noexcept
Destructor.
Definition poly_values.h:429
static force_inline poly_int vector_call lessThan(poly_int one, poly_int two)
Definition poly_values.h:378
force_inline poly_int &vector_call operator^=(poly_int other) noexcept
Definition poly_values.h:497
static force_inline simd_type vector_call bitAnd(simd_type value, simd_type mask)
Bitwise AND of a SIMD integer register with another.
Definition poly_values.h:196
force_inline poly_int &vector_call operator-=(poly_int other) noexcept
Definition poly_values.h:481
static force_inline simd_type vector_call bitXor(simd_type value, simd_type mask)
Bitwise XOR of a SIMD integer register with another.
Definition poly_values.h:228
force_inline poly_int vector_call operator~() const noexcept
Definition poly_values.h:568
static force_inline uint32_t vector_call sum(poly_int value)
Definition poly_values.h:381
Helper union for copying between a scalar array and a SIMD type.
Definition poly_values.h:628
simd_type simd
Access data in SIMD form.
Definition poly_values.h:630
float scalar[kSize]
Access data in scalar form.
Definition poly_values.h:629
Helper union for copying between a SIMD type and a scalar array.
Definition poly_values.h:619
simd_type simd
Access data in SIMD form.
Definition poly_values.h:620
float scalar[kSize]
Access data in scalar form.
Definition poly_values.h:621
Helper union for copying between a scalar array and a SIMD type.
Definition poly_values.h:72
simd_type simd
Access data in SIMD form.
Definition poly_values.h:74
int32_t scalar[kSize]
Access data in scalar form.
Definition poly_values.h:73
Helper union for copying between a SIMD type and a scalar array.
Definition poly_values.h:81
int32_t scalar[kSize]
Access data in scalar form.
Definition poly_values.h:83
simd_type simd
Access data in SIMD form.
Definition poly_values.h:82