Debian Codegraph @

third-party/simde/arm/neon/st3_lane.h

raw
1 /* SPDX-License-Identifier: MIT
2 *
3 * Permission is hereby granted, free of charge, to any person
4 * obtaining a copy of this software and associated documentation
5 * files (the "Software"), to deal in the Software without
6 * restriction, including without limitation the rights to use, copy,
7 * modify, merge, publish, distribute, sublicense, and/or sell copies
8 * of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be
12 * included in all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
18 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
19 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 * SOFTWARE.
22 *
23 * Copyright:
24 * 2021 Zhi An Ng <[email protected]> (Copyright owned by Google, LLC)
25 */
26
27 #if !defined(SIMDE_ARM_NEON_ST3_LANE_H)
28 #define SIMDE_ARM_NEON_ST3_LANE_H
29
30 #include "types.h"
31
32 HEDLEY_DIAGNOSTIC_PUSH
33 SIMDE_DISABLE_UNWANTED_DIAGNOSTICS
34 SIMDE_BEGIN_DECLS_
35
36 #if !defined(SIMDE_BUG_INTEL_857088)
37
38 SIMDE_FUNCTION_ATTRIBUTES
39 void
40 simde_vst3_lane_s8(int8_t ptr[HEDLEY_ARRAY_PARAM(3)], simde_int8x8x3_t val, const int lane)
41 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 7) {
42 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
43 SIMDE_CONSTIFY_8_NO_RESULT_(vst3_lane_s8, HEDLEY_UNREACHABLE(), lane, ptr, val);
44 #else
45 simde_int8x8_private r;
46 for (size_t i = 0 ; i < 3 ; i++) {
47 r = simde_int8x8_to_private(val.val[i]);
48 ptr[i] = r.values[lane];
49 }
50 #endif
51 }
52 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
53 #undef vst3_lane_s8
54 #define vst3_lane_s8(a, b, c) simde_vst3_lane_s8((a), (b), (c))
55 #endif
56
57 SIMDE_FUNCTION_ATTRIBUTES
58 void
59 simde_vst3_lane_s16(int16_t ptr[HEDLEY_ARRAY_PARAM(3)], simde_int16x4x3_t val, const int lane)
60 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 3) {
61 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
62 SIMDE_CONSTIFY_4_NO_RESULT_(vst3_lane_s16, HEDLEY_UNREACHABLE(), lane, ptr, val);
63 #else
64 simde_int16x4_private r;
65 for (size_t i = 0 ; i < 3 ; i++) {
66 r = simde_int16x4_to_private(val.val[i]);
67 ptr[i] = r.values[lane];
68 }
69 #endif
70 }
71 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
72 #undef vst3_lane_s16
73 #define vst3_lane_s16(a, b, c) simde_vst3_lane_s16((a), (b), (c))
74 #endif
75
76 SIMDE_FUNCTION_ATTRIBUTES
77 void
78 simde_vst3_lane_s32(int32_t ptr[HEDLEY_ARRAY_PARAM(3)], simde_int32x2x3_t val, const int lane)
79 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 1) {
80 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
81 SIMDE_CONSTIFY_2_NO_RESULT_(vst3_lane_s32, HEDLEY_UNREACHABLE(), lane, ptr, val);
82 #else
83 simde_int32x2_private r;
84 for (size_t i = 0 ; i < 3 ; i++) {
85 r = simde_int32x2_to_private(val.val[i]);
86 ptr[i] = r.values[lane];
87 }
88 #endif
89 }
90 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
91 #undef vst3_lane_s32
92 #define vst3_lane_s32(a, b, c) simde_vst3_lane_s32((a), (b), (c))
93 #endif
94
95 SIMDE_FUNCTION_ATTRIBUTES
96 void
97 simde_vst3_lane_s64(int64_t ptr[HEDLEY_ARRAY_PARAM(3)], simde_int64x1x3_t val, const int lane)
98 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 0) {
99 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
100 HEDLEY_STATIC_CAST(void, lane);
101 vst3_lane_s64(ptr, val, 0);
102 #else
103 simde_int64x1_private r;
104 for (size_t i = 0 ; i < 3 ; i++) {
105 r = simde_int64x1_to_private(val.val[i]);
106 ptr[i] = r.values[lane];
107 }
108 #endif
109 }
110 #if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
111 #undef vst3_lane_s64
112 #define vst3_lane_s64(a, b, c) simde_vst3_lane_s64((a), (b), (c))
113 #endif
114
115 SIMDE_FUNCTION_ATTRIBUTES
116 void
117 simde_vst3_lane_u8(uint8_t ptr[HEDLEY_ARRAY_PARAM(3)], simde_uint8x8x3_t val, const int lane)
118 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 7) {
119 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
120 SIMDE_CONSTIFY_8_NO_RESULT_(vst3_lane_u8, HEDLEY_UNREACHABLE(), lane, ptr, val);
121 #else
122 simde_uint8x8_private r;
123 for (size_t i = 0 ; i < 3 ; i++) {
124 r = simde_uint8x8_to_private(val.val[i]);
125 ptr[i] = r.values[lane];
126 }
127 #endif
128 }
129 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
130 #undef vst3_lane_u8
131 #define vst3_lane_u8(a, b, c) simde_vst3_lane_u8((a), (b), (c))
132 #endif
133
134 SIMDE_FUNCTION_ATTRIBUTES
135 void
136 simde_vst3_lane_u16(uint16_t ptr[HEDLEY_ARRAY_PARAM(3)], simde_uint16x4x3_t val, const int lane)
137 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 3) {
138 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
139 SIMDE_CONSTIFY_4_NO_RESULT_(vst3_lane_u16, HEDLEY_UNREACHABLE(), lane, ptr, val);
140 #else
141 simde_uint16x4_private r;
142 for (size_t i = 0 ; i < 3 ; i++) {
143 r = simde_uint16x4_to_private(val.val[i]);
144 ptr[i] = r.values[lane];
145 }
146 #endif
147 }
148 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
149 #undef vst3_lane_u16
150 #define vst3_lane_u16(a, b, c) simde_vst3_lane_u16((a), (b), (c))
151 #endif
152
153 SIMDE_FUNCTION_ATTRIBUTES
154 void
155 simde_vst3_lane_u32(uint32_t ptr[HEDLEY_ARRAY_PARAM(3)], simde_uint32x2x3_t val, const int lane)
156 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 1) {
157 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
158 SIMDE_CONSTIFY_2_NO_RESULT_(vst3_lane_u32, HEDLEY_UNREACHABLE(), lane, ptr, val);
159 #else
160 simde_uint32x2_private r;
161 for (size_t i = 0 ; i < 3 ; i++) {
162 r = simde_uint32x2_to_private(val.val[i]);
163 ptr[i] = r.values[lane];
164 }
165 #endif
166 }
167 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
168 #undef vst3_lane_u32
169 #define vst3_lane_u32(a, b, c) simde_vst3_lane_u32((a), (b), (c))
170 #endif
171
172 SIMDE_FUNCTION_ATTRIBUTES
173 void
174 simde_vst3_lane_u64(uint64_t ptr[HEDLEY_ARRAY_PARAM(3)], simde_uint64x1x3_t val, const int lane)
175 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 0) {
176 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
177 HEDLEY_STATIC_CAST(void, lane);
178 vst3_lane_u64(ptr, val, 0);
179 #else
180 simde_uint64x1_private r;
181 for (size_t i = 0 ; i < 3 ; i++) {
182 r = simde_uint64x1_to_private(val.val[i]);
183 ptr[i] = r.values[lane];
184 }
185 #endif
186 }
187 #if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
188 #undef vst3_lane_u64
189 #define vst3_lane_u64(a, b, c) simde_vst3_lane_u64((a), (b), (c))
190 #endif
191
192 SIMDE_FUNCTION_ATTRIBUTES
193 void
194 simde_vst3_lane_f32(simde_float32_t ptr[HEDLEY_ARRAY_PARAM(3)], simde_float32x2x3_t val, const int lane)
195 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 1) {
196 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
197 SIMDE_CONSTIFY_2_NO_RESULT_(vst3_lane_f32, HEDLEY_UNREACHABLE(), lane, ptr, val);
198 #else
199 simde_float32x2_private r;
200 for (size_t i = 0 ; i < 3 ; i++) {
201 r = simde_float32x2_to_private(val.val[i]);
202 ptr[i] = r.values[lane];
203 }
204 #endif
205 }
206 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
207 #undef vst3_lane_f32
208 #define vst3_lane_f32(a, b, c) simde_vst3_lane_f32((a), (b), (c))
209 #endif
210
211 SIMDE_FUNCTION_ATTRIBUTES
212 void
213 simde_vst3_lane_f64(simde_float64_t ptr[HEDLEY_ARRAY_PARAM(3)], simde_float64x1x3_t val, const int lane)
214 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 0) {
215 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
216 HEDLEY_STATIC_CAST(void, lane);
217 vst3_lane_f64(ptr, val, 0);
218 #else
219 simde_float64x1_private r;
220 for (size_t i = 0 ; i < 3 ; i++) {
221 r = simde_float64x1_to_private(val.val[i]);
222 ptr[i] = r.values[lane];
223 }
224 #endif
225 }
226 #if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
227 #undef vst3_lane_f64
228 #define vst3_lane_f64(a, b, c) simde_vst3_lane_f64((a), (b), (c))
229 #endif
230
231 SIMDE_FUNCTION_ATTRIBUTES
232 void
233 simde_vst3q_lane_s8(int8_t ptr[HEDLEY_ARRAY_PARAM(3)], simde_int8x16x3_t val, const int lane)
234 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 15) {
235 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
236 SIMDE_CONSTIFY_16_NO_RESULT_(vst3q_lane_s8, HEDLEY_UNREACHABLE(), lane, ptr, val);
237 #else
238 simde_int8x16_private r;
239 for (size_t i = 0 ; i < 3 ; i++) {
240 r = simde_int8x16_to_private(val.val[i]);
241 ptr[i] = r.values[lane];
242 }
243 #endif
244 }
245 #if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
246 #undef vst3q_lane_s8
247 #define vst3q_lane_s8(a, b, c) simde_vst3q_lane_s8((a), (b), (c))
248 #endif
249
250 SIMDE_FUNCTION_ATTRIBUTES
251 void
252 simde_vst3q_lane_s16(int16_t ptr[HEDLEY_ARRAY_PARAM(3)], simde_int16x8x3_t val, const int lane)
253 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 7) {
254 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
255 SIMDE_CONSTIFY_8_NO_RESULT_(vst3q_lane_s16, HEDLEY_UNREACHABLE(), lane, ptr, val);
256 #else
257 simde_int16x8_private r;
258 for (size_t i = 0 ; i < 3 ; i++) {
259 r = simde_int16x8_to_private(val.val[i]);
260 ptr[i] = r.values[lane];
261 }
262 #endif
263 }
264 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
265 #undef vst3q_lane_s16
266 #define vst3q_lane_s16(a, b, c) simde_vst3q_lane_s16((a), (b), (c))
267 #endif
268
269 SIMDE_FUNCTION_ATTRIBUTES
270 void
271 simde_vst3q_lane_s32(int32_t ptr[HEDLEY_ARRAY_PARAM(3)], simde_int32x4x3_t val, const int lane)
272 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 3) {
273 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
274 SIMDE_CONSTIFY_4_NO_RESULT_(vst3q_lane_s32, HEDLEY_UNREACHABLE(), lane, ptr, val);
275 #else
276 simde_int32x4_private r;
277 for (size_t i = 0 ; i < 3 ; i++) {
278 r = simde_int32x4_to_private(val.val[i]);
279 ptr[i] = r.values[lane];
280 }
281 #endif
282 }
283 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
284 #undef vst3q_lane_s32
285 #define vst3q_lane_s32(a, b, c) simde_vst3q_lane_s32((a), (b), (c))
286 #endif
287
288 SIMDE_FUNCTION_ATTRIBUTES
289 void
290 simde_vst3q_lane_s64(int64_t ptr[HEDLEY_ARRAY_PARAM(3)], simde_int64x2x3_t val, const int lane)
291 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 1) {
292 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
293 SIMDE_CONSTIFY_2_NO_RESULT_(vst3q_lane_s64, HEDLEY_UNREACHABLE(), lane, ptr, val);
294 #else
295 simde_int64x2_private r;
296 for (size_t i = 0 ; i < 3 ; i++) {
297 r = simde_int64x2_to_private(val.val[i]);
298 ptr[i] = r.values[lane];
299 }
300 #endif
301 }
302 #if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
303 #undef vst3q_lane_s64
304 #define vst3q_lane_s64(a, b, c) simde_vst3q_lane_s64((a), (b), (c))
305 #endif
306
307 SIMDE_FUNCTION_ATTRIBUTES
308 void
309 simde_vst3q_lane_u8(uint8_t ptr[HEDLEY_ARRAY_PARAM(3)], simde_uint8x16x3_t val, const int lane)
310 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 15) {
311 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
312 SIMDE_CONSTIFY_16_NO_RESULT_(vst3q_lane_u8, HEDLEY_UNREACHABLE(), lane, ptr, val);
313 #else
314 simde_uint8x16_private r;
315 for (size_t i = 0 ; i < 3 ; i++) {
316 r = simde_uint8x16_to_private(val.val[i]);
317 ptr[i] = r.values[lane];
318 }
319 #endif
320 }
321 #if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
322 #undef vst3q_lane_u8
323 #define vst3q_lane_u8(a, b, c) simde_vst3q_lane_u8((a), (b), (c))
324 #endif
325
326 SIMDE_FUNCTION_ATTRIBUTES
327 void
328 simde_vst3q_lane_u16(uint16_t ptr[HEDLEY_ARRAY_PARAM(3)], simde_uint16x8x3_t val, const int lane)
329 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 7) {
330 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
331 SIMDE_CONSTIFY_8_NO_RESULT_(vst3q_lane_u16, HEDLEY_UNREACHABLE(), lane, ptr, val);
332 #else
333 simde_uint16x8_private r;
334 for (size_t i = 0 ; i < 3 ; i++) {
335 r = simde_uint16x8_to_private(val.val[i]);
336 ptr[i] = r.values[lane];
337 }
338 #endif
339 }
340 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
341 #undef vst3q_lane_u16
342 #define vst3q_lane_u16(a, b, c) simde_vst3q_lane_u16((a), (b), (c))
343 #endif
344
345 SIMDE_FUNCTION_ATTRIBUTES
346 void
347 simde_vst3q_lane_u32(uint32_t ptr[HEDLEY_ARRAY_PARAM(3)], simde_uint32x4x3_t val, const int lane)
348 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 3) {
349 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
350 SIMDE_CONSTIFY_4_NO_RESULT_(vst3q_lane_u32, HEDLEY_UNREACHABLE(), lane, ptr, val);
351 #else
352 simde_uint32x4_private r;
353 for (size_t i = 0 ; i < 3 ; i++) {
354 r = simde_uint32x4_to_private(val.val[i]);
355 ptr[i] = r.values[lane];
356 }
357 #endif
358 }
359 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
360 #undef vst3q_lane_u32
361 #define vst3q_lane_u32(a, b, c) simde_vst3q_lane_u32((a), (b), (c))
362 #endif
363
364 SIMDE_FUNCTION_ATTRIBUTES
365 void
366 simde_vst3q_lane_u64(uint64_t ptr[HEDLEY_ARRAY_PARAM(3)], simde_uint64x2x3_t val, const int lane)
367 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 1) {
368 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
369 SIMDE_CONSTIFY_2_NO_RESULT_(vst3q_lane_u64, HEDLEY_UNREACHABLE(), lane, ptr, val);
370 #else
371 simde_uint64x2_private r;
372 for (size_t i = 0 ; i < 3 ; i++) {
373 r = simde_uint64x2_to_private(val.val[i]);
374 ptr[i] = r.values[lane];
375 }
376 #endif
377 }
378 #if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
379 #undef vst3q_lane_u64
380 #define vst3q_lane_u64(a, b, c) simde_vst3q_lane_u64((a), (b), (c))
381 #endif
382
383 SIMDE_FUNCTION_ATTRIBUTES
384 void
385 simde_vst3q_lane_f32(simde_float32_t ptr[HEDLEY_ARRAY_PARAM(3)], simde_float32x4x3_t val, const int lane)
386 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 3) {
387 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
388 SIMDE_CONSTIFY_4_NO_RESULT_(vst3q_lane_f32, HEDLEY_UNREACHABLE(), lane, ptr, val);
389 #else
390 simde_float32x4_private r;
391 for (size_t i = 0 ; i < 3 ; i++) {
392 r = simde_float32x4_to_private(val.val[i]);
393 ptr[i] = r.values[lane];
394 }
395 #endif
396 }
397 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
398 #undef vst3q_lane_f32
399 #define vst3q_lane_f32(a, b, c) simde_vst3q_lane_f32((a), (b), (c))
400 #endif
401
402 SIMDE_FUNCTION_ATTRIBUTES
403 void
404 simde_vst3q_lane_f64(simde_float64_t ptr[HEDLEY_ARRAY_PARAM(3)], simde_float64x2x3_t val, const int lane){
405 //SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 1) {
406 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
407 SIMDE_CONSTIFY_2_NO_RESULT_(vst3q_lane_f64, HEDLEY_UNREACHABLE(), lane, ptr, val);
408 #else
409 simde_float64x2_private r;
410 for (size_t i = 0 ; i < 3 ; i++) {
411 r = simde_float64x2_to_private(val.val[i]);
412 ptr[i] = r.values[lane];
413 }
414 #endif
415 }
416 #if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
417 #undef vst3q_lane_f64
418 #define vst3q_lane_f64(a, b, c) simde_vst3q_lane_f64((a), (b), (c))
419 #endif
420
421 #endif /* !defined(SIMDE_BUG_INTEL_857088) */
422
423 SIMDE_END_DECLS_
424 HEDLEY_DIAGNOSTIC_POP
425
426 #endif /* !defined(SIMDE_ARM_NEON_ST3_LANE_H) */