Debian Codegraph @

gcc/testsuite/gcc.target/aarch64/sve/cond_xorsign_1.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O2" } */
3
4 #define xorsign(A, B, SUFFIX) ((A) * __builtin_copysign##SUFFIX (1.0, B))
5
6 #define DEF_LOOP(TYPE, SUFFIX) \
7 void __attribute__ ((noinline, noclone)) \
8 test_##TYPE (TYPE *__restrict r, TYPE *__restrict a, \
9 TYPE *__restrict b, TYPE *__restrict c, \
10 int n) \
11 { \
12 for (int i = 0; i < n; ++i) \
13 r[i] = a[i] < 20 ? xorsign(b[i], c[i], SUFFIX) : b[i]; \
14 }
15
16 #define TEST_ALL(T) \
17 T (_Float16, f16) \
18 T (float, f) \
19 T (double, )
20
21 TEST_ALL (DEF_LOOP)
22
23 /* { dg-final { scan-assembler-times {\tand\tz[0-9]+\.h, z[0-9]+\.h,} 1 } } */
24 /* { dg-final { scan-assembler-times {\tand\tz[0-9]+\.s, z[0-9]+\.s,} 1 } } */
25 /* { dg-final { scan-assembler-times {\tand\tz[0-9]+\.d, z[0-9]+\.d,} 1 } } */
26
27 /* { dg-final { scan-assembler-times {\teor\tz[0-9]+\.h, p[0-7]/m,} 1 } } */
28 /* { dg-final { scan-assembler-times {\teor\tz[0-9]+\.s, p[0-7]/m,} 1 } } */
29 /* { dg-final { scan-assembler-times {\teor\tz[0-9]+\.d, p[0-7]/m,} 1 } } */
30
31 /* { dg-final { scan-assembler-not {\tfmul} } } */
32 /* { dg-final { scan-assembler-not {\tmov\tz[^,]*z} } } */
33 /* { dg-final { scan-assembler-not {\tmovprfx\t} } } */
34 /* { dg-final { scan-assembler-not {\tsel\t} } } */