aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/avx512dq-vpmovq2m-2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.target/i386/avx512dq-vpmovq2m-2.c')
-rw-r--r--gcc/testsuite/gcc.target/i386/avx512dq-vpmovq2m-2.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/i386/avx512dq-vpmovq2m-2.c b/gcc/testsuite/gcc.target/i386/avx512dq-vpmovq2m-2.c
new file mode 100644
index 00000000000..24b3c552ac2
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx512dq-vpmovq2m-2.c
@@ -0,0 +1,43 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -mavx512dq -DAVX512DQ" } */
+/* { dg-require-effective-target avx512dq } */
+
+#include "avx512f-helper.h"
+
+#define SIZE (AVX512F_LEN / 64)
+#include "avx512f-mask-type.h"
+
+CALC (MASK_TYPE *r, long long *s1)
+{
+ int i;
+ MASK_TYPE res = 0;
+ MASK_TYPE one = 1;
+
+ for (i = 0; i < SIZE; i++)
+ if (s1[i] >> 63)
+ res = res | (one << i);
+
+ *r = res;
+}
+
+void
+TEST (void)
+{
+ int i, sign;
+ UNION_TYPE (AVX512F_LEN, i_q) src;
+ MASK_TYPE res, res_ref = 0;
+
+ sign = -1;
+ for (i = 0; i < SIZE; i++)
+ {
+ src.a[i] = 2 * i * sign;
+ sign = sign * -1;
+ }
+
+ res = INTRINSIC (_movepi64_mask) (src.x);
+
+ CALC (&res_ref, src.a);
+
+ if (res_ref != res)
+ abort ();
+}