Debian Codegraph @

third-party/simde/arm/neon/ld4_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 * 2021 Evan Nemerson <[email protected]>
26 */
27
28 /* In older versions of clang, __builtin_neon_vld4_lane_v would
29 * generate a diagnostic for most variants (those which didn't
30 * use signed 8-bit integers). I believe this was fixed by
31 * 78ad22e0cc6390fcd44b2b7b5132f1b960ff975d.
32 *
33 * Since we have to use macros (due to the immediate-mode parameter)
34 * we can't just disable it once in this file; we have to use statement
35 * exprs and push / pop the stack for each macro. */
36
37 #if !defined(SIMDE_ARM_NEON_LD4_LANE_H)
38 #define SIMDE_ARM_NEON_LD4_LANE_H
39
40 #include "types.h"
41
42 HEDLEY_DIAGNOSTIC_PUSH
43 SIMDE_DISABLE_UNWANTED_DIAGNOSTICS
44 SIMDE_BEGIN_DECLS_
45
46 #if !defined(SIMDE_BUG_INTEL_857088)
47
48 SIMDE_FUNCTION_ATTRIBUTES
49 simde_int8x8x4_t
50 simde_vld4_lane_s8(int8_t const ptr[HEDLEY_ARRAY_PARAM(4)], simde_int8x8x4_t src, const int lane)
51 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 7) {
52 simde_int8x8x4_t r;
53
54 for (size_t i = 0 ; i < 4 ; i++) {
55 simde_int8x8_private tmp_ = simde_int8x8_to_private(src.val[i]);
56 tmp_.values[lane] = ptr[i];
57 r.val[i] = simde_int8x8_from_private(tmp_);
58 }
59
60 return r;
61 }
62 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
63 #if defined(__clang__) && !SIMDE_DETECT_CLANG_VERSION_CHECK(10,0,0)
64 #define simde_vld4_lane_s8(ptr, src, lane) \
65 SIMDE_DISABLE_DIAGNOSTIC_EXPR_(SIMDE_DIAGNOSTIC_DISABLE_VECTOR_CONVERSION_, vld4_lane_s8(ptr, src, lane))
66 #else
67 #define simde_vld4_lane_s8(ptr, src, lane) vld4_lane_s8(ptr, src, lane)
68 #endif
69 #endif
70 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
71 #undef vld4_lane_s8
72 #define vld4_lane_s8(ptr, src, lane) simde_vld4_lane_s8((ptr), (src), (lane))
73 #endif
74
75 SIMDE_FUNCTION_ATTRIBUTES
76 simde_int16x4x4_t
77 simde_vld4_lane_s16(int16_t const ptr[HEDLEY_ARRAY_PARAM(4)], simde_int16x4x4_t src, const int lane)
78 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 3) {
79 simde_int16x4x4_t r;
80
81 for (size_t i = 0 ; i < 4 ; i++) {
82 simde_int16x4_private tmp_ = simde_int16x4_to_private(src.val[i]);
83 tmp_.values[lane] = ptr[i];
84 r.val[i] = simde_int16x4_from_private(tmp_);
85 }
86
87 return r;
88 }
89 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
90 #if defined(__clang__) && !SIMDE_DETECT_CLANG_VERSION_CHECK(10,0,0)
91 #define simde_vld4_lane_s16(ptr, src, lane) \
92 SIMDE_DISABLE_DIAGNOSTIC_EXPR_(SIMDE_DIAGNOSTIC_DISABLE_VECTOR_CONVERSION_, vld4_lane_s16(ptr, src, lane))
93 #else
94 #define simde_vld4_lane_s16(ptr, src, lane) vld4_lane_s16(ptr, src, lane)
95 #endif
96 #endif
97 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
98 #undef vld4_lane_s16
99 #define vld4_lane_s16(ptr, src, lane) simde_vld4_lane_s16((ptr), (src), (lane))
100 #endif
101
102 SIMDE_FUNCTION_ATTRIBUTES
103 simde_int32x2x4_t
104 simde_vld4_lane_s32(int32_t const ptr[HEDLEY_ARRAY_PARAM(4)], simde_int32x2x4_t src, const int lane)
105 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 1) {
106 simde_int32x2x4_t r;
107
108 for (size_t i = 0 ; i < 4 ; i++) {
109 simde_int32x2_private tmp_ = simde_int32x2_to_private(src.val[i]);
110 tmp_.values[lane] = ptr[i];
111 r.val[i] = simde_int32x2_from_private(tmp_);
112 }
113
114 return r;
115 }
116 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
117 #if defined(__clang__) && !SIMDE_DETECT_CLANG_VERSION_CHECK(10,0,0)
118 #define simde_vld4_lane_s32(ptr, src, lane) \
119 SIMDE_DISABLE_DIAGNOSTIC_EXPR_(SIMDE_DIAGNOSTIC_DISABLE_VECTOR_CONVERSION_, vld4_lane_s32(ptr, src, lane))
120 #else
121 #define simde_vld4_lane_s32(ptr, src, lane) vld4_lane_s32(ptr, src, lane)
122 #endif
123 #endif
124 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
125 #undef vld4_lane_s32
126 #define vld4_lane_s32(ptr, src, lane) simde_vld4_lane_s32((ptr), (src), (lane))
127 #endif
128
129 SIMDE_FUNCTION_ATTRIBUTES
130 simde_int64x1x4_t
131 simde_vld4_lane_s64(int64_t const ptr[HEDLEY_ARRAY_PARAM(4)], simde_int64x1x4_t src, const int lane)
132 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 0) {
133 simde_int64x1x4_t r;
134
135 for (size_t i = 0 ; i < 4 ; i++) {
136 simde_int64x1_private tmp_ = simde_int64x1_to_private(src.val[i]);
137 tmp_.values[lane] = ptr[i];
138 r.val[i] = simde_int64x1_from_private(tmp_);
139 }
140
141 return r;
142 }
143 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
144 #if defined(__clang__) && !SIMDE_DETECT_CLANG_VERSION_CHECK(10,0,0)
145 #define simde_vld4_lane_s64(ptr, src, lane) \
146 SIMDE_DISABLE_DIAGNOSTIC_EXPR_(SIMDE_DIAGNOSTIC_DISABLE_VECTOR_CONVERSION_, vld4_lane_s64(ptr, src, lane))
147 #else
148 #define simde_vld4_lane_s64(ptr, src, lane) vld4_lane_s64(ptr, src, lane)
149 #endif
150 #endif
151 #if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
152 #undef vld4_lane_s64
153 #define vld4_lane_s64(ptr, src, lane) simde_vld4_lane_s64((ptr), (src), (lane))
154 #endif
155
156 SIMDE_FUNCTION_ATTRIBUTES
157 simde_uint8x8x4_t
158 simde_vld4_lane_u8(uint8_t const ptr[HEDLEY_ARRAY_PARAM(4)], simde_uint8x8x4_t src, const int lane)
159 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 7) {
160 simde_uint8x8x4_t r;
161
162 for (size_t i = 0 ; i < 4 ; i++) {
163 simde_uint8x8_private tmp_ = simde_uint8x8_to_private(src.val[i]);
164 tmp_.values[lane] = ptr[i];
165 r.val[i] = simde_uint8x8_from_private(tmp_);
166 }
167
168 return r;
169 }
170 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
171 #if defined(__clang__) && !SIMDE_DETECT_CLANG_VERSION_CHECK(10,0,0)
172 #define simde_vld4_lane_u8(ptr, src, lane) \
173 SIMDE_DISABLE_DIAGNOSTIC_EXPR_(SIMDE_DIAGNOSTIC_DISABLE_VECTOR_CONVERSION_, vld4_lane_u8(ptr, src, lane))
174 #else
175 #define simde_vld4_lane_u8(ptr, src, lane) vld4_lane_u8(ptr, src, lane)
176 #endif
177 #endif
178 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
179 #undef vld4_lane_u8
180 #define vld4_lane_u8(ptr, src, lane) simde_vld4_lane_u8((ptr), (src), (lane))
181 #endif
182
183 SIMDE_FUNCTION_ATTRIBUTES
184 simde_uint16x4x4_t
185 simde_vld4_lane_u16(uint16_t const ptr[HEDLEY_ARRAY_PARAM(4)], simde_uint16x4x4_t src, const int lane)
186 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 3) {
187 simde_uint16x4x4_t r;
188
189 for (size_t i = 0 ; i < 4 ; i++) {
190 simde_uint16x4_private tmp_ = simde_uint16x4_to_private(src.val[i]);
191 tmp_.values[lane] = ptr[i];
192 r.val[i] = simde_uint16x4_from_private(tmp_);
193 }
194
195 return r;
196 }
197 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
198 #if defined(__clang__) && !SIMDE_DETECT_CLANG_VERSION_CHECK(10,0,0)
199 #define simde_vld4_lane_u16(ptr, src, lane) \
200 SIMDE_DISABLE_DIAGNOSTIC_EXPR_(SIMDE_DIAGNOSTIC_DISABLE_VECTOR_CONVERSION_, vld4_lane_u16(ptr, src, lane))
201 #else
202 #define simde_vld4_lane_u16(ptr, src, lane) vld4_lane_u16(ptr, src, lane)
203 #endif
204 #endif
205 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
206 #undef vld4_lane_u16
207 #define vld4_lane_u16(ptr, src, lane) simde_vld4_lane_u16((ptr), (src), (lane))
208 #endif
209
210 SIMDE_FUNCTION_ATTRIBUTES
211 simde_uint32x2x4_t
212 simde_vld4_lane_u32(uint32_t const ptr[HEDLEY_ARRAY_PARAM(4)], simde_uint32x2x4_t src, const int lane)
213 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 1) {
214 simde_uint32x2x4_t r;
215
216 for (size_t i = 0 ; i < 4 ; i++) {
217 simde_uint32x2_private tmp_ = simde_uint32x2_to_private(src.val[i]);
218 tmp_.values[lane] = ptr[i];
219 r.val[i] = simde_uint32x2_from_private(tmp_);
220 }
221
222 return r;
223 }
224 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
225 #if defined(__clang__) && !SIMDE_DETECT_CLANG_VERSION_CHECK(10,0,0)
226 #define simde_vld4_lane_u32(ptr, src, lane) \
227 SIMDE_DISABLE_DIAGNOSTIC_EXPR_(SIMDE_DIAGNOSTIC_DISABLE_VECTOR_CONVERSION_, vld4_lane_u32(ptr, src, lane))
228 #else
229 #define simde_vld4_lane_u32(ptr, src, lane) vld4_lane_u32(ptr, src, lane)
230 #endif
231 #endif
232 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
233 #undef vld4_lane_u32
234 #define vld4_lane_u32(ptr, src, lane) simde_vld4_lane_u32((ptr), (src), (lane))
235 #endif
236
237 SIMDE_FUNCTION_ATTRIBUTES
238 simde_uint64x1x4_t
239 simde_vld4_lane_u64(uint64_t const ptr[HEDLEY_ARRAY_PARAM(4)], simde_uint64x1x4_t src, const int lane)
240 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 0) {
241 simde_uint64x1x4_t r;
242
243 for (size_t i = 0 ; i < 4 ; i++) {
244 simde_uint64x1_private tmp_ = simde_uint64x1_to_private(src.val[i]);
245 tmp_.values[lane] = ptr[i];
246 r.val[i] = simde_uint64x1_from_private(tmp_);
247 }
248
249 return r;
250 }
251 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
252 #if defined(__clang__) && !SIMDE_DETECT_CLANG_VERSION_CHECK(10,0,0)
253 #define simde_vld4_lane_u64(ptr, src, lane) \
254 SIMDE_DISABLE_DIAGNOSTIC_EXPR_(SIMDE_DIAGNOSTIC_DISABLE_VECTOR_CONVERSION_, vld4_lane_u64(ptr, src, lane))
255 #else
256 #define simde_vld4_lane_u64(ptr, src, lane) vld4_lane_u64(ptr, src, lane)
257 #endif
258 #endif
259 #if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
260 #undef vld4_lane_u64
261 #define vld4_lane_u64(ptr, src, lane) simde_vld4_lane_u64((ptr), (src), (lane))
262 #endif
263
264 SIMDE_FUNCTION_ATTRIBUTES
265 simde_float32x2x4_t
266 simde_vld4_lane_f32(simde_float32_t const ptr[HEDLEY_ARRAY_PARAM(4)], simde_float32x2x4_t src, const int lane)
267 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 1) {
268 simde_float32x2x4_t r;
269
270 for (size_t i = 0 ; i < 4 ; i++) {
271 simde_float32x2_private tmp_ = simde_float32x2_to_private(src.val[i]);
272 tmp_.values[lane] = ptr[i];
273 r.val[i] = simde_float32x2_from_private(tmp_);
274 }
275
276 return r;
277 }
278 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
279 #if defined(__clang__) && !SIMDE_DETECT_CLANG_VERSION_CHECK(10,0,0)
280 #define simde_vld4_lane_f32(ptr, src, lane) \
281 SIMDE_DISABLE_DIAGNOSTIC_EXPR_(SIMDE_DIAGNOSTIC_DISABLE_VECTOR_CONVERSION_, vld4_lane_f32(ptr, src, lane))
282 #else
283 #define simde_vld4_lane_f32(ptr, src, lane) vld4_lane_f32(ptr, src, lane)
284 #endif
285 #endif
286 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
287 #undef vld4_lane_f32
288 #define vld4_lane_f32(ptr, src, lane) simde_vld4_lane_f32((ptr), (src), (lane))
289 #endif
290
291 SIMDE_FUNCTION_ATTRIBUTES
292 simde_float64x1x4_t
293 simde_vld4_lane_f64(simde_float64_t const ptr[HEDLEY_ARRAY_PARAM(4)], simde_float64x1x4_t src, const int lane)
294 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 0) {
295 simde_float64x1x4_t r;
296
297 for (size_t i = 0 ; i < 4 ; i++) {
298 simde_float64x1_private tmp_ = simde_float64x1_to_private(src.val[i]);
299 tmp_.values[lane] = ptr[i];
300 r.val[i] = simde_float64x1_from_private(tmp_);
301 }
302
303 return r;
304 }
305 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
306 #if defined(__clang__) && !SIMDE_DETECT_CLANG_VERSION_CHECK(10,0,0)
307 #define simde_vld4_lane_f64(ptr, src, lane) \
308 SIMDE_DISABLE_DIAGNOSTIC_EXPR_(SIMDE_DIAGNOSTIC_DISABLE_VECTOR_CONVERSION_, vld4_lane_f64(ptr, src, lane))
309 #else
310 #define simde_vld4_lane_f64(ptr, src, lane) vld4_lane_f64(ptr, src, lane)
311 #endif
312 #endif
313 #if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
314 #undef vld4_lane_f64
315 #define vld4_lane_f64(ptr, src, lane) simde_vld4_lane_f64((ptr), (src), (lane))
316 #endif
317
318 SIMDE_FUNCTION_ATTRIBUTES
319 simde_int8x16x4_t
320 simde_vld4q_lane_s8(int8_t const ptr[HEDLEY_ARRAY_PARAM(4)], simde_int8x16x4_t src, const int lane)
321 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 15) {
322 simde_int8x16x4_t r;
323
324 for (size_t i = 0 ; i < 4 ; i++) {
325 simde_int8x16_private tmp_ = simde_int8x16_to_private(src.val[i]);
326 tmp_.values[lane] = ptr[i];
327 r.val[i] = simde_int8x16_from_private(tmp_);
328 }
329
330 return r;
331 }
332 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
333 #if defined(__clang__) && !SIMDE_DETECT_CLANG_VERSION_CHECK(10,0,0)
334 #define simde_vld4q_lane_s8(ptr, src, lane) \
335 SIMDE_DISABLE_DIAGNOSTIC_EXPR_(SIMDE_DIAGNOSTIC_DISABLE_VECTOR_CONVERSION_, vld4q_lane_s8(ptr, src, lane))
336 #else
337 #define simde_vld4q_lane_s8(ptr, src, lane) vld4q_lane_s8(ptr, src, lane)
338 #endif
339 #endif
340 #if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
341 #undef vld4q_lane_s8
342 #define vld4q_lane_s8(ptr, src, lane) simde_vld4q_lane_s8((ptr), (src), (lane))
343 #endif
344
345 SIMDE_FUNCTION_ATTRIBUTES
346 simde_int16x8x4_t
347 simde_vld4q_lane_s16(int16_t const ptr[HEDLEY_ARRAY_PARAM(4)], simde_int16x8x4_t src, const int lane)
348 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 7) {
349 simde_int16x8x4_t r;
350
351 for (size_t i = 0 ; i < 4 ; i++) {
352 simde_int16x8_private tmp_ = simde_int16x8_to_private(src.val[i]);
353 tmp_.values[lane] = ptr[i];
354 r.val[i] = simde_int16x8_from_private(tmp_);
355 }
356
357 return r;
358 }
359 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
360 #if defined(__clang__) && !SIMDE_DETECT_CLANG_VERSION_CHECK(10,0,0)
361 #define simde_vld4q_lane_s16(ptr, src, lane) \
362 SIMDE_DISABLE_DIAGNOSTIC_EXPR_(SIMDE_DIAGNOSTIC_DISABLE_VECTOR_CONVERSION_, vld4q_lane_s16(ptr, src, lane))
363 #else
364 #define simde_vld4q_lane_s16(ptr, src, lane) vld4q_lane_s16(ptr, src, lane)
365 #endif
366 #endif
367 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
368 #undef vld4q_lane_s16
369 #define vld4q_lane_s16(ptr, src, lane) simde_vld4q_lane_s16((ptr), (src), (lane))
370 #endif
371
372 SIMDE_FUNCTION_ATTRIBUTES
373 simde_int32x4x4_t
374 simde_vld4q_lane_s32(int32_t const ptr[HEDLEY_ARRAY_PARAM(4)], simde_int32x4x4_t src, const int lane)
375 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 3) {
376 simde_int32x4x4_t r;
377
378 for (size_t i = 0 ; i < 4 ; i++) {
379 simde_int32x4_private tmp_ = simde_int32x4_to_private(src.val[i]);
380 tmp_.values[lane] = ptr[i];
381 r.val[i] = simde_int32x4_from_private(tmp_);
382 }
383
384 return r;
385 }
386 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
387 #if defined(__clang__) && !SIMDE_DETECT_CLANG_VERSION_CHECK(10,0,0)
388 #define simde_vld4q_lane_s32(ptr, src, lane) \
389 SIMDE_DISABLE_DIAGNOSTIC_EXPR_(SIMDE_DIAGNOSTIC_DISABLE_VECTOR_CONVERSION_, vld4q_lane_s32(ptr, src, lane))
390 #else
391 #define simde_vld4q_lane_s32(ptr, src, lane) vld4q_lane_s32(ptr, src, lane)
392 #endif
393 #endif
394 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
395 #undef vld4q_lane_s32
396 #define vld4q_lane_s32(ptr, src, lane) simde_vld4q_lane_s32((ptr), (src), (lane))
397 #endif
398
399 SIMDE_FUNCTION_ATTRIBUTES
400 simde_int64x2x4_t
401 simde_vld4q_lane_s64(int64_t const ptr[HEDLEY_ARRAY_PARAM(4)], simde_int64x2x4_t src, const int lane)
402 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 1) {
403 simde_int64x2x4_t r;
404
405 for (size_t i = 0 ; i < 4 ; i++) {
406 simde_int64x2_private tmp_ = simde_int64x2_to_private(src.val[i]);
407 tmp_.values[lane] = ptr[i];
408 r.val[i] = simde_int64x2_from_private(tmp_);
409 }
410
411 return r;
412 }
413 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
414 #if defined(__clang__) && !SIMDE_DETECT_CLANG_VERSION_CHECK(10,0,0)
415 #define simde_vld4q_lane_s64(ptr, src, lane) \
416 SIMDE_DISABLE_DIAGNOSTIC_EXPR_(SIMDE_DIAGNOSTIC_DISABLE_VECTOR_CONVERSION_, vld4q_lane_s64(ptr, src, lane))
417 #else
418 #define simde_vld4q_lane_s64(ptr, src, lane) vld4q_lane_s64(ptr, src, lane)
419 #endif
420 #endif
421 #if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
422 #undef vld4q_lane_s64
423 #define vld4q_lane_s64(ptr, src, lane) simde_vld4q_lane_s64((ptr), (src), (lane))
424 #endif
425
426 SIMDE_FUNCTION_ATTRIBUTES
427 simde_uint8x16x4_t
428 simde_vld4q_lane_u8(uint8_t const ptr[HEDLEY_ARRAY_PARAM(4)], simde_uint8x16x4_t src, const int lane)
429 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 15) {
430 simde_uint8x16x4_t r;
431
432 for (size_t i = 0 ; i < 4 ; i++) {
433 simde_uint8x16_private tmp_ = simde_uint8x16_to_private(src.val[i]);
434 tmp_.values[lane] = ptr[i];
435 r.val[i] = simde_uint8x16_from_private(tmp_);
436 }
437
438 return r;
439 }
440 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
441 #if defined(__clang__) && !SIMDE_DETECT_CLANG_VERSION_CHECK(10,0,0)
442 #define simde_vld4q_lane_u8(ptr, src, lane) \
443 SIMDE_DISABLE_DIAGNOSTIC_EXPR_(SIMDE_DIAGNOSTIC_DISABLE_VECTOR_CONVERSION_, vld4q_lane_u8(ptr, src, lane))
444 #else
445 #define simde_vld4q_lane_u8(ptr, src, lane) vld4q_lane_u8(ptr, src, lane)
446 #endif
447 #endif
448 #if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
449 #undef vld4q_lane_u8
450 #define vld4q_lane_u8(ptr, src, lane) simde_vld4q_lane_u8((ptr), (src), (lane))
451 #endif
452
453 SIMDE_FUNCTION_ATTRIBUTES
454 simde_uint16x8x4_t
455 simde_vld4q_lane_u16(uint16_t const ptr[HEDLEY_ARRAY_PARAM(4)], simde_uint16x8x4_t src, const int lane)
456 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 7) {
457 simde_uint16x8x4_t r;
458
459 for (size_t i = 0 ; i < 4 ; i++) {
460 simde_uint16x8_private tmp_ = simde_uint16x8_to_private(src.val[i]);
461 tmp_.values[lane] = ptr[i];
462 r.val[i] = simde_uint16x8_from_private(tmp_);
463 }
464
465 return r;
466 }
467 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
468 #if defined(__clang__) && !SIMDE_DETECT_CLANG_VERSION_CHECK(10,0,0)
469 #define simde_vld4q_lane_u16(ptr, src, lane) \
470 SIMDE_DISABLE_DIAGNOSTIC_EXPR_(SIMDE_DIAGNOSTIC_DISABLE_VECTOR_CONVERSION_, vld4q_lane_u16(ptr, src, lane))
471 #else
472 #define simde_vld4q_lane_u16(ptr, src, lane) vld4q_lane_u16(ptr, src, lane)
473 #endif
474 #endif
475 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
476 #undef vld4q_lane_u16
477 #define vld4q_lane_u16(ptr, src, lane) simde_vld4q_lane_u16((ptr), (src), (lane))
478 #endif
479
480 SIMDE_FUNCTION_ATTRIBUTES
481 simde_uint32x4x4_t
482 simde_vld4q_lane_u32(uint32_t const ptr[HEDLEY_ARRAY_PARAM(4)], simde_uint32x4x4_t src, const int lane)
483 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 3) {
484 simde_uint32x4x4_t r;
485
486 for (size_t i = 0 ; i < 4 ; i++) {
487 simde_uint32x4_private tmp_ = simde_uint32x4_to_private(src.val[i]);
488 tmp_.values[lane] = ptr[i];
489 r.val[i] = simde_uint32x4_from_private(tmp_);
490 }
491
492 return r;
493 }
494 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
495 #if defined(__clang__) && !SIMDE_DETECT_CLANG_VERSION_CHECK(10,0,0)
496 #define simde_vld4q_lane_u32(ptr, src, lane) \
497 SIMDE_DISABLE_DIAGNOSTIC_EXPR_(SIMDE_DIAGNOSTIC_DISABLE_VECTOR_CONVERSION_, vld4q_lane_u32(ptr, src, lane))
498 #else
499 #define simde_vld4q_lane_u32(ptr, src, lane) vld4q_lane_u32(ptr, src, lane)
500 #endif
501 #endif
502 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
503 #undef vld4q_lane_u32
504 #define vld4q_lane_u32(ptr, src, lane) simde_vld4q_lane_u32((ptr), (src), (lane))
505 #endif
506
507 SIMDE_FUNCTION_ATTRIBUTES
508 simde_uint64x2x4_t
509 simde_vld4q_lane_u64(uint64_t const ptr[HEDLEY_ARRAY_PARAM(4)], simde_uint64x2x4_t src, const int lane)
510 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 1) {
511 simde_uint64x2x4_t r;
512
513 for (size_t i = 0 ; i < 4 ; i++) {
514 simde_uint64x2_private tmp_ = simde_uint64x2_to_private(src.val[i]);
515 tmp_.values[lane] = ptr[i];
516 r.val[i] = simde_uint64x2_from_private(tmp_);
517 }
518
519 return r;
520 }
521 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
522 #if defined(__clang__) && !SIMDE_DETECT_CLANG_VERSION_CHECK(10,0,0)
523 #define simde_vld4q_lane_u64(ptr, src, lane) \
524 SIMDE_DISABLE_DIAGNOSTIC_EXPR_(SIMDE_DIAGNOSTIC_DISABLE_VECTOR_CONVERSION_, vld4q_lane_u64(ptr, src, lane))
525 #else
526 #define simde_vld4q_lane_u64(ptr, src, lane) vld4q_lane_u64(ptr, src, lane)
527 #endif
528 #endif
529 #if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
530 #undef vld4q_lane_u64
531 #define vld4q_lane_u64(ptr, src, lane) simde_vld4q_lane_u64((ptr), (src), (lane))
532 #endif
533
534 SIMDE_FUNCTION_ATTRIBUTES
535 simde_float32x4x4_t
536 simde_vld4q_lane_f32(simde_float32_t const ptr[HEDLEY_ARRAY_PARAM(4)], simde_float32x4x4_t src, const int lane)
537 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 3) {
538 simde_float32x4x4_t r;
539
540 for (size_t i = 0 ; i < 4 ; i++) {
541 simde_float32x4_private tmp_ = simde_float32x4_to_private(src.val[i]);
542 tmp_.values[lane] = ptr[i];
543 r.val[i] = simde_float32x4_from_private(tmp_);
544 }
545
546 return r;
547 }
548 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
549 #if defined(__clang__) && !SIMDE_DETECT_CLANG_VERSION_CHECK(10,0,0)
550 #define simde_vld4q_lane_f32(ptr, src, lane) \
551 SIMDE_DISABLE_DIAGNOSTIC_EXPR_(SIMDE_DIAGNOSTIC_DISABLE_VECTOR_CONVERSION_, vld4q_lane_f32(ptr, src, lane))
552 #else
553 #define simde_vld4q_lane_f32(ptr, src, lane) vld4q_lane_f32(ptr, src, lane)
554 #endif
555 #endif
556 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
557 #undef vld4q_lane_f32
558 #define vld4q_lane_f32(ptr, src, lane) simde_vld4q_lane_f32((ptr), (src), (lane))
559 #endif
560
561 SIMDE_FUNCTION_ATTRIBUTES
562 simde_float64x2x4_t
563 simde_vld4q_lane_f64(simde_float64_t const ptr[HEDLEY_ARRAY_PARAM(4)], simde_float64x2x4_t src, const int lane)
564 SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 1) {
565 simde_float64x2x4_t r;
566
567 for (size_t i = 0 ; i < 4 ; i++) {
568 simde_float64x2_private tmp_ = simde_float64x2_to_private(src.val[i]);
569 tmp_.values[lane] = ptr[i];
570 r.val[i] = simde_float64x2_from_private(tmp_);
571 }
572
573 return r;
574 }
575 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
576 #if defined(__clang__) && !SIMDE_DETECT_CLANG_VERSION_CHECK(10,0,0)
577 #define simde_vld4q_lane_f64(ptr, src, lane) \
578 SIMDE_DISABLE_DIAGNOSTIC_EXPR_(SIMDE_DIAGNOSTIC_DISABLE_VECTOR_CONVERSION_, vld4q_lane_f64(ptr, src, lane))
579 #else
580 #define simde_vld4q_lane_f64(ptr, src, lane) vld4q_lane_f64(ptr, src, lane)
581 #endif
582 #endif
583 #if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
584 #undef vld4q_lane_f64
585 #define vld4q_lane_f64(ptr, src, lane) simde_vld4q_lane_f64((ptr), (src), (lane))
586 #endif
587
588 #endif /* !defined(SIMDE_BUG_INTEL_857088) */
589
590 SIMDE_END_DECLS_
591 HEDLEY_DIAGNOSTIC_POP
592
593 #endif /* !defined(SIMDE_ARM_NEON_LD4_LANE_H) */