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 / 64)
10 #include "avx512f-mask-type.h"
11
12 void static
CALC(float * e,UNION_TYPE (AVX512F_LEN,d)s1)13 CALC (float *e, UNION_TYPE (AVX512F_LEN, d) s1)
14 {
15 int i;
16 for (i = 0; i < SIZE; i++)
17 e[i] = (float) s1.a[i];
18 for (i = SIZE; i < AVX512F_LEN_HALF / 32; i++)
19 e[i] = 0.0;
20 }
21
22 void
TEST(void)23 TEST (void)
24 {
25 UNION_TYPE (AVX512F_LEN, d) s1;
26 UNION_TYPE (AVX512F_LEN_HALF,) u1, u2, u3;
27 MASK_TYPE mask = MASK_VALUE;
28 float e[AVX512F_LEN_HALF / 32];
29 int i;
30
31 for (i = 0; i < SIZE; i++)
32 {
33 s1.a[i] = 0.12 * (i + 37.09);
34 u1.a[i] = DEFAULT_VALUE;
35 u2.a[i] = DEFAULT_VALUE;
36 u3.a[i] = DEFAULT_VALUE;
37 }
38
39 u1.x = INTRINSIC (_cvtpd_ps) (s1.x);
40 u2.x = INTRINSIC (_mask_cvtpd_ps) (u2.x, mask, s1.x);
41 u3.x = INTRINSIC (_maskz_cvtpd_ps) (mask, s1.x);
42
43 CALC (e, s1);
44
45 if (UNION_CHECK (AVX512F_LEN_HALF,) (u1, e))
46 abort ();
47
48 MASK_MERGE ()(e, mask, SIZE);
49 if (UNION_CHECK (AVX512F_LEN_HALF,) (u2, e))
50 abort ();
51
52 MASK_ZERO ()(e, mask, SIZE);
53 if (UNION_CHECK (AVX512F_LEN_HALF,) (u3, e))
54 abort ();
55 }
56