public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-1821] jit: fix test-vector-* failures
@ 2021-06-25 23:09 David Malcolm
0 siblings, 0 replies; only message in thread
From: David Malcolm @ 2021-06-25 23:09 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:99585d88a090b4c5b7791f7ab62f70eb37b748fa
commit r12-1821-g99585d88a090b4c5b7791f7ab62f70eb37b748fa
Author: David Malcolm <dmalcolm@redhat.com>
Date: Fri Jun 25 19:07:30 2021 -0400
jit: fix test-vector-* failures
Fix failures seen on i686 due to relying on exact floating-point
equality when testing results of vector division.
gcc/testsuite/ChangeLog:
* jit.dg/test-vector-rvalues.cc (check_div): Add specialization
for v4f, to avoid relying on exact floating-point equality.
* jit.dg/test-vector-types.cc (check_div): Likewise.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Diff:
---
gcc/testsuite/jit.dg/test-vector-rvalues.cc | 8 ++++++++
gcc/testsuite/jit.dg/test-vector-types.cc | 8 ++++++++
2 files changed, 16 insertions(+)
diff --git a/gcc/testsuite/jit.dg/test-vector-rvalues.cc b/gcc/testsuite/jit.dg/test-vector-rvalues.cc
index ac230bf774c..02877114e4a 100644
--- a/gcc/testsuite/jit.dg/test-vector-rvalues.cc
+++ b/gcc/testsuite/jit.dg/test-vector-rvalues.cc
@@ -165,6 +165,14 @@ check_div (const V &a, const V &b, const V &c)
CHECK_VALUE (c[i], a[i] / b[i]);
}
+template <>
+void
+check_div<v4f> (const v4f &a, const v4f &b, const v4f &c)
+{
+ for (int i = 0; i < 4; i++)
+ CHECK_DOUBLE_VALUE (c[i], a[i] / b[i]);
+}
+
template <typename V, typename E>
void
verify_vec_code (gcc_jit_context *ctxt, gcc_jit_result *result,
diff --git a/gcc/testsuite/jit.dg/test-vector-types.cc b/gcc/testsuite/jit.dg/test-vector-types.cc
index 3389e04a082..1f49be6b59f 100644
--- a/gcc/testsuite/jit.dg/test-vector-types.cc
+++ b/gcc/testsuite/jit.dg/test-vector-types.cc
@@ -139,6 +139,14 @@ check_div (const T &a, const T &b, const T &c)
CHECK_VALUE (c[i], a[i] / b[i]);
}
+template <>
+void
+check_div<v4f> (const v4f &a, const v4f &b, const v4f &c)
+{
+ for (int i = 0; i < 4; i++)
+ CHECK_DOUBLE_VALUE (c[i], a[i] / b[i]);
+}
+
template <typename T>
void
verify_vec_code (gcc_jit_context *ctxt, gcc_jit_result *result,
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-06-25 23:09 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-25 23:09 [gcc r12-1821] jit: fix test-vector-* failures David Malcolm
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).