public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: David Malcolm <dmalcolm@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-1821] jit: fix test-vector-* failures
Date: Fri, 25 Jun 2021 23:09:08 +0000 (GMT)	[thread overview]
Message-ID: <20210625230908.90ABC3853828@sourceware.org> (raw)

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,


                 reply	other threads:[~2021-06-25 23:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210625230908.90ABC3853828@sourceware.org \
    --to=dmalcolm@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).