| 1 |
/* PR target/87767 */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-options "-O2 -mavx512f -mavx512vl -mavx512dq" } */ |
| 4 |
/* { dg-additional-options "-fno-PIE" { target ia32 } } */ |
| 5 |
/* { dg-additional-options "-mdynamic-no-pic" { target { *-*-darwin* && ia32 } } } |
| 6 |
/* { dg-final { scan-assembler-times "\[^\n\]*\\\{1to2\\\}" 2 { target { ! ia32 } } } } */ |
| 7 |
/* { dg-final { scan-assembler-times "\[^\n\]*\\\{1to4\\\}" 4 { target { ! ia32 } } } } */ |
| 8 |
/* { dg-final { scan-assembler-times "\[^\n\]*\\\{1to8\\\}" 2 } } */ |
| 9 |
/* { dg-final { scan-assembler-times "vpbroadcastd\[\\t \]+%(?:r|e)\[^\n\]*, %xmm\[0-9\]+" 3 } } */ |
| 10 |
/* { dg-final { scan-assembler-times "vpbroadcastd\[\\t \]+%(?:r|e)\[^\n\]*, %ymm\[0-9\]+" 3 } } */ |
| 11 |
/* { dg-final { scan-assembler-times "vpbroadcastq\[\\t \]+%r\[^\n\]*, %xmm\[0-9\]+" 3 { target { ! ia32 } } } } */ |
| 12 |
/* { dg-final { scan-assembler-times "vpbroadcastq\[\\t \]+%r\[^\n\]*, %ymm\[0-9\]+" 3 { target { ! ia32 } } } } */ |
| 13 |
|
| 14 |
typedef int v4si __attribute__ ((vector_size (16))); |
| 15 |
typedef int v8si __attribute__ ((vector_size (32))); |
| 16 |
typedef long long v2di __attribute__ ((vector_size (16))); |
| 17 |
typedef long long v4di __attribute__ ((vector_size (32))); |
| 18 |
typedef float v4sf __attribute__ ((vector_size (16))); |
| 19 |
typedef float v8sf __attribute__ ((vector_size (32))); |
| 20 |
typedef double v2df __attribute__ ((vector_size (16))); |
| 21 |
typedef double v4df __attribute__ ((vector_size (32))); |
| 22 |
|
| 23 |
#define CONSTANT 101; |
| 24 |
#define FOO(VTYPE, OP_NAME, OP) \ |
| 25 |
VTYPE \ |
| 26 |
__attribute__ ((noipa)) \ |
| 27 |
foo_##OP_NAME##_##VTYPE (VTYPE a) \ |
| 28 |
{ \ |
| 29 |
return a OP CONSTANT; \ |
| 30 |
} \ |
| 31 |
|
| 32 |
FOO (v4si, add, +); |
| 33 |
FOO (v8si, add, +); |
| 34 |
FOO (v2di, add, +); |
| 35 |
FOO (v4di, add, +); |
| 36 |
FOO (v4si, sub, -); |
| 37 |
FOO (v8si, sub, -); |
| 38 |
FOO (v2di, sub, -); |
| 39 |
FOO (v4di, sub, -); |
| 40 |
FOO (v4sf, add, +); |
| 41 |
FOO (v8sf, add, +); |
| 42 |
FOO (v2df, add, +); |
| 43 |
FOO (v4df, add, +); |
| 44 |
FOO (v4si, mul, *); |
| 45 |
FOO (v8si, mul, *); |
| 46 |
FOO (v2di, mul, *); |
| 47 |
FOO (v4di, mul, *); |
| 48 |
FOO (v4sf, mul, *); |
| 49 |
FOO (v8sf, mul, *); |
| 50 |
FOO (v2df, mul, *); |
| 51 |
FOO (v4df, mul, *); |