Rebase.
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / avx512f-vmovdqa64-2.c
blob2a7136fb1934cf0084a8020b77940b8751159cc8
1 /* { dg-do run } */
2 /* { dg-options "-O2 -mavx512f" } */
3 /* { dg-require-effective-target avx512f } */
5 #define AVX512F
7 #include "avx512f-helper.h"
9 #define SIZE ((AVX512F_LEN) / 64)
10 #include "avx512f-mask-type.h"
11 #define ALIGN ((AVX512F_LEN) / 8)
13 void
14 TEST (void)
16 UNION_TYPE (AVX512F_LEN, i_q) s2, s3, res1, res3, res4, res5, res6;
17 MASK_TYPE mask = MASK_VALUE;
18 long long s1[SIZE] __attribute__ ((aligned (ALIGN)));
19 long long res2[SIZE] __attribute__ ((aligned (ALIGN)));
20 long long res7[SIZE] __attribute__ ((aligned (ALIGN)));
21 int i, sign = 1;
23 for (i = 0; i < SIZE; i++)
25 s1[i] = 1234 * (i + 2000) * sign;
26 s2.a[i] = 5678 * (i - 30) * sign;
27 s3.a[i] = 9012 * (i + 40) * sign;
28 res3.a[i] = DEFAULT_VALUE;
29 res5.a[i] = DEFAULT_VALUE;
30 res7[i] = DEFAULT_VALUE;
31 sign = -sign;
34 #if AVX512F_LEN == 512
35 res1.x = INTRINSIC (_load_epi64) (s1);
36 INTRINSIC (_store_epi64) (res2, s2.x);
37 #endif
38 res3.x = INTRINSIC (_mask_mov_epi64) (res3.x, mask, s3.x);
39 res4.x = INTRINSIC (_maskz_mov_epi64) (mask, s3.x);
40 res5.x = INTRINSIC (_mask_load_epi64) (res5.x, mask, s1);
41 res6.x = INTRINSIC (_maskz_load_epi64) (mask, s1);
42 INTRINSIC (_mask_store_epi64) (res7, mask, s2.x);
44 #if AVX512F_LEN == 512
45 if (UNION_CHECK (AVX512F_LEN, i_q) (res1, s1))
46 abort ();
48 if (UNION_CHECK (AVX512F_LEN, i_q) (s2, res2))
49 abort ();
50 #endif
52 MASK_MERGE (i_q) (s3.a, mask, SIZE);
53 if (checkVl (res3.a, s3.a, SIZE))
54 abort ();
56 MASK_ZERO (i_q) (s3.a, mask, SIZE);
57 if (checkVl (res4.a, s3.a, SIZE))
58 abort ();
60 MASK_MERGE (i_q) (s1, mask, SIZE);
61 if (UNION_CHECK (AVX512F_LEN, i_q) (res5, s1))
62 abort ();
64 MASK_ZERO (i_q) (s1, mask, SIZE);
65 if (UNION_CHECK (AVX512F_LEN, i_q) (res6, s1))
66 abort ();
68 MASK_MERGE (i_q) (s2.a, mask, SIZE);
69 if (UNION_CHECK (AVX512F_LEN, i_q) (s2, res7))
70 abort ();