SuperDex Physics C++ API
Loading...
Searching...
No Matches
arm_simd_int_4_inl.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#pragma once
18
19#include "arm_simd_inl.h" // for IntelliSense
20
21#if MOCHI_USE_SIMD && MOCHI_ARCH_ARM_NEON
22
23namespace superdex {
24
25/***********************************************************************************************
26 Simd<int, 4>
27*/
28template <>
29class Simd<int, 4> {
30 public:
31 MOCHI_NATIVE_SIMD_IMPL_BOILERPLATE(int, 4, int32x4_t);
32
33 MOCHI_FORCE_INLINE Simd(int a, int b, int c = 0, int d = 0) : raw{a, b, c, d} {}
34 template <class U, MOCHI_REQUIRES_NON_BOOL_SCALAR(U, Scalar)>
35 MOCHI_FORCE_INLINE Simd(U a) : raw{vdupq_n_s32(a)} {}
36
37 template <int i>
38 [[nodiscard]] MOCHI_FORCE_INLINE static Scalar Get(Simd v) {
39 static_assert(i >= 0 && i < 4, "Index out of range");
40 return vgetq_lane_s32(v.raw, i);
41 }
42
43 [[nodiscard]] MOCHI_FORCE_INLINE Scalar operator[](int i) const {
44 MOCHI_ASSERT_VERBOSE(i >= 0 && i < kSize, "Index out of range");
45 return raw[i];
46 }
47
48 [[nodiscard]] MOCHI_FORCE_INLINE static Simd Set(Simd v, int i, Scalar value) {
49 MOCHI_ASSERT_VERBOSE(i >= 0 && i < kSize, "Index out of range");
50 auto result = v;
51 result.raw[i] = value;
52 return result;
53 }
54
55 template <int i>
56 [[nodiscard]] MOCHI_FORCE_INLINE static Simd Set(Simd v, Scalar value) {
57 static_assert(i >= 0 && i < kSize, "Index out of range");
58 return Set(v, i, value);
59 }
60
61 // Set via 2 int64_t instead of 4 int
62 [[nodiscard]] MOCHI_FORCE_INLINE static Simd SetInt64(int64_t a, int64_t b) {
63 return vreinterpretq_s32_s64(int64x2_t{a, b});
64 }
65
66 template <int N>
67 [[nodiscard]] MOCHI_FORCE_INLINE static bool AllTrue(Simd v) {
68 static_assert(N >= 1 && N <= 4, "Invalid number of components");
69 uint64_t mask =
70 vget_lane_u64(vreinterpret_u64_u16(vqmovn_u32(vreinterpretq_u32_s32(v.raw))), 0);
71 if constexpr (N == kSize) {
72 return mask == 0xFFFFFFFFFFFFFFFFULL;
73 } else {
74 int constexpr kNumBits = N * 16; // 64-bit mask has 16 bits per lane
75 auto constexpr kMustBeSet = (uint64_t(1) << kNumBits) - 1;
76 return (mask & kMustBeSet) == kMustBeSet;
77 }
78 }
79
80 template <int N>
81 [[nodiscard]] MOCHI_FORCE_INLINE static bool AnyTrue(Simd v) {
82 static_assert(N >= 1 && N <= 4, "Invalid number of components");
83 uint64_t mask =
84 vget_lane_u64(vreinterpret_u64_u16(vqmovn_u32(vreinterpretq_u32_s32(v.raw))), 0);
85 if constexpr (N == kSize) {
86 return mask != 0;
87 } else {
88 int constexpr kNumBits = N * 16; // 64-bit mask has 16 bits per lane
89 auto constexpr kMayBeSet = (uint64_t(1) << kNumBits) - 1;
90 return (mask & kMayBeSet) != 0;
91 }
92 }
93
94 [[nodiscard]] MOCHI_FORCE_INLINE static Simd Broadcast(int const* p) {
95 return Simd{*p};
96 }
97
98 template <int i>
99 [[nodiscard]] MOCHI_FORCE_INLINE static Simd Broadcast(Simd v) {
100 static_assert(i >= 0 && i < kSize, "Index out of range");
101 return vdupq_laneq_s32(v.raw, i);
102 }
103
104 template <int N = 4>
105 [[nodiscard]] MOCHI_FORCE_INLINE static Scalar HMin(Simd a) {
106 static_assert(N >= 2 && N <= 4, "Unsupported N");
107 if constexpr (N == 2) {
108 return superdex::Min(a.raw[0], a.raw[1]);
109 } else if constexpr (N == 3) {
110 // HMin({x, y, z, max()})
111 return vminvq_s32(vsetq_lane_s32(std::numeric_limits<Scalar>::max(), a.raw, 3));
112 } else {
113 return vminvq_s32(a.raw);
114 }
115 }
116
117 template <int N = 4>
118 [[nodiscard]] MOCHI_FORCE_INLINE static Scalar HMax(Simd a) {
119 static_assert(N >= 2 && N <= 4, "Unsupported N");
120 if constexpr (N == 2) {
121 return superdex::Max(a.raw[0], a.raw[1]);
122 } else if constexpr (N == 3) {
123 // HMax({x, y, z, lowest()})
124 return vmaxvq_s32(vsetq_lane_s32(std::numeric_limits<Scalar>::lowest(), a.raw, 3));
125 } else {
126 return vmaxvq_s32(a.raw);
127 }
128 }
129
130 template <int N>
131 [[nodiscard]] MOCHI_FORCE_INLINE static Scalar HSum(Simd a) {
132 static_assert(N >= 2 && N <= 4, "Unsupported N");
133 if constexpr (N == 2) {
134 return a.raw[0] + a.raw[1];
135 } else if constexpr (N == 3) {
136 return a.raw[0] + a.raw[1] + a.raw[2];
137 } else if constexpr (N == 4) {
138 return vaddvq_s32(a.raw);
139 }
140 }
141
142 [[nodiscard]] MOCHI_FORCE_INLINE static Simd HSumEach(Simd a, Simd b, Simd c, Simd d) {
143 return vpaddq_s32(vpaddq_s32(a.raw, b.raw), vpaddq_s32(c.raw, d.raw));
144 }
145
146 template <int N = kSize>
147 [[nodiscard]] MOCHI_FORCE_INLINE static Simd Load([[maybe_unused]] int const* ptr) {
148 static_assert(N >= 0 && N <= 4);
149 if constexpr (N == 0) {
150 return Simd::Zero();
151 } else if constexpr (N == 1) {
152 return Simd{ptr[0], 0, 0, 0};
153 } else if constexpr (N == 2) {
154 return Simd{ptr[0], ptr[1], 0, 0};
155 } else if constexpr (N == 3) {
156 return Simd{ptr[0], ptr[1], ptr[2], 0};
157 } else {
158 return vld1q_s32(ptr);
159 }
160 }
161
162 [[nodiscard]] MOCHI_FORCE_INLINE static Simd Load(Scalar const* ptr, int n) {
163 MOCHI_ASSERT_VERBOSE(n >= 0 && n <= kSize, "Invalid size parameter");
164 // clang-format off
165 switch (n) {
166 case 1: return Load<1>(ptr);
167 case 2: return Load<2>(ptr);
168 case 3: return Load<3>(ptr);
169 case 4: return Load<4>(ptr);
170 MOCHI_UNLIKELY default: return Zero();
171 } // clang-format on
172 }
173
174 template <int kTupleCount = kSize>
175 MOCHI_FORCE_INLINE static void
176 LoadTransposed(int const* ptr, Simd& out0, Simd& out1, Simd& out2) {
177 static_assert(kTupleCount >= 1 && kTupleCount <= kSize, "Invalid kTupleCount");
178 if constexpr (kTupleCount == 1) {
179 out0.raw = int32x4_t{ptr[0], 0, 0, 0};
180 out1.raw = int32x4_t{ptr[1], 0, 0, 0};
181 out2.raw = int32x4_t{ptr[2], 0, 0, 0};
182 } else if constexpr (kTupleCount == 2) {
183 out0.raw = int32x4_t{ptr[0], ptr[3], 0, 0};
184 out1.raw = int32x4_t{ptr[1], ptr[4], 0, 0};
185 out2.raw = int32x4_t{ptr[2], ptr[5], 0, 0};
186 } else if constexpr (kTupleCount == 3) {
187 out0.raw = int32x4_t{ptr[0], ptr[3], ptr[6], 0};
188 out1.raw = int32x4_t{ptr[1], ptr[4], ptr[7], 0};
189 out2.raw = int32x4_t{ptr[2], ptr[5], ptr[8], 0};
190 } else { // kTupleCount == 4 (kSize)
191 int32x4x3_t result = vld3q_s32(ptr);
192 out0.raw = result.val[0];
193 out1.raw = result.val[1];
194 out2.raw = result.val[2];
195 }
196 }
197
198 // Branchless: each lane loads one tuple from a selected address, inactive lanes from zeros.
199 MOCHI_FORCE_INLINE static void
200 LoadTransposed(Scalar const* ptr, Simd& out0, Simd& out1, Simd& out2, int count) {
201 MOCHI_ASSERT_VERBOSE(count >= 0 && count <= kSize, "Invalid tuple count");
202 int const* const zero = arm_simd::kZeroTuple<int>;
203 int32x4x3_t r = vld3q_dup_s32(count > 0 ? ptr : zero);
204 r = vld3q_lane_s32(count > 1 ? ptr + 3 : zero, r, 1);
205 r = vld3q_lane_s32(count > 2 ? ptr + 6 : zero, r, 2);
206 r = vld3q_lane_s32(count > 3 ? ptr + 9 : zero, r, 3);
207 out0.raw = r.val[0];
208 out1.raw = r.val[1];
209 out2.raw = r.val[2];
210 }
211
212 [[nodiscard]] MOCHI_FORCE_INLINE static Simd Min(Simd a, Simd b) {
213 return vminq_s32(a.raw, b.raw);
214 }
215
216 [[nodiscard]] MOCHI_FORCE_INLINE static Simd Max(Simd a, Simd b) {
217 return vmaxq_s32(a.raw, b.raw);
218 }
219
220 [[nodiscard]] MOCHI_FORCE_INLINE static Simd Select(Simd mask, Simd a, Simd b) {
221 return vbslq_s32(vreinterpretq_u32_s32(mask.raw), a.raw, b.raw);
222 }
223
224 template <int x, int y, int z, int w>
225 [[nodiscard]] MOCHI_FORCE_INLINE static Simd Blend(Simd a, Simd b) {
226 static_assert(
227 x >= 0 && x <= 1 && y >= 0 && y <= 1 && z >= 0 && z <= 1 && w >= 0 && w <= 1,
228 "invalid blend index");
229 int constexpr kCount = x + y + z + w;
230 if constexpr (kCount == 0) {
231 return a;
232 } else if constexpr (kCount == 4) {
233 return b;
234 } else if constexpr (kCount == 1) {
235 // Replace one lane of a with the corresponding lane of b.
236 int constexpr kLane = x ? 0 : (y ? 1 : (z ? 2 : 3));
237 return vcopyq_laneq_s32(a.raw, kLane, b.raw, kLane);
238 } else if constexpr (kCount == 3) {
239 // Replace one lane of b with the corresponding lane of a.
240 int constexpr kLane = !x ? 0 : (!y ? 1 : (!z ? 2 : 3));
241 return vcopyq_laneq_s32(b.raw, kLane, a.raw, kLane);
242 } else if constexpr (x == 1 && y == 1) { // <1,1,0,0>: low half from b, high from a
243 return vcombine_s32(vget_low_s32(b.raw), vget_high_s32(a.raw));
244 } else if constexpr (z == 1 && w == 1) { // <0,0,1,1>: low half from a, high from b
245 return vcombine_s32(vget_low_s32(a.raw), vget_high_s32(b.raw));
246 } else {
247 // Remaining patterns: <1,0,1,0>, <0,1,0,1>, <1,0,0,1>, <0,1,1,0>.
248 // mask lane = -1 -> select from a; mask lane = 0 -> select from b.
249 Simd const mask{int32x4_t{x ? 0 : -1, y ? 0 : -1, z ? 0 : -1, w ? 0 : -1}};
250 return Select(mask, a, b);
251 }
252 }
253
254 // return Simd{v[x], v[y], v[z], v[w]}
255 template <int x = 0, int y = 1, int z = 2, int w = 3>
256 [[nodiscard]] MOCHI_FORCE_INLINE static Simd Shuffle(Simd v) {
257 static_assert(
258 x >= 0 && x < 4 && y >= 0 && y < 4 && z >= 0 && z < 4 && w >= 0 && w < 4, "Invalid index");
259 return Simd{v.raw[x], v.raw[y], v.raw[z], v.raw[w]};
260 }
261
262 template <int x = 0, int y = 1, int z = 2, int w = 3>
263 [[nodiscard]] MOCHI_FORCE_INLINE static Simd Shuffle(Simd a, Simd b) {
264 static_assert(
265 x >= 0 && x < 4 && y >= 0 && y < 4 && z >= 0 && z < 4 && w >= 0 && w < 4, "Invalid index");
266 return Simd{a.raw[x], a.raw[y], b.raw[z], b.raw[w]};
267 }
268
269 template <int N = kSize>
270 MOCHI_FORCE_INLINE static void Store([[maybe_unused]] int* ptr, [[maybe_unused]] Simd v) {
271 static_assert(N >= 0 && N <= kSize);
272 // Partial stores write the lanes straight from the register. A memcpy of the vector leaves the
273 // instructions and their order to the compiler.
274 if constexpr (N == 0) {
275 } else if constexpr (N == 1) {
276 vst1q_lane_s32(ptr, v.raw, 0);
277 } else if constexpr (N == 2) {
278 vst1_s32(ptr, vget_low_s32(v.raw));
279 } else if constexpr (N == 3) {
280 vst1_s32(ptr, vget_low_s32(v.raw));
281 vst1q_lane_s32(ptr + 2, v.raw, 2);
282 } else {
283 vst1q_s32(ptr, v.raw);
284 }
285 }
286
287 MOCHI_FORCE_INLINE static void Store(Scalar* ptr, Simd v, int n) {
288 MOCHI_ASSERT_VERBOSE(n >= 0 && n <= kSize, "Invalid size parameter");
289 // clang-format off
290 switch (n) {
291 case 1: Store<1>(ptr, v); break;
292 case 2: Store<2>(ptr, v); break;
293 case 3: Store<3>(ptr, v); break;
294 case 4: Store<4>(ptr, v); break;
295 MOCHI_UNLIKELY default: break;
296 } // clang-format on
297 }
298
299 MOCHI_FORCE_INLINE static int StoreSelected(int* ptr, Simd condition, Simd values) {
300 uint32x4_t shifted = vshrq_n_u32(vreinterpretq_u32_s32(condition.raw), 31);
301 uint32x4_t multipliers = {1, 2, 4, 8}; // Optimizer can pull this out of a loop when appropriate
302 uint32x4_t weighted = vmulq_u32(shifted, multipliers);
303 uint32_t count = vaddvq_u32(shifted);
304 uint32_t mask = vaddvq_u32(weighted);
305 uint8x16_t pattern = vld1q_u8(arm_simd::kStoreSelectedShuffleTableS4[mask]);
306 uint8x16_t packed = vqtbl1q_u8(vreinterpretq_u8_s32(values.raw), pattern);
307 vst1q_s32(ptr, vreinterpretq_s32_u8(packed));
308 return static_cast<int>(count);
309 }
310
311 template <int kTupleCount = kSize>
312 MOCHI_FORCE_INLINE static void StoreTransposed(int* ptr, Simd a, Simd b, Simd c) {
313 static_assert(kTupleCount >= 1 && kTupleCount <= kSize, "Invalid kTupleCount");
314 if constexpr (kTupleCount == 1) {
315 ptr[0] = a.raw[0];
316 ptr[1] = b.raw[0];
317 ptr[2] = c.raw[0];
318 } else if constexpr (kTupleCount == 2) {
319 Simd::Store(ptr, Simd{a[0], b[0], c[0], a[1]});
320 ptr[4] = b.raw[1];
321 ptr[5] = c.raw[1];
322 } else if constexpr (kTupleCount == 3) {
323 Simd::Store(ptr + 0, Simd{a[0], b[0], c[0], a[1]});
324 Simd::Store(ptr + 4, Simd{b[1], c[1], a[2], b[2]});
325 ptr[8] = c.raw[2];
326 } else {
327 vst3q_s32(ptr, int32x4x3_t({a.raw, b.raw, c.raw}));
328 }
329 }
330
331 // Inactive lanes write tuple 0, which lane 0 stores last.
332 MOCHI_FORCE_INLINE static void StoreTransposed(Scalar* ptr, Simd a, Simd b, Simd c, int count) {
333 MOCHI_ASSERT_VERBOSE(count >= 0 && count <= kSize, "Invalid tuple count");
334 if (count == 0) {
335 return;
336 }
337 int32x4x3_t const v = {a.raw, b.raw, c.raw};
338 vst3q_lane_s32(count > 3 ? ptr + 9 : ptr, v, 3);
339 vst3q_lane_s32(count > 2 ? ptr + 6 : ptr, v, 2);
340 vst3q_lane_s32(count > 1 ? ptr + 3 : ptr, v, 1);
341 vst3q_lane_s32(ptr, v, 0);
342 }
343
344 [[nodiscard]] MOCHI_FORCE_INLINE static Simd Zero() {
345 return vdupq_n_s32(0);
346 }
347
348 [[nodiscard]] MOCHI_FORCE_INLINE Simd operator<(Simd rhs) const {
349 return vreinterpretq_s32_u32(vcltq_s32(this->raw, rhs.raw));
350 }
351
352 [[nodiscard]] MOCHI_FORCE_INLINE Simd operator>(Simd rhs) const {
353 return vreinterpretq_s32_u32(vcgtq_s32(this->raw, rhs.raw));
354 }
355
356 [[nodiscard]] MOCHI_FORCE_INLINE Simd operator<=(Simd rhs) const {
357 return vreinterpretq_s32_u32(vcleq_s32(this->raw, rhs.raw));
358 }
359
360 [[nodiscard]] MOCHI_FORCE_INLINE Simd operator>=(Simd rhs) const {
361 return vreinterpretq_s32_u32(vcgeq_s32(this->raw, rhs.raw));
362 }
363
364 [[nodiscard]] MOCHI_FORCE_INLINE static Simd Equal(Simd a, Simd b) {
365 return vreinterpretq_s32_u32(vceqq_s32(a.raw, b.raw));
366 }
367
368 [[nodiscard]] MOCHI_FORCE_INLINE static Simd NotEqual(Simd a, Simd b) {
369 return ~Equal(a, b);
370 }
371
372 [[nodiscard]] MOCHI_FORCE_INLINE bool operator==(Simd rhs) const {
373 uint16x4_t t = vqmovn_u32(vceqq_s32(raw, rhs.raw));
374 return vget_lane_u64(vreinterpret_u64_u16(t), 0) == uint64_t(-1);
375 }
376
377 [[nodiscard]] MOCHI_FORCE_INLINE bool operator!=(Simd rhs) const {
378 return !(*this == rhs);
379 }
380
381 [[nodiscard]] MOCHI_FORCE_INLINE Simd operator~() const {
382 return vmvnq_s32(raw);
383 }
384
385 [[nodiscard]] MOCHI_FORCE_INLINE Simd operator-() const {
386 return vnegq_s32(raw);
387 }
388
389 [[nodiscard]] MOCHI_FORCE_INLINE Simd operator+(Simd rhs) const {
390 return vaddq_s32(raw, rhs.raw);
391 }
392
393 [[nodiscard]] MOCHI_FORCE_INLINE Simd operator-(Simd rhs) const {
394 return vsubq_s32(raw, rhs.raw);
395 }
396
397 [[nodiscard]] MOCHI_FORCE_INLINE Simd operator*(Simd rhs) const {
398 return vmulq_s32(raw, rhs.raw);
399 }
400
401 [[nodiscard]] MOCHI_FORCE_INLINE Simd operator/(Simd rhs) const {
402 return Simd{
403 // NEON does not implement integer division
404 raw[0] / rhs.raw[0],
405 raw[1] / rhs.raw[1],
406 raw[2] / rhs.raw[2],
407 raw[3] / rhs.raw[3]};
408 }
409
410 [[nodiscard]] MOCHI_FORCE_INLINE Simd operator&(Simd rhs) const {
411 return vandq_s32(raw, rhs.raw);
412 }
413
414 [[nodiscard]] MOCHI_FORCE_INLINE Simd operator|(Simd rhs) const {
415 return vorrq_s32(raw, rhs.raw);
416 }
417
418 [[nodiscard]] MOCHI_FORCE_INLINE Simd operator^(Simd rhs) const {
419 return veorq_s32(raw, rhs.raw);
420 }
421
422 [[nodiscard]] MOCHI_FORCE_INLINE Simd operator<<(int shift) const {
423 // NOTE: If shift were a constexpr, then vshlq_n_s32 would be better because the shift amount
424 // could be an immediate value. Fortunately, Clang appears to be smart enough to do the right
425 // thing.
426 auto vShift = Simd(shift);
427 return vshlq_s32(raw, vShift.raw);
428 }
429
430 template <int kShift>
431 [[nodiscard]] MOCHI_FORCE_INLINE static Simd ShiftRight(Simd a) {
432 static_assert(kShift >= 0 && kShift < 32, "Shift amount out-of-range");
433 return vshrq_n_s32(a.raw, kShift);
434 }
435};
436
437} // namespace superdex
438
439#endif // MOCHI_USE_SIMD && MOCHI_ARCH_ARM_NEON
Simd operator&(Simd rhs) const
bool operator==(Simd rhs) const
NativeType raw
Definition simd.h:174
Simd operator>(Simd rhs) const
Simd operator<<(int shift) const
Simd operator*(Simd rhs) const
Simd operator^(Simd rhs) const
Simd operator-() const
Simd operator>=(Simd rhs) const
Simd operator<(Simd rhs) const
bool operator!=(Simd rhs) const
Simd operator|(Simd rhs) const
static constexpr int kSize
Definition simd.h:96
Simd operator+(Simd rhs) const
Simd operator~() const
Simd operator/(Simd rhs) const
Simd operator<=(Simd rhs) const
Scalar operator[](int i) const
#define MOCHI_ASSERT_VERBOSE(condition_without_side_effects,...)
Definition debug.h:102
#define MOCHI_UNLIKELY
#define MOCHI_FORCE_INLINE
Simd< T, 2 > Shuffle(Simd< T, 2 > a)
Definition simd_inl.h:287
Simd< T, 2 > HSumEach(Simd< T, 2 > a, Simd< T, 2 > b)
Returns {HSum(a), HSum(b)}.
Definition simd_inl.h:401
constexpr T const & Min(T const &a, T const &b)
constexpr auto Equal(T const &a, T const &b)
T HSum(Simd< T, N > a)
Definition simd_inl.h:391
T HMin(Simd< T, N > a)
Definition simd_inl.h:451
bool AllTrue(T const &a)
Definition basic_utils.h:60
Simd< T, N > Set(Simd< T, N > a, T value)
Definition simd_inl.h:327
constexpr auto NotEqual(T const &a, T const &b)
T HMax(Simd< T, N > a)
Definition simd_inl.h:461
V Broadcast(typename V::Scalar a)
Definition simd_inl.h:117
Simd< T, N > Blend(Simd< T, N > a, Simd< T, N > b)
Definition simd_inl.h:302
bool AnyTrue(T const &a)
Definition basic_utils.h:66
constexpr T Select(bool condition, T a, T b)
T Get(Simd< T, N > v)
Definition simd_inl.h:317
constexpr T const & Max(T const &a, T const &b)
void LoadTransposed(T const *ptr, Simd< T, N > &out0, Simd< T, N > &out1, Simd< T, N > &out2)
Definition simd_inl.h:209
void StoreTransposed(T *ptr, Simd< T, N > a, Simd< T, N > b, Simd< T, N > c)
Definition simd_inl.h:253
void Store(T *ptr, Simd< T, N > a)
Definition simd_inl.h:221
int StoreSelected(T *ptr, Simd< MaskT, N > condition, Simd< T, N > values)
Definition simd_inl.h:233
V Load(typename V::Scalar const *ptr)
Definition simd_inl.h:186
Simd< T, N > ShiftRight(Simd< T, N > a)
Definition simd_inl.h:274
#define MOCHI_NATIVE_SIMD_IMPL_BOILERPLATE(T, N, NativeT)