| 1 |
/* PR target/96246 */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-options "-O2 -std=c++14 -mavx512bw -mavx512vl" } */ |
| 4 |
/* { dg-require-effective-target c99_runtime } */ |
| 5 |
/* { dg-final { scan-assembler-times "vpblendm\[bwdq\]\[\t \]" 6 } } */ |
| 6 |
/* { dg-final { scan-assembler-times "vblendmp\[sd\]\[\t \]" 3 } } */ |
| 7 |
|
| 8 |
typedef char v16qi __attribute__ ((vector_size (16))); |
| 9 |
typedef char v32qi __attribute__ ((vector_size (32))); |
| 10 |
typedef char v16hi __attribute__ ((vector_size (32))); |
| 11 |
typedef int v4si __attribute__((vector_size (16))); |
| 12 |
typedef int v8si __attribute__((vector_size (32))); |
| 13 |
typedef long long v4di __attribute__((vector_size (32))); |
| 14 |
typedef float v4sf __attribute__((vector_size (16))); |
| 15 |
typedef float v8sf __attribute__((vector_size (32))); |
| 16 |
typedef double v4df __attribute__((vector_size (32))); |
| 17 |
|
| 18 |
#define COMPILE_TEST(vtype, num) \ |
| 19 |
vtype \ |
| 20 |
__attribute__ ((noipa)) \ |
| 21 |
foo_##vtype (vtype a, vtype b, vtype c, vtype d) \ |
| 22 |
{ \ |
| 23 |
return a > b ? c : d; \ |
| 24 |
} |
| 25 |
|
| 26 |
COMPILE_TEST (v16qi, 16); |
| 27 |
COMPILE_TEST (v32qi, 32); |
| 28 |
COMPILE_TEST (v16hi, 16); |
| 29 |
COMPILE_TEST (v4si, 4); |
| 30 |
COMPILE_TEST (v8si, 8); |
| 31 |
COMPILE_TEST (v4sf, 4); |
| 32 |
COMPILE_TEST (v8sf, 8); |
| 33 |
COMPILE_TEST (v4di, 4); |
| 34 |
COMPILE_TEST (v4df, 4); |