PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / avx512dq-vbroadcastf32x8-2.c
blob6d531d0f6aecfe2d722161e20d3a91449fb4ccb7
1 /* { dg-do run } */
2 /* { dg-options "-O2 -mavx512dq" } */
3 /* { dg-require-effective-target avx512dq } */
5 #define AVX512DQ
6 #include "avx512f-helper.h"
8 #define SIZE (AVX512F_LEN / 32)
9 #include "avx512f-mask-type.h"
11 void
12 CALC (float *r, float *s)
14 int i;
15 for (i = 0; i < SIZE; i++)
17 r[i] = s[i % 8];
21 void
22 TEST (void)
24 int i, sign;
25 UNION_TYPE (AVX512F_LEN,) res1, res2, res3;
26 UNION_TYPE (256,) src;
27 MASK_TYPE mask = SIZE | 123;
28 float res_ref[SIZE];
30 sign = -1;
31 for (i = 0; i < 8; i++)
33 src.a[i] = 34.67 * i * sign;
34 sign = sign * -1;
36 for (i = 0; i < SIZE; i++)
37 res2.a[i] = DEFAULT_VALUE;
39 res1.x = INTRINSIC (_broadcast_f32x8) (src.x);
40 res2.x = INTRINSIC (_mask_broadcast_f32x8) (res2.x, mask, src.x);
41 res3.x = INTRINSIC (_maskz_broadcast_f32x8) (mask, src.x);
43 CALC (res_ref, src.a);
45 if (UNION_CHECK (AVX512F_LEN,) (res1, res_ref))
46 abort ();
48 MASK_MERGE ()(res_ref, mask, SIZE);
49 if (UNION_CHECK (AVX512F_LEN,) (res2, res_ref))
50 abort ();
52 MASK_ZERO ()(res_ref, mask, SIZE);
53 if (UNION_CHECK (AVX512F_LEN,) (res3, res_ref))
54 abort ();