Debian Codegraph @

gcc/testsuite/gcc.target/i386/avx512dq-vextracti64x2-2.c

raw
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 / 64)
9 #include "avx512f-mask-type.h"
10 #include "string.h"
11
12 void
13 CALC (long long int *s1, long long int *res_ref, int mask)
14 {
15 memset (res_ref, 0, 16);
16 memcpy (res_ref, s1 + mask * 2, 16);
17 }
18
19 void
20 TEST (void)
21 {
22 UNION_TYPE (AVX512F_LEN, i_q) s1;
23 union128i_q res1, res2, res3;
24 long long int res_ref[2];
25 MASK_TYPE mask = MASK_VALUE;
26 int j;
27
28 for (j = 0; j < SIZE; j++)
29 {
30 s1.a[j] = j * j + 37;
31 }
32
33 for (j = 0; j < 2; j++)
34 {
35 res1.a[j] = DEFAULT_VALUE;
36 res2.a[j] = DEFAULT_VALUE;
37 res3.a[j] = DEFAULT_VALUE;
38 }
39
40 res1.x = INTRINSIC (_extracti64x2_epi64) (s1.x, 1);
41 res2.x =
42 INTRINSIC (_mask_extracti64x2_epi64) (res2.x, mask, s1.x, 1);
43 res3.x = INTRINSIC (_maskz_extracti64x2_epi64) (mask, s1.x, 1);
44 CALC (s1.a, res_ref, 1);
45
46 if (check_union128i_q (res1, res_ref))
47 abort ();
48
49 MASK_MERGE (i_q) (res_ref, mask, 2);
50 if (check_union128i_q (res2, res_ref))
51 abort ();
52
53 MASK_ZERO (i_q) (res_ref, mask, 2);
54 if (check_union128i_q (res3, res_ref))
55 abort ();
56 }