1 /* { dg-do run } */
2 /* { dg-options "-O2 -mavx512f" } */
3 /* { dg-require-effective-target avx512f } */
4
5 #define AVX512F
6
7 #include "avx512f-helper.h"
8
9 #define SIZE (AVX512F_LEN / 32)
10 #include "avx512f-mask-type.h"
11
12 void static
CALC(float * e,float * s1,float * s2)13 CALC (float *e, float *s1, float *s2)
14 {
15 int i;
16 for (i = 0; i < SIZE / 4; i++)
17 {
18 e[4 * i] = s1[4 * i];
19 e[4 * i + 1] = s2[4 * i];
20 e[4 * i + 2] = s1[4 * i + 1];
21 e[4 * i + 3] = s2[4 * i + 1];
22 }
23 }
24
25 void
TEST(void)26 TEST (void)
27 {
28 UNION_TYPE (AVX512F_LEN,) s1, s2, u1, u2, u3;
29 MASK_TYPE mask = MASK_VALUE;
30 float e[SIZE];
31 int i;
32 for (i = 0; i < SIZE; i++)
33 {
34 s1.a[i] = i * 123.2 + 32.6;
35 s2.a[i] = i + 2.5;
36 u1.a[i]= DEFAULT_VALUE;
37 u2.a[i]= DEFAULT_VALUE;
38 u3.a[i]= DEFAULT_VALUE;
39 }
40
41 u1.x = INTRINSIC (_unpacklo_ps) (s1.x, s2.x);
42 u2.x = INTRINSIC (_mask_unpacklo_ps) (u2.x, mask, s1.x, s2.x);
43 u3.x = INTRINSIC (_maskz_unpacklo_ps) (mask, s1.x, s2.x);
44
45 CALC (e, s1.a, s2.a);
46
47 if (UNION_CHECK (AVX512F_LEN,) (u1, e))
48 abort ();
49
50 MASK_MERGE () (e, mask, SIZE);
51 if (UNION_CHECK (AVX512F_LEN, ) (u2, e))
52 abort ();
53
54 MASK_ZERO () (e, mask, SIZE);
55 if (UNION_CHECK (AVX512F_LEN, ) (u3, e))
56 abort ();
57 }
58