aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vcvtph2ps-2.c
diff options
context:
space:
mode:
authorBen Cheng <bccheng@google.com>2014-03-26 05:37:19 (GMT)
committerBen Cheng <bccheng@google.com>2014-03-26 05:37:19 (GMT)
commit1bc5aee63eb72b341f506ad058502cd0361f0d10 (patch)
treec607e8252f3405424ff15bc2d00aa38dadbb2518 /gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vcvtph2ps-2.c
parent283a0bf58fcf333c58a2a92c3ebbc41fb9eb1fdb (diff)
downloadtoolchain_gcc-1bc5aee63eb72b341f506ad058502cd0361f0d10.zip
toolchain_gcc-1bc5aee63eb72b341f506ad058502cd0361f0d10.tar.gz
toolchain_gcc-1bc5aee63eb72b341f506ad058502cd0361f0d10.tar.bz2
Initial checkin of GCC 4.9.0 from trunk (r208799).
Change-Id: I48a3c08bb98542aa215912a75f03c0890e497dba
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vcvtph2ps-2.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vcvtph2ps-2.c84
1 files changed, 84 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vcvtph2ps-2.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vcvtph2ps-2.c
new file mode 100644
index 0000000..725e1e8
--- /dev/null
+++ b/gcc-4.9/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 ();
+}