| 1 |
/* { dg-do run { target aarch64_sve_hw } } */ |
| 2 |
/* { dg-options "-O3 --param vect-partial-vector-usage=1" } */ |
| 3 |
|
| 4 |
#define N 0x1100 |
| 5 |
|
| 6 |
#include "reduc_10.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, 0) != 0 |
| 16 |
|| add_loop (x, 11) != 572 |
| 17 |
|| add_loop (x, 0x100) != 22016 |
| 18 |
|| add_loop (x, 0xfff) != 20480 |
| 19 |
|| max_loop (x, 0) != 0 |
| 20 |
|| max_loop (x, 11) != 132 |
| 21 |
|| max_loop (x, 0x100) != 65280 |
| 22 |
|| max_loop (x, 0xfff) != 65504 |
| 23 |
|| or_loop (x, 0) != 0 |
| 24 |
|| or_loop (x, 11) != 0xfe |
| 25 |
|| or_loop (x, 0x80) != 0x7ffe |
| 26 |
|| or_loop (x, 0xb4) != 0x7ffe |
| 27 |
|| or_loop (x, 0xb5) != 0xfffe |
| 28 |
|| eor_loop (x, 0) != 0 |
| 29 |
|| eor_loop (x, 11) != 0xe8 |
| 30 |
|| eor_loop (x, 0x100) != 0xcf00 |
| 31 |
|| eor_loop (x, 0xfff) != 0xa000) |
| 32 |
__builtin_abort (); |
| 33 |
|
| 34 |
for (int i = 0; i < N; ++i) |
| 35 |
x[i] = ~x[i]; |
| 36 |
|
| 37 |
if (min_loop (x, 0) != 65535 |
| 38 |
|| min_loop (x, 11) != 65403 |
| 39 |
|| min_loop (x, 0x100) != 255 |
| 40 |
|| min_loop (x, 0xfff) != 31 |
| 41 |
|| and_loop (x, 0) != 0xffff |
| 42 |
|| and_loop (x, 11) != 0xff01 |
| 43 |
|| and_loop (x, 0x80) != 0x8001 |
| 44 |
|| and_loop (x, 0xb4) != 0x8001 |
| 45 |
|| and_loop (x, 0xb5) != 1) |
| 46 |
__builtin_abort (); |
| 47 |
|
| 48 |
return 0; |
| 49 |
} |