| 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 x1, int x2, int x3, int x4, |
| 10 |
int x5, int x6, int x7, int x8, |
| 11 |
int x9, int x10, int x11, int x12, |
| 12 |
int x13, int x14, int x15, int x16) |
| 13 |
{ |
| 14 |
return _mm512_set_epi32 (x1, x2, x3, x4, x5, x6, x7, x8, |
| 15 |
x9, x10, x11, x12, x13, x14, x15, x16); |
| 16 |
} |
| 17 |
|
| 18 |
static __m512i |
| 19 |
__attribute__ ((noinline)) |
| 20 |
foo_r (int x1, int x2, int x3, int x4, |
| 21 |
int x5, int x6, int x7, int x8, |
| 22 |
int x9, int x10, int x11, int x12, |
| 23 |
int x13, int x14, int x15, int x16) |
| 24 |
{ |
| 25 |
return _mm512_setr_epi32 (x16, x15, x14, x13, x12, x11, x10, x9, |
| 26 |
x8, x7, x6, x5, x4, x3, x2, x1); |
| 27 |
} |
| 28 |
|
| 29 |
static void |
| 30 |
avx512f_test (void) |
| 31 |
{ |
| 32 |
int v[16] = { -3, -453, 2, -231, 1, -111, 9, -145, |
| 33 |
23, 671, -173, 166, -13, 714, 69, 123 }; |
| 34 |
union512i_d res; |
| 35 |
|
| 36 |
res.x = foo (v[15], v[14], v[13], v[12], v[11], v[10], v[9], v[8], |
| 37 |
v[7], v[6], v[5], v[4], v[3], v[2], v[1], v[0]); |
| 38 |
|
| 39 |
if (check_union512i_d (res, v)) |
| 40 |
abort (); |
| 41 |
|
| 42 |
res.x = _mm512_setzero_si512 (); |
| 43 |
|
| 44 |
res.x = foo_r (v[15], v[14], v[13], v[12], v[11], v[10], v[9], v[8], |
| 45 |
v[7], v[6], v[5], v[4], v[3], v[2], v[1], v[0]); |
| 46 |
|
| 47 |
if (check_union512i_d (res, v)) |
| 48 |
abort (); |
| 49 |
} |