Debian Codegraph @

third-party/simde/arm/neon/st1_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 * 2020 Evan Nemerson <[email protected]>
25 * 2020 Sean Maher <[email protected]> (Copyright owned by Google, LLC)
26 */
27
28 #if !defined(SIMDE_ARM_NEON_ST1_LANE_H)
29 #define SIMDE_ARM_NEON_ST1_LANE_H
30 #include "types.h"
31
32 HEDLEY_DIAGNOSTIC_PUSH
33 SIMDE_DISABLE_UNWANTED_DIAGNOSTICS
34 SIMDE_BEGIN_DECLS_
35
36 SIMDE_FUNCTION_ATTRIBUTES
37 void
38 simde_vst1_lane_f32(simde_float32_t *ptr, simde_float32x2_t val, const int lane)
39 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 1) {
40 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
41 SIMDE_CONSTIFY_2_NO_RESULT_(vst1_lane_f32, HEDLEY_UNREACHABLE(), lane, ptr, val);
42 #else
43 simde_float32x2_private val_ = simde_float32x2_to_private(val);
44 *ptr = val_.values[lane];
45 #endif
46 }
47 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
48 #undef vst1_lane_f32
49 #define vst1_lane_f32(a, b, c) simde_vst1_lane_f32((a), (b), (c))
50 #endif
51
52 SIMDE_FUNCTION_ATTRIBUTES
53 void
54 simde_vst1_lane_f64(simde_float64_t *ptr, simde_float64x1_t val, const int lane)
55 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 0) {
56 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
57 (void) lane;
58 vst1_lane_f64(ptr, val, 0);
59 #else
60 simde_float64x1_private val_ = simde_float64x1_to_private(val);
61 *ptr = val_.values[lane];
62 #endif
63 }
64 #if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
65 #undef vst1_lane_f64
66 #define vst1_lane_f64(a, b, c) simde_vst1_lane_f64((a), (b), (c))
67 #endif
68
69 SIMDE_FUNCTION_ATTRIBUTES
70 void
71 simde_vst1_lane_s8(int8_t *ptr, simde_int8x8_t val, const int lane)
72 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 7) {
73 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
74 SIMDE_CONSTIFY_8_NO_RESULT_(vst1_lane_s8, HEDLEY_UNREACHABLE(), lane, ptr, val);
75 #else
76 simde_int8x8_private val_ = simde_int8x8_to_private(val);
77 *ptr = val_.values[lane];
78 #endif
79 }
80 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
81 #undef vst1_lane_s8
82 #define vst1_lane_s8(a, b, c) simde_vst1_lane_s8((a), (b), (c))
83 #endif
84
85 SIMDE_FUNCTION_ATTRIBUTES
86 void
87 simde_vst1_lane_s16(int16_t *ptr, simde_int16x4_t val, const int lane)
88 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 3) {
89 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
90 SIMDE_CONSTIFY_4_NO_RESULT_(vst1_lane_s16, HEDLEY_UNREACHABLE(), lane, ptr, val);
91 #else
92 simde_int16x4_private val_ = simde_int16x4_to_private(val);
93 *ptr = val_.values[lane];
94 #endif
95 }
96 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
97 #undef vst1_lane_s16
98 #define vst1_lane_s16(a, b, c) simde_vst1_lane_s16((a), (b), (c))
99 #endif
100
101 SIMDE_FUNCTION_ATTRIBUTES
102 void
103 simde_vst1_lane_s32(int32_t *ptr, simde_int32x2_t val, const int lane)
104 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 1) {
105 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
106 SIMDE_CONSTIFY_2_NO_RESULT_(vst1_lane_s32, HEDLEY_UNREACHABLE(), lane, ptr, val);
107 #else
108 simde_int32x2_private val_ = simde_int32x2_to_private(val);
109 *ptr = val_.values[lane];
110 #endif
111 }
112 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
113 #undef vst1_lane_s32
114 #define vst1_lane_s32(a, b, c) simde_vst1_lane_s32((a), (b), (c))
115 #endif
116
117 SIMDE_FUNCTION_ATTRIBUTES
118 void
119 simde_vst1_lane_s64(int64_t *ptr, simde_int64x1_t val, const int lane)
120 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 0) {
121 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
122 (void) lane;
123 vst1_lane_s64(ptr, val, 0);
124 #else
125 simde_int64x1_private val_ = simde_int64x1_to_private(val);
126 *ptr = val_.values[lane];
127 #endif
128 }
129 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
130 #undef vst1_lane_s64
131 #define vst1_lane_s64(a, b, c) simde_vst1_lane_s64((a), (b), (c))
132 #endif
133
134 SIMDE_FUNCTION_ATTRIBUTES
135 void
136 simde_vst1_lane_u8(uint8_t *ptr, simde_uint8x8_t val, const int lane)
137 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 7) {
138 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
139 SIMDE_CONSTIFY_8_NO_RESULT_(vst1_lane_u8, HEDLEY_UNREACHABLE(), lane, ptr, val);
140 #else
141 simde_uint8x8_private val_ = simde_uint8x8_to_private(val);
142 *ptr = val_.values[lane];
143 #endif
144 }
145 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
146 #undef vst1_lane_u8
147 #define vst1_lane_u8(a, b, c) simde_vst1_lane_u8((a), (b), (c))
148 #endif
149
150 SIMDE_FUNCTION_ATTRIBUTES
151 void
152 simde_vst1_lane_u16(uint16_t *ptr, simde_uint16x4_t val, const int lane)
153 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 3) {
154 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
155 SIMDE_CONSTIFY_4_NO_RESULT_(vst1_lane_u16, HEDLEY_UNREACHABLE(), lane, ptr, val);
156 #else
157 simde_uint16x4_private val_ = simde_uint16x4_to_private(val);
158 *ptr = val_.values[lane];
159 #endif
160 }
161 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
162 #undef vst1_lane_u16
163 #define vst1_lane_u16(a, b, c) simde_vst1_lane_u16((a), (b), (c))
164 #endif
165
166 SIMDE_FUNCTION_ATTRIBUTES
167 void
168 simde_vst1_lane_u32(uint32_t *ptr, simde_uint32x2_t val, const int lane)
169 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 1) {
170 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
171 SIMDE_CONSTIFY_2_NO_RESULT_(vst1_lane_u32, HEDLEY_UNREACHABLE(), lane, ptr, val);
172 #else
173 simde_uint32x2_private val_ = simde_uint32x2_to_private(val);
174 *ptr = val_.values[lane];
175 #endif
176 }
177 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
178 #undef vst1_lane_u32
179 #define vst1_lane_u32(a, b, c) simde_vst1_lane_u32((a), (b), (c))
180 #endif
181
182 SIMDE_FUNCTION_ATTRIBUTES
183 void
184 simde_vst1_lane_u64(uint64_t *ptr, simde_uint64x1_t val, const int lane)
185 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 0) {
186 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
187 (void) lane;
188 vst1_lane_u64(ptr, val, 0);
189 #else
190 simde_uint64x1_private val_ = simde_uint64x1_to_private(val);
191 *ptr = val_.values[lane];
192 #endif
193 }
194 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
195 #undef vst1_lane_u64
196 #define vst1_lane_u64(a, b, c) simde_vst1_lane_u64((a), (b), (c))
197 #endif
198
199 SIMDE_FUNCTION_ATTRIBUTES
200 void
201 simde_vst1q_lane_f32(simde_float32_t *ptr, simde_float32x4_t val, const int lane)
202 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 3) {
203 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
204 SIMDE_CONSTIFY_4_NO_RESULT_(vst1q_lane_f32, HEDLEY_UNREACHABLE(), lane, ptr, val);
205 #else
206 simde_float32x4_private val_ = simde_float32x4_to_private(val);
207 *ptr = val_.values[lane];
208 #endif
209 }
210 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
211 #undef vst1q_lane_f32
212 #define vst1q_lane_f32(a, b, c) simde_vst1q_lane_f32((a), (b), (c))
213 #endif
214
215 SIMDE_FUNCTION_ATTRIBUTES
216 void
217 simde_vst1q_lane_f64(simde_float64_t *ptr, simde_float64x2_t val, const int lane)
218 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 1) {
219 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
220 SIMDE_CONSTIFY_2_NO_RESULT_(vst1q_lane_f64, HEDLEY_UNREACHABLE(), lane, ptr, val);
221 #else
222 simde_float64x2_private val_ = simde_float64x2_to_private(val);
223 *ptr = val_.values[lane];
224 #endif
225 }
226 #if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
227 #undef vst1q_lane_f64
228 #define vst1q_lane_f64(a, b, c) simde_vst1q_lane_f64((a), (b), (c))
229 #endif
230
231 SIMDE_FUNCTION_ATTRIBUTES
232 void
233 simde_vst1q_lane_s8(int8_t *ptr, simde_int8x16_t val, const int lane)
234 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 15) {
235 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
236 SIMDE_CONSTIFY_16_NO_RESULT_(vst1q_lane_s8, HEDLEY_UNREACHABLE(), lane, ptr, val);
237 #else
238 simde_int8x16_private val_ = simde_int8x16_to_private(val);
239 *ptr = val_.values[lane];
240 #endif
241 }
242 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
243 #undef vst1q_lane_s8
244 #define vst1q_lane_s8(a, b, c) simde_vst1q_lane_s8((a), (b), (c))
245 #endif
246
247 SIMDE_FUNCTION_ATTRIBUTES
248 void
249 simde_vst1q_lane_s16(int16_t *ptr, simde_int16x8_t val, const int lane)
250 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 7) {
251 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
252 SIMDE_CONSTIFY_8_NO_RESULT_(vst1q_lane_s16, HEDLEY_UNREACHABLE(), lane, ptr, val);
253 #else
254 simde_int16x8_private val_ = simde_int16x8_to_private(val);
255 *ptr = val_.values[lane];
256 #endif
257 }
258 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
259 #undef vst1q_lane_s16
260 #define vst1q_lane_s16(a, b, c) simde_vst1q_lane_s16((a), (b), (c))
261 #endif
262
263 SIMDE_FUNCTION_ATTRIBUTES
264 void
265 simde_vst1q_lane_s32(int32_t *ptr, simde_int32x4_t val, const int lane)
266 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 3) {
267 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
268 SIMDE_CONSTIFY_4_NO_RESULT_(vst1q_lane_s32, HEDLEY_UNREACHABLE(), lane, ptr, val);
269 #else
270 simde_int32x4_private val_ = simde_int32x4_to_private(val);
271 *ptr = val_.values[lane];
272 #endif
273 }
274 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
275 #undef vst1q_lane_s32
276 #define vst1q_lane_s32(a, b, c) simde_vst1q_lane_s32((a), (b), (c))
277 #endif
278
279 SIMDE_FUNCTION_ATTRIBUTES
280 void
281 simde_vst1q_lane_s64(int64_t *ptr, simde_int64x2_t val, const int lane)
282 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 1) {
283 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
284 SIMDE_CONSTIFY_2_NO_RESULT_(vst1q_lane_s64, HEDLEY_UNREACHABLE(), lane, ptr, val);
285 #else
286 simde_int64x2_private val_ = simde_int64x2_to_private(val);
287 *ptr = val_.values[lane];
288 #endif
289 }
290 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
291 #undef vst1q_lane_s64
292 #define vst1q_lane_s64(a, b, c) simde_vst1q_lane_s64((a), (b), (c))
293 #endif
294
295 SIMDE_FUNCTION_ATTRIBUTES
296 void
297 simde_vst1q_lane_u8(uint8_t *ptr, simde_uint8x16_t val, const int lane)
298 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 15) {
299 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
300 SIMDE_CONSTIFY_16_NO_RESULT_(vst1q_lane_u8, HEDLEY_UNREACHABLE(), lane, ptr, val);
301 #else
302 simde_uint8x16_private val_ = simde_uint8x16_to_private(val);
303 *ptr = val_.values[lane];
304 #endif
305 }
306 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
307 #undef vst1q_lane_u8
308 #define vst1q_lane_u8(a, b, c) simde_vst1q_lane_u8((a), (b), (c))
309 #endif
310
311 SIMDE_FUNCTION_ATTRIBUTES
312 void
313 simde_vst1q_lane_u16(uint16_t *ptr, simde_uint16x8_t val, const int lane)
314 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 7) {
315 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
316 SIMDE_CONSTIFY_8_NO_RESULT_(vst1q_lane_u16, HEDLEY_UNREACHABLE(), lane, ptr, val);
317 #else
318 simde_uint16x8_private val_ = simde_uint16x8_to_private(val);
319 *ptr = val_.values[lane];
320 #endif
321 }
322 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
323 #undef vst1q_lane_u16
324 #define vst1q_lane_u16(a, b, c) simde_vst1q_lane_u16((a), (b), (c))
325 #endif
326
327 SIMDE_FUNCTION_ATTRIBUTES
328 void
329 simde_vst1q_lane_u32(uint32_t *ptr, simde_uint32x4_t val, const int lane)
330 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 3) {
331 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
332 SIMDE_CONSTIFY_4_NO_RESULT_(vst1q_lane_u32, HEDLEY_UNREACHABLE(), lane, ptr, val);
333 #else
334 simde_uint32x4_private val_ = simde_uint32x4_to_private(val);
335 *ptr = val_.values[lane];
336 #endif
337 }
338 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
339 #undef vst1q_lane_u32
340 #define vst1q_lane_u32(a, b, c) simde_vst1q_lane_u32((a), (b), (c))
341 #endif
342
343 SIMDE_FUNCTION_ATTRIBUTES
344 void
345 simde_vst1q_lane_u64(uint64_t *ptr, simde_uint64x2_t val, const int lane)
346 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 1) {
347 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
348 SIMDE_CONSTIFY_2_NO_RESULT_(vst1q_lane_u64, HEDLEY_UNREACHABLE(), lane, ptr, val);
349 #else
350 simde_uint64x2_private val_ = simde_uint64x2_to_private(val);
351 *ptr = val_.values[lane];
352 #endif
353 }
354 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
355 #undef vst1q_lane_u64
356 #define vst1q_lane_u64(a, b, c) simde_vst1q_lane_u64((a), (b), (c))
357 #endif
358
359 SIMDE_END_DECLS_
360 HEDLEY_DIAGNOSTIC_POP
361
362 #endif /* !defined(SIMDE_ARM_NEON_ST1_LANE_H) */
363