| 1 |
/* { dg-options "-O3 --param vect-partial-vector-usage=1" } */ |
| 2 |
|
| 3 |
unsigned short __attribute__((noipa)) |
| 4 |
add_loop (unsigned short *x, int n, unsigned short res) |
| 5 |
{ |
| 6 |
for (int i = 0; i < n; ++i) |
| 7 |
res += x[i]; |
| 8 |
return res; |
| 9 |
} |
| 10 |
|
| 11 |
unsigned short __attribute__((noipa)) |
| 12 |
min_loop (unsigned short *x, int n, unsigned short res) |
| 13 |
{ |
| 14 |
for (int i = 0; i < n; ++i) |
| 15 |
res = res < x[i] ? res : x[i]; |
| 16 |
return res; |
| 17 |
} |
| 18 |
|
| 19 |
unsigned short __attribute__((noipa)) |
| 20 |
max_loop (unsigned short *x, int n, unsigned short res) |
| 21 |
{ |
| 22 |
for (int i = 0; i < n; ++i) |
| 23 |
res = res > x[i] ? res : x[i]; |
| 24 |
return res; |
| 25 |
} |
| 26 |
|
| 27 |
unsigned short __attribute__((noipa)) |
| 28 |
and_loop (unsigned short *x, int n, unsigned short res) |
| 29 |
{ |
| 30 |
for (int i = 0; i < n; ++i) |
| 31 |
res &= x[i]; |
| 32 |
return res; |
| 33 |
} |
| 34 |
|
| 35 |
unsigned short __attribute__((noipa)) |
| 36 |
or_loop (unsigned short *x, int n, unsigned short res) |
| 37 |
{ |
| 38 |
for (int i = 0; i < n; ++i) |
| 39 |
res |= x[i]; |
| 40 |
return res; |
| 41 |
} |
| 42 |
|
| 43 |
unsigned short __attribute__((noipa)) |
| 44 |
eor_loop (unsigned short *x, int n, unsigned short res) |
| 45 |
{ |
| 46 |
for (int i = 0; i < n; ++i) |
| 47 |
res ^= x[i]; |
| 48 |
return res; |
| 49 |
} |
| 50 |
|
| 51 |
/* { dg-final { scan-assembler-times {\tadd\tz[0-9]+\.h, z[0-9]+\.h, z[0-9]+\.h\n} 1 } } */ |
| 52 |
/* { dg-final { scan-assembler-times {\tadd\tz[0-9]+\.h, p[0-7]/m, z[0-9]+\.h, z[0-9]+\.h\n} 1 } } */ |
| 53 |
/* { dg-final { scan-assembler-times {\tuaddv\t} 1 } } */ |
| 54 |
|
| 55 |
/* { dg-final { scan-assembler-times {\tumin\tz[0-9]+\.h, p[0-7]/m, z[0-9]+\.h, z[0-9]+\.h\n} 2 } } */ |
| 56 |
/* { dg-final { scan-assembler-times {\tuminv\t} 1 } } */ |
| 57 |
|
| 58 |
/* { dg-final { scan-assembler-times {\tumax\tz[0-9]+\.h, p[0-7]/m, z[0-9]+\.h, z[0-9]+\.h\n} 2 } } */ |
| 59 |
/* { dg-final { scan-assembler-times {\tumaxv\t} 1 } } */ |
| 60 |
|
| 61 |
/* { dg-final { scan-assembler-times {\tand\tz[0-9]+\.d, z[0-9]+\.d, z[0-9]+\.d\n} 1 } } */ |
| 62 |
/* { dg-final { scan-assembler-times {\tand\tz[0-9]+\.h, p[0-7]/m, z[0-9]+\.h, z[0-9]+\.h\n} 1 } } */ |
| 63 |
/* { dg-final { scan-assembler-times {\tandv\t} 1 } } */ |
| 64 |
|
| 65 |
/* { dg-final { scan-assembler-times {\torr\tz[0-9]+\.d, z[0-9]+\.d, z[0-9]+\.d\n} 1 } } */ |
| 66 |
/* { dg-final { scan-assembler-times {\torr\tz[0-9]+\.h, p[0-7]/m, z[0-9]+\.h, z[0-9]+\.h\n} 1 } } */ |
| 67 |
/* { dg-final { scan-assembler-times {\torv\t} 1 } } */ |
| 68 |
|
| 69 |
/* { dg-final { scan-assembler-times {\teor\tz[0-9]+\.d, z[0-9]+\.d, z[0-9]+\.d\n} 1 } } */ |
| 70 |
/* { dg-final { scan-assembler-times {\teor\tz[0-9]+\.h, p[0-7]/m, z[0-9]+\.h, z[0-9]+\.h\n} 1 } } */ |
| 71 |
/* { dg-final { scan-assembler-times {\teorv\t} 1 } } */ |