| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-details --save-temps" } */ |
| 3 |
|
| 4 |
#include <stdint.h> |
| 5 |
|
| 6 |
#ifndef OP |
| 7 |
#define OP(x,y) (~((x) | (y))) |
| 8 |
#endif |
| 9 |
|
| 10 |
#define TYPE(N) int##N##_t |
| 11 |
|
| 12 |
#define TEMPLATE(SIZE) \ |
| 13 |
void __attribute__ ((noinline, noclone)) \ |
| 14 |
f_##SIZE##_##OP \ |
| 15 |
(TYPE(SIZE) *restrict a, TYPE(SIZE) *restrict b, \ |
| 16 |
TYPE(SIZE) *restrict c, int n) \ |
| 17 |
{ \ |
| 18 |
for (int i = 0; i < n; i++) \ |
| 19 |
a[i] = OP (b[i], c[i]); \ |
| 20 |
} |
| 21 |
|
| 22 |
TEMPLATE (8); |
| 23 |
TEMPLATE (16); |
| 24 |
TEMPLATE (32); |
| 25 |
TEMPLATE (64); |
| 26 |
|
| 27 |
/* { dg-final { scan-tree-dump-times "vectorized 1 loops in function" 4 "vect" } } */ |
| 28 |
|
| 29 |
/* { dg-final { scan-assembler-not {\tand\tz[0-9]+\.[bhsd]} } } */ |
| 30 |
/* { dg-final { scan-assembler-not {\torr\tz[0-9]+\.[bhsd]} } } */ |
| 31 |
/* { dg-final { scan-assembler-not {\tnot\tz[0-9]+\.[bhsd]} } } */ |
| 32 |
|
| 33 |
/* { dg-final { scan-assembler-times {\tnbsl\tz[0-9]+\.d, z[0-9]+\.d, z[0-9]+\.d, z[0-9]+\.d\n} 4 } } */ |