2018-05-17 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / avx512f-vmovups-2.c
bloba937fd136b83380d8a00866b86e42d71f1e370a5
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 / 32)
10 #include "avx512f-mask-type.h"
12 void
13 TEST (void)
15 UNION_TYPE (AVX512F_LEN, ) res1, res2, res3, s2;
16 MASK_TYPE mask = MASK_VALUE;
17 float s1[SIZE];
18 float res4[SIZE];
19 float res5[SIZE];
20 int i, sign = 1;
22 for (i = 0; i < SIZE; i++)
24 s1[i] = 123.456 * (i + 2000) * sign;
25 s2.a[i] = 789.012 * (i + 3000) * sign;
26 res2.a[i] = DEFAULT_VALUE;
27 res5[i] = DEFAULT_VALUE;
28 sign = -sign;
31 res1.x = INTRINSIC (_loadu_ps) (s1);
32 res2.x = INTRINSIC (_mask_loadu_ps) (res2.x, mask, s1);
33 res3.x = INTRINSIC (_maskz_loadu_ps) (mask, s1);
34 INTRINSIC (_storeu_ps) (res4, s2.x);
35 INTRINSIC (_mask_storeu_ps) (res5, mask, s2.x);
37 if (UNION_CHECK (AVX512F_LEN, ) (res1, s1))
38 abort ();
40 MASK_MERGE () (s1, mask, SIZE);
41 if (UNION_CHECK (AVX512F_LEN, ) (res2, s1))
42 abort ();
44 MASK_ZERO () (s1, mask, SIZE);
45 if (UNION_CHECK (AVX512F_LEN, ) (res3, s1))
46 abort ();
48 if (UNION_CHECK (AVX512F_LEN, ) (s2, res4))
49 abort ();
51 MASK_MERGE () (s2.a, mask, SIZE);
52 if (UNION_CHECK (AVX512F_LEN, ) (s2, res5))
53 abort ();