summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/avx512f-vcvtph2ps-2.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2014-01-04 17:57:29 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2014-01-04 17:57:29 +0000
commit48ff1d417d4c49525c09b013395e38dda8bd50fe (patch)
treeffb4ea05f14bc936b5dd3681e19b2aa3cee8c3bf /gcc/testsuite/gcc.target/i386/avx512f-vcvtph2ps-2.c
parent144409bbbdb293946cea105115e0e329f633d333 (diff)
downloadgcc-48ff1d417d4c49525c09b013395e38dda8bd50fe.tar.gz
2014-01-04 Basile Starynkevitch <basile@starynkevitch.net>
{{merge using svnmerge.py with trunk GCC 4.9 svn rev206333 now in stage 3; very unstable, xtramelt-ana-base don't compile anymore...}} git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@206336 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.target/i386/avx512f-vcvtph2ps-2.c')
-rw-r--r--gcc/testsuite/gcc.target/i386/avx512f-vcvtph2ps-2.c84
1 files changed, 84 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vcvtph2ps-2.c b/gcc/testsuite/gcc.target/i386/avx512f-vcvtph2ps-2.c
new file mode 100644
index 00000000000..725e1e87bb7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx512f-vcvtph2ps-2.c
@@ -0,0 +1,84 @@
+/* { 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"
+
+static void
+TEST (void)
+{
+ UNION_TYPE (AVX512F_LEN_HALF, i_w) val;
+ UNION_TYPE (AVX512F_LEN,) res1,res2,res3;
+ MASK_TYPE mask = MASK_VALUE;
+ float exp[SIZE];
+ int i;
+
+ for (i = 0; i < SIZE; i++)
+ {
+ res1.a[i] = DEFAULT_VALUE;
+ res2.a[i] = DEFAULT_VALUE;
+ res3.a[i] = DEFAULT_VALUE;
+ }
+
+ exp[0] = 1;
+ exp[1] = 2;
+ exp[2] = 4;
+ exp[3] = 8;
+#if AVX512F_LEN > 128
+ exp[4] = -1;
+ exp[5] = -2;
+ exp[6] = -4;
+ exp[7] = -8;
+#endif
+#if AVX512F_LEN > 256
+ exp[8] = 1;
+ exp[9] = 2;
+ exp[10] = 4;
+ exp[11] = 8;
+ exp[12] = -1;
+ exp[13] = -2;
+ exp[14] = -4;
+ exp[15] = -8;
+#endif
+
+ val.a[0] = 0x3c00;
+ val.a[1] = 0x4000;
+ val.a[2] = 0x4400;
+ val.a[3] = 0x4800;
+#if AVX512F_LEN > 128
+ val.a[4] = 0xbc00;
+ val.a[5] = 0xc000;
+ val.a[6] = 0xc400;
+ val.a[7] = 0xc800;
+#endif
+#if AVX512F_LEN > 256
+ val.a[8] = 0x3c00;
+ val.a[9] = 0x4000;
+ val.a[10] = 0x4400;
+ val.a[11] = 0x4800;
+ val.a[12] = 0xbc00;
+ val.a[13] = 0xc000;
+ val.a[14] = 0xc400;
+ val.a[15] = 0xc800;
+#endif
+
+ res1.x = _mm512_cvtph_ps (val.x);
+ res2.x = _mm512_mask_cvtph_ps (res2.x, mask, val.x);
+ res3.x = _mm512_maskz_cvtph_ps (mask, val.x);
+
+ if (UNION_CHECK (AVX512F_LEN,) (res1, exp))
+ abort ();
+
+ MASK_MERGE () (exp, mask, SIZE);
+ if (UNION_CHECK (AVX512F_LEN,) (res2, exp))
+ abort ();
+
+ MASK_ZERO () (exp, mask, SIZE);
+ if (UNION_CHECK (AVX512F_LEN,) (res3, exp))
+ abort ();
+}