aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorCarl Love <cel@us.ibm.com>2018-10-25 20:41:57 +0000
committerCarl Love <carll@gcc.gnu.org>2018-10-25 20:41:57 +0000
commitfc756f9f460d5f0ec73a72128645fdb39fec77a0 (patch)
tree4c5e02855679f944ada590857fc36fde03a6d91e /gcc/testsuite
parent80a2dd51defd8933d425927f8c77d71bb4496620 (diff)
downloadgcc-fc756f9f460d5f0ec73a72128645fdb39fec77a0.zip
gcc-fc756f9f460d5f0ec73a72128645fdb39fec77a0.tar.gz
gcc-fc756f9f460d5f0ec73a72128645fdb39fec77a0.tar.bz2
rs6000-c.c (P9V_BUILTIN_VEC_VSCEDPGT, [...]): Rename base overloaded name.
gcc/ChangeLog: 2018-10-25 Carl Love <cel@us.ibm.com> * config/rs6000/rs6000-c.c (P9V_BUILTIN_VEC_VSCEDPGT, P9V_BUILTIN_VEC_VSCEDPLT, P9V_BUILTIN_VEC_VSCEDPEQ, P9V_BUILTIN_VEC_VSCEDPUO): Rename base overloaded name. Add quad precicion entry for each overloaded builtin. * config/rs6000/rs6000-builtin.def (VSCEDPGT, VSCEDPLT, VSCEDPEQ, VSCEDPUO): Rename overloaded name. (VSCEDPGT, VSCEQPGT, VSCEDPLT, VSCEQPLT, VSCEDPEQ, VSCEQPEQ, VSCEDPUO, VSCEQPUO): Add defitions for overloaded builtins. * config/rs6000/vsx.md (xscmpexpqp_<code>_<mode>): Add define_expand for xscmpexqp instruction. (*xscmpexpqp): Add define_insn for the xscmpexqp instruction. gcc/testsuite/ChangeLog: 2018-10-25 Carl Love <cel@us.ibm.com> * gcc.target/powerpc/float128-cmp2-runnable.c: New test file. From-SVN: r265509
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.target/powerpc/float128-cmp2-runnable.c277
2 files changed, 281 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 6dacfa9..0b45310 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2018-10-25 Carl Love <cel@us.ibm.com>
+
+ * gcc.target/powerpc/float128-cmp2-runnable.c: New test file.
+
2018-10-25 Martin Liska <mliska@suse.cz>
PR testsuite/87739
diff --git a/gcc/testsuite/gcc.target/powerpc/float128-cmp2-runnable.c b/gcc/testsuite/gcc.target/powerpc/float128-cmp2-runnable.c
new file mode 100644
index 0000000..1c316ba
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/float128-cmp2-runnable.c
@@ -0,0 +1,277 @@
+/* { dg-do run { target { powerpc*-*-* && p9vector_hw } } } */
+/* { dg-options "-O2 -mcpu=power9 " } */
+
+#define NAN_Q __builtin_nanq ("")
+#define SNAN_Q __builtin_nansq ("")
+#define NAN __builtin_nan ("")
+#define SNAN __builtin_nans ("")
+
+#ifdef DEBUG
+#include <stdio.h>
+#endif
+
+void abort (void);
+
+int main(void)
+{
+ int result;
+ double a_dble, b_dble;
+ __ieee128 a_ieee128, b_ieee128;
+
+ a_dble = 3.10;
+ b_dble = 3.10;
+
+ if (__builtin_vec_scalar_cmp_exp_eq(a_dble, b_dble))
+#ifdef DEBUG
+ printf("Double EQ result is true, expecting true\n");
+#else
+ ;
+#endif
+ else
+#ifdef DEBUG
+ printf("ERROR: Double EQ result is false, expecting true\n");
+#else
+ abort();
+#endif
+
+ a_dble = 3.10;
+ b_dble = 31.0;
+
+ if (__builtin_vec_scalar_cmp_exp_eq(a_dble, b_dble))
+#ifdef DEBUG
+ printf("ERROR: Double EQ result is true, expecting false\n");
+#else
+ abort();
+#endif
+ else
+#ifdef DEBUG
+ printf("Double EQ result is false, expecting false\n");
+#else
+ ;
+#endif
+
+ a_dble = 3.10;
+ b_dble = 3.10;
+
+ if (__builtin_vec_scalar_cmp_exp_lt(a_dble, b_dble))
+#ifdef DEBUG
+ printf("ERROR: Double LT result is true, expecting false\n");
+#else
+ abort();
+#endif
+ else
+#ifdef DEBUG
+ printf("Double LT result is false, expecting false\n");
+#else
+ ;
+#endif
+
+ a_dble = 0.31;
+ b_dble = 3.10;
+
+ if (__builtin_vec_scalar_cmp_exp_lt(a_dble, b_dble))
+#ifdef DEBUG
+ printf("Double LT result is true, expecting true\n");
+#else
+ ;
+#endif
+ else
+#ifdef DEBUG
+ printf("ERROR: Double LT result is false, expecting true\n");
+#else
+ abort();
+#endif
+
+ a_dble = 0.31;
+ b_dble = 3.10;
+
+ if (__builtin_vec_scalar_cmp_exp_gt(a_dble, b_dble))
+#ifdef DEBUG
+ printf("ERROR: Double GT result is true, expecting false\n");
+#else
+ abort();
+#endif
+ else
+#ifdef DEBUG
+ printf("Double GT result is false, expecting false\n");
+#else
+ ;
+#endif
+
+ a_dble = 3.10;
+ b_dble = 0.31;
+
+ if (__builtin_vec_scalar_cmp_exp_gt(a_dble, b_dble))
+#ifdef DEBUG
+ printf("Double GT result is true, expecting true\n");
+#else
+ ;
+#endif
+ else
+#ifdef DEBUG
+ printf("ERROR: Double GT result is false, expecting true\n");
+#else
+ abort();
+#endif
+
+ a_dble = NAN;
+ b_dble = NAN;
+
+ if (__builtin_vec_scalar_cmp_exp_unordered(a_dble, b_dble))
+#ifdef DEBUG
+ printf("Double unordered result is true, expecting true\n");
+#else
+ ;
+#endif
+ else
+#ifdef DEBUG
+ printf("ERROR: Double unordered result is false, expecting true\n");
+#else
+ abort();
+#endif
+
+ a_dble = 3.10;
+ b_dble = 3.10;
+
+ if (__builtin_vec_scalar_cmp_exp_unordered(a_dble, b_dble))
+#ifdef DEBUG
+ printf("ERROR: Double unordered result is true, expecting false\n");
+#else
+ abort();
+#endif
+ else
+#ifdef DEBUG
+ printf("Double unordered result is false, expecting false\n");
+#else
+ ;
+#endif
+
+ /* IEEE 128 */
+ a_ieee128 = 3.10;
+ b_ieee128 = 3.10;
+
+ if (__builtin_vec_scalar_cmp_exp_eq(a_ieee128, b_ieee128))
+#ifdef DEBUG
+ printf("IEEE 128 EQ result is true, expecting true\n");
+#else
+ ;
+#endif
+ else
+#ifdef DEBUG
+ printf("ERROR: IEEE 128 EQ result is false, expecting true\n");
+#else
+ abort();
+#endif
+
+ a_ieee128 = 3.10;
+ b_ieee128 = 31.0;
+
+ if (__builtin_vec_scalar_cmp_exp_eq(a_ieee128, b_ieee128))
+#ifdef DEBUG
+ printf("ERROR: IEEE 128 EQ result is true, expecting false\n");
+#else
+ abort();
+#endif
+ else
+#ifdef DEBUG
+ printf("IEEE 128 EQ result is false, expecting false\n");
+#else
+ ;
+#endif
+
+ a_ieee128 = 3.10;
+ b_ieee128 = 3.10;
+
+ if (__builtin_vec_scalar_cmp_exp_lt(a_ieee128, b_ieee128))
+#ifdef DEBUG
+ printf("ERROR: IEEE 128 LT result is true, expecting false\n");
+#else
+ abort();
+#endif
+ else
+#ifdef DEBUG
+ printf("IEEE 128 LT result is false, expecting false\n");
+#else
+ ;
+#endif
+
+ a_ieee128 = 0.31;
+ b_ieee128 = 3.10;
+
+ if (__builtin_vec_scalar_cmp_exp_lt(a_ieee128, b_ieee128))
+#ifdef DEBUG
+ printf("IEEE 128 LT result is true, expecting true\n");
+#else
+ ;
+#endif
+ else
+#ifdef DEBUG
+ printf("ERROR: IEEE 128 LT result is false, expecting true\n");
+#else
+ abort();
+#endif
+
+ a_ieee128 = 0.31;
+ b_ieee128 = 3.10;
+
+ if (__builtin_vec_scalar_cmp_exp_gt(a_ieee128, b_ieee128))
+#ifdef DEBUG
+ printf("ERROR: IEEE 128 GT result is true, expecting false\n");
+#else
+ abort();
+#endif
+ else
+#ifdef DEBUG
+ printf("IEEE 128 GT result is false, expecting false\n");
+#else
+ ;
+#endif
+
+ a_ieee128 = 3.10;
+ b_ieee128 = 0.31;
+
+ if (__builtin_vec_scalar_cmp_exp_gt(a_ieee128, b_ieee128))
+#ifdef DEBUG
+ printf("IEEE 128 GT result is true, expecting true\n");
+#else
+ ;
+#endif
+ else
+#ifdef DEBUG
+ printf("ERROR: IEEE 128 GT result is false, expecting true\n");
+#else
+ abort();
+#endif
+
+ a_ieee128 = NAN_Q;
+ b_ieee128 = NAN_Q;
+
+ if (__builtin_vec_scalar_cmp_exp_unordered(a_ieee128, b_ieee128))
+#ifdef DEBUG
+ printf("IEEE unordered result is true, expecting true\n");
+#else
+ ;
+#endif
+ else
+#ifdef DEBUG
+ printf("ERROR: IEEE unordered result is false, expecting true\n");
+#else
+ abort();
+#endif
+
+ a_ieee128 = 3.10;
+ b_ieee128 = 3.10;
+
+ if (__builtin_vec_scalar_cmp_exp_unordered(a_ieee128, b_ieee128))
+#ifdef DEBUG
+ printf("ERROR: IEEE unordered result is true, expecting false\n");
+#else
+ abort();
+#endif
+ else
+#ifdef DEBUG
+ printf("IEEE unordered result is false, expecting false\n");
+#else
+ ;
+#endif
+}