| 1 |
/* PR target/87214 */ |
| 2 |
/* { dg-do run { target { avx512vl } } } */ |
| 3 |
/* { dg-options "-O3 -mavx512vl -mtune=skylake-avx512" } */ |
| 4 |
|
| 5 |
#define AVX512VL |
| 6 |
#define AVX512F_LEN 512 |
| 7 |
#define AVX512F_LEN_HALF 256 |
| 8 |
#include "avx512f-check.h" |
| 9 |
|
| 10 |
struct s { unsigned long a, b, c; }; |
| 11 |
|
| 12 |
void __attribute__ ((noipa)) |
| 13 |
foo (struct s *restrict s1, struct s *restrict s2, int n) |
| 14 |
{ |
| 15 |
for (int i = 0; i < n; ++i) |
| 16 |
{ |
| 17 |
s1[i].b = s2[i].b; |
| 18 |
s1[i].c = s2[i].c; |
| 19 |
s2[i].c = 0; |
| 20 |
} |
| 21 |
} |
| 22 |
|
| 23 |
#define N 12 |
| 24 |
|
| 25 |
static void |
| 26 |
test_256 (void) |
| 27 |
{ |
| 28 |
struct s s1[N], s2[N]; |
| 29 |
for (unsigned int j = 0; j < N; ++j) |
| 30 |
{ |
| 31 |
s2[j].a = j * 5; |
| 32 |
s2[j].b = j * 5 + 2; |
| 33 |
s2[j].c = j * 5 + 4; |
| 34 |
} |
| 35 |
foo (s1, s2, N); |
| 36 |
for (unsigned int j = 0; j < N; ++j) |
| 37 |
if (s1[j].b != j * 5 + 2) |
| 38 |
__builtin_abort (); |
| 39 |
} |
| 40 |
|
| 41 |
static void |
| 42 |
test_128 (void) |
| 43 |
{ |
| 44 |
} |