public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Michael Meissner <meissner@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc(refs/users/meissner/heads/work053)] Fix vec-splati-runnable.c test.
Date: Tue, 18 May 2021 01:49:18 +0000 (GMT)	[thread overview]
Message-ID: <20210518014918.21B443853807@sourceware.org> (raw)

https://gcc.gnu.org/g:f0fd2398b057a0c6b5b3d4480f2c7d0ea969c3c5

commit f0fd2398b057a0c6b5b3d4480f2c7d0ea969c3c5
Author: Michael Meissner <meissner@linux.ibm.com>
Date:   Mon May 17 21:48:48 2021 -0400

    Fix vec-splati-runnable.c test.
    
    I noticed that the vec-splati-runnable.c did not have an abort after one
    of the tests.  If the test was run with optimization, the optimizer could
    delete some of the tests and throw off the count.
    
    gcc/testsuite/
    2021-05-17  Michael Meissner  <meissner@linux.ibm.com>
    
            * gcc.target/powerpc/vec-splati-runnable.c: Run test with -O2
            optimization.  Do not check what XXSPLTIDP generates if the value
            is undefined.

Diff:
---
 .../gcc.target/powerpc/vec-splati-runnable.c       | 29 +++++++---------------
 1 file changed, 9 insertions(+), 20 deletions(-)

diff --git a/gcc/testsuite/gcc.target/powerpc/vec-splati-runnable.c b/gcc/testsuite/gcc.target/powerpc/vec-splati-runnable.c
index e84ce77a21d..a135279b1d7 100644
--- a/gcc/testsuite/gcc.target/powerpc/vec-splati-runnable.c
+++ b/gcc/testsuite/gcc.target/powerpc/vec-splati-runnable.c
@@ -1,7 +1,7 @@
 /* { dg-do run { target { power10_hw } } } */
 /* { dg-do link { target { ! power10_hw } } } */
 /* { dg-require-effective-target power10_ok } */
-/* { dg-options "-mdejagnu-cpu=power10 -save-temps" } */
+/* { dg-options "-mdejagnu-cpu=power10 -save-temps -O2" } */
 #include <altivec.h>
 
 #define DEBUG 0
@@ -12,6 +12,8 @@
 
 extern void abort (void);
 
+volatile vector double vresult_d_undefined;
+
 int
 main (int argc, char *argv [])
 {
@@ -85,25 +87,12 @@ main (int argc, char *argv [])
 #endif
   }
 
-  /* This test will generate a "note" to the user that the argument
-     is subnormal.  It is not an error, but results are not defined.  */
-  vresult_d = (vector double) { 2.0, 3.0 };
-  expected_vresult_d = (vector double) { 6.6E-42f, 6.6E-42f };
-
-  vresult_d = vec_splatid (6.6E-42f);
-
-  /* Although the instruction says the results are not defined, it does seem
-     to work, at least on Mambo.  But no guarentees!  */
-  if (!vec_all_eq (vresult_d,  expected_vresult_d)) {
-#if DEBUG
-    printf("ERROR, vec_splati (6.6E-42f)\n");
-    for(i = 0; i < 2; i++)
-      printf(" vresult_d[%i] = %e, expected_vresult_d[%i] = %e\n",
-	     i, vresult_d[i], i, expected_vresult_d[i]);
-#else
-    ;
-#endif
-  }
+  /* This test will generate a "note" to the user that the argument is
+     subnormal.  It is not an error, but results are not defined.  Because this
+     is undefined, we cannot check that any value is correct.  Just store it in
+     a volatile variable so the XXSPLTIDP instruction gets generated and the
+     warning message printed. */
+  vresult_d_undefined = vec_splatid (6.6E-42f);
 
   /* Vector splat immediate */
   vsrc_a_int = (vector int) { 2, 3, 4, 5 };


                 reply	other threads:[~2021-05-18  1:49 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=20210518014918.21B443853807@sourceware.org \
    --to=meissner@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).