2015-12-10 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / avx512f-set-v16si-1.c
blobebd0486999f2e4677709cdbd57d062f61db337f5
1 /* { dg-do run } */
2 /* { dg-options "-O2 -mavx512f" } */
3 /* { dg-require-effective-target avx512f } */
5 #include "avx512f-check.h"
7 static __m512i
8 __attribute__ ((noinline))
9 foo (int *v)
11 return _mm512_set_epi32 (v[15], v[14], v[13], v[12],
12 v[11], v[10], v[9], v[8],
13 v[7], v[6], v[5], v[4],
14 v[3], v[2], v[1], v[0]);
17 static __m512i
18 __attribute__ ((noinline))
19 foo_r (int *v)
21 return _mm512_setr_epi32 (v[0], v[1], v[2], v[3],
22 v[4], v[5], v[6], v[7],
23 v[8], v[9], v[10], v[11],
24 v[12], v[13], v[14], v[15]);
27 static void
28 avx512f_test (void)
30 int v[16] = { 19832468, 2134, 6576856, 6678,
31 8723467, 54646, 234566, 12314,
32 786784, 77575, 645245, 234555,
33 9487733, 411244, 12344, 86533 };
34 union512i_d res;
36 res.x = foo (v);
38 if (check_union512i_d (res, v))
39 abort ();
41 res.x = _mm512_setzero_si512 ();
43 res.x = foo_r (v);
45 if (check_union512i_d (res, v))
46 abort ();