summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/avx512f-vpbroadcastd-2.c
diff options
context:
space:
mode:
authormrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>2014-01-03 23:45:56 +0000
committermrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>2014-01-03 23:45:56 +0000
commitfe644b69d013e77c7fc2db2a9863969d4f564561 (patch)
treea2cb1398bd46b8decaea84f1b7de8c7cd35e6046 /gcc/testsuite/gcc.target/i386/avx512f-vpbroadcastd-2.c
parent90079d10dd355193fe289fa0bfcb0d7be880d45a (diff)
parent04e0495a6da35f3b0bcedbd75908cb6e9ba8ff8f (diff)
downloadgcc-fe644b69d013e77c7fc2db2a9863969d4f564561.tar.gz
Merge in trunk.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/wide-int@206327 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.target/i386/avx512f-vpbroadcastd-2.c')
-rw-r--r--gcc/testsuite/gcc.target/i386/avx512f-vpbroadcastd-2.c72
1 files changed, 72 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vpbroadcastd-2.c b/gcc/testsuite/gcc.target/i386/avx512f-vpbroadcastd-2.c
new file mode 100644
index 00000000000..67bd3ac2d38
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx512f-vpbroadcastd-2.c
@@ -0,0 +1,72 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -mavx512f" } */
+/* { dg-require-effective-target avx512f } */
+
+#define AVX512F
+
+#include "avx512f-helper.h"
+
+#define SIZE (AVX512F_LEN / 32)
+#include "avx512f-mask-type.h"
+
+CALC (int *r, int *s)
+{
+ int i;
+ for (i = 0; i < SIZE; i++)
+ {
+ r[i] = s[0];
+ }
+}
+
+void static
+TEST (void)
+{
+ int i, sign;
+ UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3;
+ UNION_TYPE (128, i_d) src;
+ MASK_TYPE mask = MASK_VALUE;
+ int res_ref[SIZE];
+
+ sign = -1;
+ for (i = 0; i < 4; i++)
+ {
+ src.a[i] = 1 + 34 * i * sign;
+ sign = sign * -1;
+ }
+ for (i = 0; i < SIZE; i++)
+ res2.a[i] = DEFAULT_VALUE;
+
+ res1.x = INTRINSIC (_broadcastd_epi32) (src.x);
+ res2.x = INTRINSIC (_mask_broadcastd_epi32) (res2.x, mask, src.x);
+ res3.x = INTRINSIC (_maskz_broadcastd_epi32) (mask, src.x);
+
+ CALC (res_ref, src.a);
+
+ if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref))
+ abort ();
+
+ MASK_MERGE (i_d) (res_ref, mask, SIZE);
+ if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref))
+ abort ();
+
+ MASK_ZERO (i_d) (res_ref, mask, SIZE);
+ if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref))
+ abort ();
+
+ res1.x = INTRINSIC (_set1_epi32) (src.a[0]);
+ res2.x = INTRINSIC (_mask_set1_epi32) (res2.x, mask, src.a[0]);
+ res3.x = INTRINSIC (_maskz_set1_epi32) (mask, src.a[0]);
+
+ CALC (res_ref, src.a);
+
+ if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref))
+ abort ();
+
+ MASK_MERGE (i_d) (res_ref, mask, SIZE);
+ if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref))
+ abort ();
+
+ MASK_ZERO (i_d) (res_ref, mask, SIZE);
+ if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref))
+ abort ();
+}