1 /* { dg-do run } */
2 /* { dg-options "-O2 -mavx512dq" } */
3 /* { dg-require-effective-target avx512dq } */
4
5 #define AVX512DQ
6 #include "avx512f-helper.h"
7
8 #define SIZE (AVX512F_LEN / 32)
9 #include "avx512f-mask-type.h"
10
11 void
CALC(float * src1,float * src2,float * dst)12 CALC (float *src1, float *src2, float *dst)
13 {
14 int i;
15
16 for (i = 0; i < SIZE; i++)
17 {
18 int tmp = (*(int *) &src1[i]) ^ (*(int *) &src2[i]);
19 dst[i] = *(float *) &tmp;
20 }
21 }
22
23 void
TEST(void)24 TEST (void)
25 {
26 UNION_TYPE (AVX512F_LEN,) s1, s2, res1, res2, res3;
27 MASK_TYPE mask = MASK_VALUE;
28 float dst_ref[SIZE];
29 int i;
30
31 for (i = 0; i < SIZE; i++) {
32 s1.a[i] = 132.45 * i;
33 s2.a[i] = 43.6 - i * 4.4;
34 res2.a[i] = DEFAULT_VALUE;
35 }
36
37 res1.x = INTRINSIC (_xor_ps) (s1.x, s2.x);
38 res2.x = INTRINSIC (_mask_xor_ps) (res2.x, mask, s1.x, s2.x);
39 res3.x = INTRINSIC (_maskz_xor_ps) (mask, s1.x, s2.x);
40
41 CALC (s1.a, s2.a, dst_ref);
42
43 if (UNION_CHECK (AVX512F_LEN,) (res1, dst_ref))
44 abort ();
45
46 MASK_MERGE () (dst_ref, mask, SIZE);
47 if (UNION_CHECK (AVX512F_LEN,) (res2, dst_ref))
48 abort ();
49
50 MASK_ZERO () (dst_ref, mask, SIZE);
51 if (UNION_CHECK (AVX512F_LEN,) (res3, dst_ref))
52 abort ();
53 }
54