Debian Codegraph @

third-party/simde/arm/neon/clt.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 Christopher Moore <[email protected]>
26 */
27
28 #if !defined(SIMDE_ARM_NEON_CLT_H)
29 #define SIMDE_ARM_NEON_CLT_H
30
31 #include "combine.h"
32 #include "get_low.h"
33
34 HEDLEY_DIAGNOSTIC_PUSH
35 SIMDE_DISABLE_UNWANTED_DIAGNOSTICS
36 SIMDE_BEGIN_DECLS_
37
38 SIMDE_FUNCTION_ATTRIBUTES
39 uint64_t
40 simde_vcltd_f64(simde_float64_t a, simde_float64_t b) {
41 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
42 return HEDLEY_STATIC_CAST(uint64_t, vcltd_f64(a, b));
43 #else
44 return (a < b) ? UINT64_MAX : 0;
45 #endif
46 }
47 #if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
48 #undef vcltd_f64
49 #define vcltd_f64(a, b) simde_vcltd_f64((a), (b))
50 #endif
51
52 SIMDE_FUNCTION_ATTRIBUTES
53 uint64_t
54 simde_vcltd_s64(int64_t a, int64_t b) {
55 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
56 return HEDLEY_STATIC_CAST(uint64_t, vcltd_s64(a, b));
57 #else
58 return (a < b) ? UINT64_MAX : 0;
59 #endif
60 }
61 #if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
62 #undef vcltd_s64
63 #define vcltd_s64(a, b) simde_vcltd_s64((a), (b))
64 #endif
65
66 SIMDE_FUNCTION_ATTRIBUTES
67 uint64_t
68 simde_vcltd_u64(uint64_t a, uint64_t b) {
69 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
70 return HEDLEY_STATIC_CAST(uint64_t, vcltd_u64(a, b));
71 #else
72 return (a < b) ? UINT64_MAX : 0;
73 #endif
74 }
75 #if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
76 #undef vcltd_u64
77 #define vcltd_u64(a, b) simde_vcltd_u64((a), (b))
78 #endif
79
80 SIMDE_FUNCTION_ATTRIBUTES
81 uint32_t
82 simde_vclts_f32(simde_float32_t a, simde_float32_t b) {
83 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
84 return HEDLEY_STATIC_CAST(uint32_t, vclts_f32(a, b));
85 #else
86 return (a < b) ? UINT32_MAX : 0;
87 #endif
88 }
89 #if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
90 #undef vclts_f32
91 #define vclts_f32(a, b) simde_vclts_f32((a), (b))
92 #endif
93
94 SIMDE_FUNCTION_ATTRIBUTES
95 simde_uint32x4_t
96 simde_vcltq_f32(simde_float32x4_t a, simde_float32x4_t b) {
97 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
98 return vcltq_f32(a, b);
99 #elif defined(SIMDE_POWER_ALTIVEC_P6_NATIVE)
100 return HEDLEY_REINTERPRET_CAST(SIMDE_POWER_ALTIVEC_VECTOR(unsigned int), vec_cmplt(a, b));
101 #else
102 simde_float32x4_private
103 a_ = simde_float32x4_to_private(a),
104 b_ = simde_float32x4_to_private(b);
105 simde_uint32x4_private r_;
106
107 #if defined(SIMDE_X86_SSE2_NATIVE)
108 r_.m128i = _mm_castps_si128(_mm_cmplt_ps(a_.m128, b_.m128));
109 #elif defined(SIMDE_WASM_SIMD128_NATIVE)
110 r_.v128 = wasm_f32x4_lt(a_.v128, b_.v128);
111 #elif defined(SIMDE_VECTOR_SUBSCRIPT_OPS)
112 r_.values = HEDLEY_REINTERPRET_CAST(__typeof__(r_.values), a_.values < b_.values);
113 #else
114 SIMDE_VECTORIZE
115 for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
116 r_.values[i] = simde_vclts_f32(a_.values[i], b_.values[i]);
117 }
118 #endif
119
120 return simde_uint32x4_from_private(r_);
121 #endif
122 }
123 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
124 #undef vcltq_f32
125 #define vcltq_f32(a, b) simde_vcltq_f32((a), (b))
126 #endif
127
128 SIMDE_FUNCTION_ATTRIBUTES
129 simde_uint64x2_t
130 simde_vcltq_f64(simde_float64x2_t a, simde_float64x2_t b) {
131 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
132 return vcltq_f64(a, b);
133 #elif defined(SIMDE_POWER_ALTIVEC_P7_NATIVE)
134 return HEDLEY_REINTERPRET_CAST(SIMDE_POWER_ALTIVEC_VECTOR(unsigned long long), vec_cmplt(a, b));
135 #else
136 simde_float64x2_private
137 a_ = simde_float64x2_to_private(a),
138 b_ = simde_float64x2_to_private(b);
139 simde_uint64x2_private r_;
140
141 #if defined(SIMDE_X86_SSE2_NATIVE)
142 r_.m128i = _mm_castpd_si128(_mm_cmplt_pd(a_.m128d, b_.m128d));
143 #elif defined(SIMDE_WASM_SIMD128_NATIVE)
144 r_.v128 = wasm_f64x2_lt(a_.v128, b_.v128);
145 #elif defined(SIMDE_VECTOR_SUBSCRIPT_OPS)
146 r_.values = HEDLEY_REINTERPRET_CAST(__typeof__(r_.values), a_.values < b_.values);
147 #else
148 SIMDE_VECTORIZE
149 for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
150 r_.values[i] = simde_vcltd_f64(a_.values[i], b_.values[i]);
151 }
152 #endif
153
154 return simde_uint64x2_from_private(r_);
155 #endif
156 }
157 #if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
158 #undef vcltq_f64
159 #define vcltq_f64(a, b) simde_vcltq_f64((a), (b))
160 #endif
161
162 SIMDE_FUNCTION_ATTRIBUTES
163 simde_uint8x16_t
164 simde_vcltq_s8(simde_int8x16_t a, simde_int8x16_t b) {
165 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
166 return vcltq_s8(a, b);
167 #elif defined(SIMDE_POWER_ALTIVEC_P6_NATIVE)
168 return HEDLEY_REINTERPRET_CAST(SIMDE_POWER_ALTIVEC_VECTOR(unsigned char), vec_cmplt(a, b));
169 #else
170 simde_int8x16_private
171 a_ = simde_int8x16_to_private(a),
172 b_ = simde_int8x16_to_private(b);
173 simde_uint8x16_private r_;
174
175 #if defined(SIMDE_X86_SSE2_NATIVE)
176 r_.m128i = _mm_cmplt_epi8(a_.m128i, b_.m128i);
177 #elif defined(SIMDE_WASM_SIMD128_NATIVE)
178 r_.v128 = wasm_i8x16_lt(a_.v128, b_.v128);
179 #elif defined(SIMDE_VECTOR_SUBSCRIPT_OPS)
180 r_.values = HEDLEY_REINTERPRET_CAST(__typeof__(r_.values), a_.values < b_.values);
181 #else
182 SIMDE_VECTORIZE
183 for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
184 r_.values[i] = (a_.values[i] < b_.values[i]) ? UINT8_MAX : 0;
185 }
186 #endif
187
188 return simde_uint8x16_from_private(r_);
189 #endif
190 }
191 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
192 #undef vcltq_s8
193 #define vcltq_s8(a, b) simde_vcltq_s8((a), (b))
194 #endif
195
196 SIMDE_FUNCTION_ATTRIBUTES
197 simde_uint16x8_t
198 simde_vcltq_s16(simde_int16x8_t a, simde_int16x8_t b) {
199 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
200 return vcltq_s16(a, b);
201 #elif defined(SIMDE_POWER_ALTIVEC_P6_NATIVE)
202 return HEDLEY_REINTERPRET_CAST(SIMDE_POWER_ALTIVEC_VECTOR(unsigned short), vec_cmplt(a, b));
203 #else
204 simde_int16x8_private
205 a_ = simde_int16x8_to_private(a),
206 b_ = simde_int16x8_to_private(b);
207 simde_uint16x8_private r_;
208
209 #if defined(SIMDE_X86_SSE2_NATIVE)
210 r_.m128i = _mm_cmplt_epi16(a_.m128i, b_.m128i);
211 #elif defined(SIMDE_WASM_SIMD128_NATIVE)
212 r_.v128 = wasm_i16x8_lt(a_.v128, b_.v128);
213 #elif defined(SIMDE_VECTOR_SUBSCRIPT_OPS)
214 r_.values = HEDLEY_REINTERPRET_CAST(__typeof__(r_.values), a_.values < b_.values);
215 #else
216 SIMDE_VECTORIZE
217 for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
218 r_.values[i] = (a_.values[i] < b_.values[i]) ? UINT16_MAX : 0;
219 }
220 #endif
221
222 return simde_uint16x8_from_private(r_);
223 #endif
224 }
225 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
226 #undef vcltq_s16
227 #define vcltq_s16(a, b) simde_vcltq_s16((a), (b))
228 #endif
229
230 SIMDE_FUNCTION_ATTRIBUTES
231 simde_uint32x4_t
232 simde_vcltq_s32(simde_int32x4_t a, simde_int32x4_t b) {
233 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
234 return vcltq_s32(a, b);
235 #elif defined(SIMDE_POWER_ALTIVEC_P6_NATIVE)
236 return HEDLEY_REINTERPRET_CAST(SIMDE_POWER_ALTIVEC_VECTOR(unsigned int), vec_cmplt(a, b));
237 #else
238 simde_int32x4_private
239 a_ = simde_int32x4_to_private(a),
240 b_ = simde_int32x4_to_private(b);
241 simde_uint32x4_private r_;
242
243 #if defined(SIMDE_X86_SSE2_NATIVE)
244 r_.m128i = _mm_cmplt_epi32(a_.m128i, b_.m128i);
245 #elif defined(SIMDE_WASM_SIMD128_NATIVE)
246 r_.v128 = wasm_i32x4_lt(a_.v128, b_.v128);
247 #elif defined(SIMDE_VECTOR_SUBSCRIPT_OPS)
248 r_.values = HEDLEY_REINTERPRET_CAST(__typeof__(r_.values), a_.values < b_.values);
249 #else
250 SIMDE_VECTORIZE
251 for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
252 r_.values[i] = (a_.values[i] < b_.values[i]) ? UINT32_MAX : 0;
253 }
254 #endif
255
256 return simde_uint32x4_from_private(r_);
257 #endif
258 }
259 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
260 #undef vcltq_s32
261 #define vcltq_s32(a, b) simde_vcltq_s32((a), (b))
262 #endif
263
264 SIMDE_FUNCTION_ATTRIBUTES
265 simde_uint64x2_t
266 simde_vcltq_s64(simde_int64x2_t a, simde_int64x2_t b) {
267 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
268 return vcltq_s64(a, b);
269 #elif defined(SIMDE_ARM_NEON_A32V7_NATIVE)
270 return vreinterpretq_u64_s64(vshrq_n_s64(vqsubq_s64(a, b), 63));
271 #elif defined(SIMDE_POWER_ALTIVEC_P8_NATIVE)
272 return HEDLEY_REINTERPRET_CAST(SIMDE_POWER_ALTIVEC_VECTOR(unsigned long long), vec_cmplt(a, b));
273 #else
274 simde_int64x2_private
275 a_ = simde_int64x2_to_private(a),
276 b_ = simde_int64x2_to_private(b);
277 simde_uint64x2_private r_;
278
279 #if defined(SIMDE_X86_SSE4_2_NATIVE)
280 r_.m128i = _mm_cmpgt_epi64(b_.m128i, a_.m128i);
281 #elif defined(SIMDE_VECTOR_SUBSCRIPT_OPS)
282 r_.values = HEDLEY_REINTERPRET_CAST(__typeof__(r_.values), a_.values < b_.values);
283 #else
284 SIMDE_VECTORIZE
285 for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
286 r_.values[i] = simde_vcltd_s64(a_.values[i], b_.values[i]);
287 }
288 #endif
289
290 return simde_uint64x2_from_private(r_);
291 #endif
292 }
293 #if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
294 #undef vcltq_s64
295 #define vcltq_s64(a, b) simde_vcltq_s64((a), (b))
296 #endif
297
298 SIMDE_FUNCTION_ATTRIBUTES
299 simde_uint8x16_t
300 simde_vcltq_u8(simde_uint8x16_t a, simde_uint8x16_t b) {
301 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
302 return vcltq_u8(a, b);
303 #elif defined(SIMDE_POWER_ALTIVEC_P6_NATIVE)
304 return HEDLEY_REINTERPRET_CAST(SIMDE_POWER_ALTIVEC_VECTOR(unsigned char), vec_cmplt(a, b));
305 #else
306 simde_uint8x16_private
307 r_,
308 a_ = simde_uint8x16_to_private(a),
309 b_ = simde_uint8x16_to_private(b);
310
311 #if defined(SIMDE_X86_SSE2_NATIVE)
312 r_.m128i = _mm_andnot_si128(
313 _mm_cmpeq_epi8(b_.m128i, a_.m128i),
314 _mm_cmpeq_epi8(_mm_max_epu8(b_.m128i, a_.m128i), b_.m128i)
315 );
316 #elif defined(SIMDE_WASM_SIMD128_NATIVE)
317 r_.v128 = wasm_u8x16_lt(a_.v128, b_.v128);
318 #elif defined(SIMDE_VECTOR_SUBSCRIPT_OPS)
319 r_.values = HEDLEY_REINTERPRET_CAST(__typeof__(r_.values), a_.values < b_.values);
320 #else
321 SIMDE_VECTORIZE
322 for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
323 r_.values[i] = (a_.values[i] < b_.values[i]) ? UINT8_MAX : 0;
324 }
325 #endif
326
327 return simde_uint8x16_from_private(r_);
328 #endif
329 }
330 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
331 #undef vcltq_u8
332 #define vcltq_u8(a, b) simde_vcltq_u8((a), (b))
333 #endif
334
335 SIMDE_FUNCTION_ATTRIBUTES
336 simde_uint16x8_t
337 simde_vcltq_u16(simde_uint16x8_t a, simde_uint16x8_t b) {
338 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
339 return vcltq_u16(a, b);
340 #elif defined(SIMDE_POWER_ALTIVEC_P6_NATIVE)
341 return HEDLEY_REINTERPRET_CAST(SIMDE_POWER_ALTIVEC_VECTOR(unsigned short), vec_cmplt(a, b));
342 #else
343 simde_uint16x8_private
344 r_,
345 a_ = simde_uint16x8_to_private(a),
346 b_ = simde_uint16x8_to_private(b);
347
348 #if defined(SIMDE_X86_SSE4_1_NATIVE)
349 r_.m128i = _mm_andnot_si128(
350 _mm_cmpeq_epi16(b_.m128i, a_.m128i),
351 _mm_cmpeq_epi16(_mm_max_epu16(b_.m128i, a_.m128i), b_.m128i)
352 );
353 #elif defined(SIMDE_X86_SSE2_NATIVE)
354 __m128i sign_bits = _mm_set1_epi16(INT16_MIN);
355 r_.m128i = _mm_cmplt_epi16(_mm_xor_si128(a_.m128i, sign_bits), _mm_xor_si128(b_.m128i, sign_bits));
356 #elif defined(SIMDE_WASM_SIMD128_NATIVE)
357 r_.v128 = wasm_u16x8_lt(a_.v128, b_.v128);
358 #elif defined(SIMDE_VECTOR_SUBSCRIPT_OPS)
359 r_.values = HEDLEY_REINTERPRET_CAST(__typeof__(r_.values), a_.values < b_.values);
360 #else
361 SIMDE_VECTORIZE
362 for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
363 r_.values[i] = (a_.values[i] < b_.values[i]) ? UINT16_MAX : 0;
364 }
365 #endif
366
367 return simde_uint16x8_from_private(r_);
368 #endif
369 }
370 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
371 #undef vcltq_u16
372 #define vcltq_u16(a, b) simde_vcltq_u16((a), (b))
373 #endif
374
375 SIMDE_FUNCTION_ATTRIBUTES
376 simde_uint32x4_t
377 simde_vcltq_u32(simde_uint32x4_t a, simde_uint32x4_t b) {
378 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
379 return vcltq_u32(a, b);
380 #elif defined(SIMDE_POWER_ALTIVEC_P6_NATIVE)
381 return HEDLEY_REINTERPRET_CAST(SIMDE_POWER_ALTIVEC_VECTOR(unsigned int), vec_cmplt(a, b));
382 #else
383 simde_uint32x4_private
384 r_,
385 a_ = simde_uint32x4_to_private(a),
386 b_ = simde_uint32x4_to_private(b);
387
388 #if defined(SIMDE_X86_SSE4_1_NATIVE)
389 r_.m128i = _mm_andnot_si128(
390 _mm_cmpeq_epi32(b_.m128i, a_.m128i),
391 _mm_cmpeq_epi32(_mm_max_epu32(b_.m128i, a_.m128i), b_.m128i)
392 );
393 #elif defined(SIMDE_X86_SSE2_NATIVE)
394 __m128i sign_bits = _mm_set1_epi32(INT32_MIN);
395 r_.m128i = _mm_cmplt_epi32(_mm_xor_si128(a_.m128i, sign_bits), _mm_xor_si128(b_.m128i, sign_bits));
396 #elif defined(SIMDE_WASM_SIMD128_NATIVE)
397 r_.v128 = wasm_u32x4_lt(a_.v128, b_.v128);
398 #elif defined(SIMDE_VECTOR_SUBSCRIPT_OPS)
399 r_.values = HEDLEY_REINTERPRET_CAST(__typeof__(r_.values), a_.values < b_.values);
400 #else
401 SIMDE_VECTORIZE
402 for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
403 r_.values[i] = (a_.values[i] < b_.values[i]) ? UINT32_MAX : 0;
404 }
405 #endif
406
407 return simde_uint32x4_from_private(r_);
408 #endif
409 }
410 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
411 #undef vcltq_u32
412 #define vcltq_u32(a, b) simde_vcltq_u32((a), (b))
413 #endif
414
415 SIMDE_FUNCTION_ATTRIBUTES
416 simde_uint64x2_t
417 simde_vcltq_u64(simde_uint64x2_t a, simde_uint64x2_t b) {
418 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
419 return vcltq_u64(a, b);
420 #elif defined(SIMDE_POWER_ALTIVEC_P8_NATIVE)
421 return HEDLEY_REINTERPRET_CAST(SIMDE_POWER_ALTIVEC_VECTOR(unsigned long long), vec_cmplt(a, b));
422 #else
423 simde_uint64x2_private
424 r_,
425 a_ = simde_uint64x2_to_private(a),
426 b_ = simde_uint64x2_to_private(b);
427
428 #if defined(SIMDE_X86_AVX512VL_NATIVE)
429 r_.m128i = _mm_andnot_si128(
430 _mm_cmpeq_epi64(b_.m128i, a_.m128i),
431 _mm_cmpeq_epi64(_mm_max_epu64(b_.m128i, a_.m128i), b_.m128i)
432 );
433 #elif defined(SIMDE_X86_SSE4_2_NATIVE)
434 __m128i sign_bits = _mm_set1_epi64x(INT64_MIN);
435 r_.m128i = _mm_cmpgt_epi64(_mm_xor_si128(b_.m128i, sign_bits), _mm_xor_si128(a_.m128i, sign_bits));
436 #elif defined(SIMDE_VECTOR_SUBSCRIPT_OPS)
437 r_.values = HEDLEY_REINTERPRET_CAST(__typeof__(r_.values), a_.values < b_.values);
438 #else
439 SIMDE_VECTORIZE
440 for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
441 r_.values[i] = simde_vcltd_u64(a_.values[i], b_.values[i]);
442 }
443 #endif
444
445 return simde_uint64x2_from_private(r_);
446 #endif
447 }
448 #if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
449 #undef vcltq_u64
450 #define vcltq_u64(a, b) simde_vcltq_u64((a), (b))
451 #endif
452
453 SIMDE_FUNCTION_ATTRIBUTES
454 simde_uint32x2_t
455 simde_vclt_f32(simde_float32x2_t a, simde_float32x2_t b) {
456 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
457 return vclt_f32(a, b);
458 #else
459 simde_float32x2_private
460 a_ = simde_float32x2_to_private(a),
461 b_ = simde_float32x2_to_private(b);
462 simde_uint32x2_private r_;
463
464 #if defined(SIMDE_VECTOR_SUBSCRIPT_OPS) && !defined(SIMDE_BUG_GCC_100762)
465 r_.values = HEDLEY_REINTERPRET_CAST(__typeof__(r_.values), a_.values < b_.values);
466 #else
467 SIMDE_VECTORIZE
468 for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
469 r_.values[i] = simde_vclts_f32(a_.values[i], b_.values[i]);
470 }
471 #endif
472
473 return simde_uint32x2_from_private(r_);
474 #endif
475 }
476 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
477 #undef vclt_f32
478 #define vclt_f32(a, b) simde_vclt_f32((a), (b))
479 #endif
480
481 SIMDE_FUNCTION_ATTRIBUTES
482 simde_uint64x1_t
483 simde_vclt_f64(simde_float64x1_t a, simde_float64x1_t b) {
484 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
485 return vclt_f64(a, b);
486 #else
487 simde_float64x1_private
488 a_ = simde_float64x1_to_private(a),
489 b_ = simde_float64x1_to_private(b);
490 simde_uint64x1_private r_;
491
492 #if defined(SIMDE_VECTOR_SUBSCRIPT_OPS)
493 r_.values = HEDLEY_REINTERPRET_CAST(__typeof__(r_.values), a_.values < b_.values);
494 #else
495 SIMDE_VECTORIZE
496 for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
497 r_.values[i] = simde_vcltd_f64(a_.values[i], b_.values[i]);
498 }
499 #endif
500
501 return simde_uint64x1_from_private(r_);
502 #endif
503 }
504 #if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
505 #undef vclt_f64
506 #define vclt_f64(a, b) simde_vclt_f64((a), (b))
507 #endif
508
509 SIMDE_FUNCTION_ATTRIBUTES
510 simde_uint8x8_t
511 simde_vclt_s8(simde_int8x8_t a, simde_int8x8_t b) {
512 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
513 return vclt_s8(a, b);
514 #else
515 simde_int8x8_private
516 a_ = simde_int8x8_to_private(a),
517 b_ = simde_int8x8_to_private(b);
518 simde_uint8x8_private r_;
519
520 #if defined(SIMDE_X86_MMX_NATIVE)
521 r_.m64 = _mm_cmpgt_pi8(b_.m64, a_.m64);
522 #elif defined(SIMDE_VECTOR_SUBSCRIPT_OPS) && !defined(SIMDE_BUG_GCC_100762)
523 r_.values = HEDLEY_REINTERPRET_CAST(__typeof__(r_.values), a_.values < b_.values);
524 #else
525 SIMDE_VECTORIZE
526 for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
527 r_.values[i] = (a_.values[i] < b_.values[i]) ? UINT8_MAX : 0;
528 }
529 #endif
530
531 return simde_uint8x8_from_private(r_);
532 #endif
533 }
534 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
535 #undef vclt_s8
536 #define vclt_s8(a, b) simde_vclt_s8((a), (b))
537 #endif
538
539 SIMDE_FUNCTION_ATTRIBUTES
540 simde_uint16x4_t
541 simde_vclt_s16(simde_int16x4_t a, simde_int16x4_t b) {
542 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
543 return vclt_s16(a, b);
544 #else
545 simde_int16x4_private
546 a_ = simde_int16x4_to_private(a),
547 b_ = simde_int16x4_to_private(b);
548 simde_uint16x4_private r_;
549
550 #if defined(SIMDE_X86_MMX_NATIVE)
551 r_.m64 = _mm_cmpgt_pi16(b_.m64, a_.m64);
552 #elif defined(SIMDE_VECTOR_SUBSCRIPT_OPS) && !defined(SIMDE_BUG_GCC_100762)
553 r_.values = HEDLEY_REINTERPRET_CAST(__typeof__(r_.values), a_.values < b_.values);
554 #else
555 SIMDE_VECTORIZE
556 for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
557 r_.values[i] = (a_.values[i] < b_.values[i]) ? UINT16_MAX : 0;
558 }
559 #endif
560
561 return simde_uint16x4_from_private(r_);
562 #endif
563 }
564 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
565 #undef vclt_s16
566 #define vclt_s16(a, b) simde_vclt_s16((a), (b))
567 #endif
568
569 SIMDE_FUNCTION_ATTRIBUTES
570 simde_uint32x2_t
571 simde_vclt_s32(simde_int32x2_t a, simde_int32x2_t b) {
572 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
573 return vclt_s32(a, b);
574 #else
575 simde_int32x2_private
576 a_ = simde_int32x2_to_private(a),
577 b_ = simde_int32x2_to_private(b);
578 simde_uint32x2_private r_;
579
580 #if defined(SIMDE_X86_MMX_NATIVE)
581 r_.m64 = _mm_cmpgt_pi32(b_.m64, a_.m64);
582 #elif defined(SIMDE_VECTOR_SUBSCRIPT_OPS) && !defined(SIMDE_BUG_GCC_100762)
583 r_.values = HEDLEY_REINTERPRET_CAST(__typeof__(r_.values), a_.values < b_.values);
584 #else
585 SIMDE_VECTORIZE
586 for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
587 r_.values[i] = (a_.values[i] < b_.values[i]) ? UINT32_MAX : 0;
588 }
589 #endif
590
591 return simde_uint32x2_from_private(r_);
592 #endif
593 }
594 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
595 #undef vclt_s32
596 #define vclt_s32(a, b) simde_vclt_s32((a), (b))
597 #endif
598
599 SIMDE_FUNCTION_ATTRIBUTES
600 simde_uint64x1_t
601 simde_vclt_s64(simde_int64x1_t a, simde_int64x1_t b) {
602 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
603 return vclt_s64(a, b);
604 #else
605 simde_int64x1_private
606 a_ = simde_int64x1_to_private(a),
607 b_ = simde_int64x1_to_private(b);
608 simde_uint64x1_private r_;
609
610 #if defined(SIMDE_VECTOR_SUBSCRIPT_OPS)
611 r_.values = HEDLEY_REINTERPRET_CAST(__typeof__(r_.values), a_.values < b_.values);
612 #else
613 SIMDE_VECTORIZE
614 for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
615 r_.values[i] = simde_vcltd_s64(a_.values[i], b_.values[i]);
616 }
617 #endif
618
619 return simde_uint64x1_from_private(r_);
620 #endif
621 }
622 #if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
623 #undef vclt_s64
624 #define vclt_s64(a, b) simde_vclt_s64((a), (b))
625 #endif
626
627 SIMDE_FUNCTION_ATTRIBUTES
628 simde_uint8x8_t
629 simde_vclt_u8(simde_uint8x8_t a, simde_uint8x8_t b) {
630 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
631 return vclt_u8(a, b);
632 #else
633 simde_uint8x8_private
634 r_,
635 a_ = simde_uint8x8_to_private(a),
636 b_ = simde_uint8x8_to_private(b);
637
638 #if defined(SIMDE_X86_MMX_NATIVE)
639 __m64 sign_bits = _mm_set1_pi8(INT8_MIN);
640 r_.m64 = _mm_cmpgt_pi8(_mm_xor_si64(b_.m64, sign_bits), _mm_xor_si64(a_.m64, sign_bits));
641 #elif defined(SIMDE_VECTOR_SUBSCRIPT_OPS) && !defined(SIMDE_BUG_GCC_100762)
642 r_.values = HEDLEY_REINTERPRET_CAST(__typeof__(r_.values), a_.values < b_.values);
643 #else
644 SIMDE_VECTORIZE
645 for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
646 r_.values[i] = (a_.values[i] < b_.values[i]) ? UINT8_MAX : 0;
647 }
648 #endif
649
650 return simde_uint8x8_from_private(r_);
651 #endif
652 }
653 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
654 #undef vclt_u8
655 #define vclt_u8(a, b) simde_vclt_u8((a), (b))
656 #endif
657
658 SIMDE_FUNCTION_ATTRIBUTES
659 simde_uint16x4_t
660 simde_vclt_u16(simde_uint16x4_t a, simde_uint16x4_t b) {
661 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
662 return vclt_u16(a, b);
663 #else
664 simde_uint16x4_private
665 r_,
666 a_ = simde_uint16x4_to_private(a),
667 b_ = simde_uint16x4_to_private(b);
668
669 #if defined(SIMDE_X86_MMX_NATIVE)
670 __m64 sign_bits = _mm_set1_pi16(INT16_MIN);
671 r_.m64 = _mm_cmpgt_pi16(_mm_xor_si64(b_.m64, sign_bits), _mm_xor_si64(a_.m64, sign_bits));
672 #elif defined(SIMDE_VECTOR_SUBSCRIPT_OPS) && !defined(SIMDE_BUG_GCC_100762)
673 r_.values = HEDLEY_REINTERPRET_CAST(__typeof__(r_.values), a_.values < b_.values);
674 #else
675 SIMDE_VECTORIZE
676 for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
677 r_.values[i] = (a_.values[i] < b_.values[i]) ? UINT16_MAX : 0;
678 }
679 #endif
680
681 return simde_uint16x4_from_private(r_);
682 #endif
683 }
684 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
685 #undef vclt_u16
686 #define vclt_u16(a, b) simde_vclt_u16((a), (b))
687 #endif
688
689 SIMDE_FUNCTION_ATTRIBUTES
690 simde_uint32x2_t
691 simde_vclt_u32(simde_uint32x2_t a, simde_uint32x2_t b) {
692 #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
693 return vclt_u32(a, b);
694 #else
695 simde_uint32x2_private
696 r_,
697 a_ = simde_uint32x2_to_private(a),
698 b_ = simde_uint32x2_to_private(b);
699
700 #if defined(SIMDE_X86_MMX_NATIVE)
701 __m64 sign_bits = _mm_set1_pi32(INT32_MIN);
702 r_.m64 = _mm_cmpgt_pi32(_mm_xor_si64(b_.m64, sign_bits), _mm_xor_si64(a_.m64, sign_bits));
703 #elif defined(SIMDE_VECTOR_SUBSCRIPT_OPS) && !defined(SIMDE_BUG_GCC_100762)
704 r_.values = HEDLEY_REINTERPRET_CAST(__typeof__(r_.values), a_.values < b_.values);
705 #else
706 SIMDE_VECTORIZE
707 for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
708 r_.values[i] = (a_.values[i] < b_.values[i]) ? UINT32_MAX : 0;
709 }
710 #endif
711
712 return simde_uint32x2_from_private(r_);
713 #endif
714 }
715 #if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
716 #undef vclt_u32
717 #define vclt_u32(a, b) simde_vclt_u32((a), (b))
718 #endif
719
720 SIMDE_FUNCTION_ATTRIBUTES
721 simde_uint64x1_t
722 simde_vclt_u64(simde_uint64x1_t a, simde_uint64x1_t b) {
723 #if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
724 return vclt_u64(a, b);
725 #else
726 simde_uint64x1_private
727 r_,
728 a_ = simde_uint64x1_to_private(a),
729 b_ = simde_uint64x1_to_private(b);
730
731 #if defined(SIMDE_VECTOR_SUBSCRIPT_OPS)
732 r_.values = HEDLEY_REINTERPRET_CAST(__typeof__(r_.values), a_.values < b_.values);
733 #else
734 SIMDE_VECTORIZE
735 for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
736 r_.values[i] = simde_vcltd_u64(a_.values[i], b_.values[i]);
737 }
738 #endif
739
740 return simde_uint64x1_from_private(r_);
741 #endif
742 }
743 #if defined(SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES)
744 #undef vclt_u64
745 #define vclt_u64(a, b) simde_vclt_u64((a), (b))
746 #endif
747
748 SIMDE_END_DECLS_
749 HEDLEY_DIAGNOSTIC_POP
750
751 #endif /* !defined(SIMDE_ARM_NEON_CLT_H) */