| 1 |
/* { dg-do run } */ |
| 2 |
/* { dg-options "-mavx2 -O2" } */ |
| 3 |
/* { dg-require-effective-target avx2 } */ |
| 4 |
|
| 5 |
#include "avx2-check.h" |
| 6 |
|
| 7 |
static void |
| 8 |
compute_movsxwq (short *s, long long int *r) |
| 9 |
{ |
| 10 |
int i; |
| 11 |
|
| 12 |
for (i = 0; i < 4; i++) |
| 13 |
r[i] = s[i]; |
| 14 |
} |
| 15 |
|
| 16 |
static void |
| 17 |
avx2_test (void) |
| 18 |
{ |
| 19 |
union128i_w s; |
| 20 |
union256i_q res; |
| 21 |
long long int res_ref[4]; |
| 22 |
|
| 23 |
s.x = _mm_set_epi16 (1, 2, 3, 4, -200, 50, 6, 8); |
| 24 |
|
| 25 |
res.x = _mm256_cvtepi16_epi64 (s.x); |
| 26 |
|
| 27 |
compute_movsxwq (s.a, res_ref); |
| 28 |
|
| 29 |
if (check_union256i_q (res, res_ref)) |
| 30 |
abort (); |
| 31 |
} |