| 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 (long long x) |
| 10 |
{ |
| 11 |
return _mm512_set_epi64 (x, x, x, x, x, x, x, x); |
| 12 |
} |
| 13 |
|
| 14 |
static __m512i |
| 15 |
__attribute__ ((noinline)) |
| 16 |
foo_r (long long x) |
| 17 |
{ |
| 18 |
return _mm512_setr_epi64 (x, x, x, x, x, x, x, x); |
| 19 |
} |
| 20 |
|
| 21 |
static void |
| 22 |
avx512f_test (void) |
| 23 |
{ |
| 24 |
int i; |
| 25 |
long long e = 0xfed178ab134badf1LL; |
| 26 |
long long v[8]; |
| 27 |
union512i_q res; |
| 28 |
|
| 29 |
for (i = 0; i < 8; i++) |
| 30 |
v[i] = e; |
| 31 |
|
| 32 |
res.x = foo (e); |
| 33 |
|
| 34 |
if (check_union512i_q (res, v)) |
| 35 |
abort (); |
| 36 |
|
| 37 |
res.x = _mm512_setzero_si512 (); |
| 38 |
|
| 39 |
res.x = foo_r (e); |
| 40 |
|
| 41 |
if (check_union512i_q (res, v)) |
| 42 |
abort (); |
| 43 |
} |