Debian Codegraph @

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

raw
1 /* { dg-do run { target aarch64_sve256_hw } } */
2 /* { dg-options "-O3 -msve-vector-bits=256 --param vect-partial-vector-usage=1" } */
3
4 #define N 0x1100
5
6 #include "reduc_11.c"
7
8 int
9 main (void)
10 {
11 unsigned short x[N];
12 for (int i = 0; i < N; ++i)
13 x[i] = (i + 1) * (i + 2);
14
15 if (add_loop (x, 42) != 20522
16 || max_loop (x, 65503) != 65504
17 || max_loop (x, 65505) != 65505
18 || or_loop (x, 0) != 0xfffe
19 || or_loop (x, 1) != 0xffff
20 || eor_loop (x, 0) != 0xa000
21 || eor_loop (x, 0xbfff) != 0x1fff)
22 __builtin_abort ();
23
24 for (int i = 0; i < N; ++i)
25 x[i] = ~x[i];
26
27 if (min_loop (x, 32) != 31
28 || min_loop (x, 30) != 30
29 || and_loop (x, 0xff) != 1
30 || and_loop (x, 0) != 0)
31 __builtin_abort ();
32
33 return 0;
34 }