Debian Codegraph @

gcc/testsuite/gcc.target/aarch64/simd/int_comparisons.x

raw
1 /* test_vcXXX wrappers for all the vcXXX (vector compare) and vtst intrinsics
2 in arm_neon.h (excluding the 64x1 variants as these generally produce scalar
3 not vector ops). */
4 #include "arm_neon.h"
5
6 #define DONT_FORCE(X)
7
8 #define FORCE_SIMD(V1) asm volatile ("mov %d0, %1.d[0]" \
9 : "=w"(V1) \
10 : "w"(V1) \
11 : /* No clobbers */);
12
13 #define OP1(SIZE, OP, BASETYPE, SUFFIX, FORCE) uint##SIZE##_t \
14 test_v##OP##SUFFIX (BASETYPE##SIZE##_t a) \
15 { \
16 uint##SIZE##_t res; \
17 FORCE (a); \
18 res = v##OP##SUFFIX (a); \
19 FORCE (res); \
20 return res; \
21 }
22
23 #define OP2(SIZE, OP, BASETYPE, SUFFIX, FORCE) uint##SIZE##_t \
24 test_v##OP##SUFFIX (BASETYPE##SIZE##_t a, BASETYPE##SIZE##_t b) \
25 { \
26 uint##SIZE##_t res; \
27 FORCE (a); \
28 FORCE (b); \
29 res = v##OP##SUFFIX (a, b); \
30 FORCE (res); \
31 return res; \
32 }
33
34 #define UNSIGNED_OPS(SIZE, BASETYPE, SUFFIX, FORCE) \
35 OP2 (SIZE, tst, BASETYPE, SUFFIX, FORCE) \
36 OP1 (SIZE, ceqz, BASETYPE, SUFFIX, FORCE) \
37 OP2 (SIZE, ceq, BASETYPE, SUFFIX, FORCE) \
38 OP2 (SIZE, cge, BASETYPE, SUFFIX, FORCE) \
39 OP2 (SIZE, cgt, BASETYPE, SUFFIX, FORCE) \
40 OP2 (SIZE, cle, BASETYPE, SUFFIX, FORCE) \
41 OP2 (SIZE, clt, BASETYPE, SUFFIX, FORCE)
42
43 #define ALL_OPS(SIZE, BASETYPE, SUFFIX, FORCE) \
44 OP1 (SIZE, cgez, BASETYPE, SUFFIX, FORCE) \
45 OP1 (SIZE, cgtz, BASETYPE, SUFFIX, FORCE) \
46 OP1 (SIZE, clez, BASETYPE, SUFFIX, FORCE) \
47 OP1 (SIZE, cltz, BASETYPE, SUFFIX, FORCE) \
48 UNSIGNED_OPS (SIZE, BASETYPE, SUFFIX, FORCE)
49
50 ALL_OPS (8x8, int, _s8, DONT_FORCE)
51 ALL_OPS (16x4, int, _s16, DONT_FORCE)
52 ALL_OPS (32x2, int, _s32, DONT_FORCE)
53 ALL_OPS (64x1, int, _s64, DONT_FORCE)
54 ALL_OPS (64, int, d_s64, FORCE_SIMD)
55 ALL_OPS (8x16, int, q_s8, DONT_FORCE)
56 ALL_OPS (16x8, int, q_s16, DONT_FORCE)
57 ALL_OPS (32x4, int, q_s32, DONT_FORCE)
58 ALL_OPS (64x2, int, q_s64, DONT_FORCE)
59 UNSIGNED_OPS (8x8, uint, _u8, DONT_FORCE)
60 UNSIGNED_OPS (16x4, uint, _u16, DONT_FORCE)
61 UNSIGNED_OPS (32x2, uint, _u32, DONT_FORCE)
62 UNSIGNED_OPS (64x1, uint, _u64, DONT_FORCE)
63 UNSIGNED_OPS (64, uint, d_u64, FORCE_SIMD)
64 UNSIGNED_OPS (8x16, uint, q_u8, DONT_FORCE)
65 UNSIGNED_OPS (16x8, uint, q_u16, DONT_FORCE)
66 UNSIGNED_OPS (32x4, uint, q_u32, DONT_FORCE)
67 UNSIGNED_OPS (64x2, uint, q_u64, DONT_FORCE)
68