Use gather loads for strided accesses
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / avx512f-vunpckhps-2.c
blobd77806823007bf4277e5fa8a579f71bbfea05392
1 /* { dg-do run } */
2 /* { dg-options "-O2 -mavx512f" } */
3 /* { dg-require-effective-target avx512f } */
5 #define AVX512F
7 #include "avx512f-helper.h"
9 #define SIZE (AVX512F_LEN / 32)
10 #include "avx512f-mask-type.h"
12 void static
13 CALC (float *s1, float *s2, float *r)
15 int i;
17 for (i = 0; i < SIZE / 4; i++)
19 r[4 * i] = s1[4 * i + 2];
20 r[4 * i + 1] = s2[4 * i + 2];
21 r[4 * i + 2] = s1[4 * i + 3];
22 r[4 * i + 3] = s2[4 * i + 3];
26 void
27 TEST (void)
29 UNION_TYPE (AVX512F_LEN, ) s1, s2, res1, res2, res3;
30 MASK_TYPE mask = MASK_VALUE;
31 float res_ref[SIZE];
32 int i;
34 for (i = 0; i < SIZE; i++)
36 s1.a[i] = i * 123.2 + 32.6;
37 s2.a[i] = i + 2.5;
38 res2.a[i] = DEFAULT_VALUE;
41 res1.x = INTRINSIC (_unpackhi_ps) (s1.x, s2.x);
42 res2.x = INTRINSIC (_mask_unpackhi_ps) (res2.x, mask, s1.x, s2.x);
43 res3.x = INTRINSIC (_maskz_unpackhi_ps) (mask, s1.x, s2.x);
45 CALC (s1.a, s2.a, res_ref);
47 if (UNION_CHECK (AVX512F_LEN, ) (res1, res_ref))
48 abort ();
50 MASK_MERGE () (res_ref, mask, SIZE);
51 if (UNION_CHECK (AVX512F_LEN, ) (res2, res_ref))
52 abort ();
54 MASK_ZERO () (res_ref, mask, SIZE);
55 if (UNION_CHECK (AVX512F_LEN, ) (res3, res_ref))
56 abort ();