Debian Codegraph @

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