| 1 |
/* { dg-do run } */ |
| 2 |
/* { dg-options "-O2 -mavx512f" } */ |
| 3 |
/* { dg-require-effective-target avx512f } */ |
| 4 |
|
| 5 |
#include "avx512f-check.h" |
| 6 |
|
| 7 |
static __m512i |
| 8 |
__attribute__ ((noinline)) |
| 9 |
foo (int x) |
| 10 |
{ |
| 11 |
return _mm512_set_epi32 (x, x, x, x, x, x, x, x, |
| 12 |
x, x, x, x, x, x, x, x); |
| 13 |
} |
| 14 |
|
| 15 |
static __m512i |
| 16 |
__attribute__ ((noinline)) |
| 17 |
foo_r (int x) |
| 18 |
{ |
| 19 |
return _mm512_setr_epi32 (x, x, x, x, x, x, x, x, |
| 20 |
x, x, x, x, x, x, x, x); |
| 21 |
} |
| 22 |
|
| 23 |
static void |
| 24 |
avx512f_test (void) |
| 25 |
{ |
| 26 |
int i; |
| 27 |
int e = 0xabadbeef; |
| 28 |
int v[16]; |
| 29 |
union512i_d res; |
| 30 |
|
| 31 |
for (i = 0; i < 16; i++) |
| 32 |
v[i] = e; |
| 33 |
|
| 34 |
res.x = foo (e); |
| 35 |
|
| 36 |
if (check_union512i_d (res, v)) |
| 37 |
abort (); |
| 38 |
|
| 39 |
res.x = _mm512_setzero_si512 (); |
| 40 |
|
| 41 |
res.x = foo_r (e); |
| 42 |
|
| 43 |
if (check_union512i_d (res, v)) |
| 44 |
abort (); |
| 45 |
} |