public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "linkw at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug testsuite/108810] gcc.target/powerpc/fold-vec-extract-double.p9.c fails on power 9 BE
Date: Fri, 17 Feb 2023 06:14:12 +0000	[thread overview]
Message-ID: <bug-108810-4-uq9uH5fIHu@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-108810-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108810

Kewen Lin <linkw at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2023-02-17
             Status|UNCONFIRMED                 |NEW
          Component|target                      |testsuite
                 CC|                            |linkw at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Kewen Lin <linkw at gcc dot gnu.org> ---
This is an test case issue:

double
testd_cst (vector double vd2)
{
  return vec_extract (vd2, 1);
}

got xxlor on LE but xxpermdi on BE.

The scan insn xxlor is for the high order element, the index is 0 on BE and 1
on LE.

The below diff can fix it:

diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-double.p9.c
b/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-double.p9.c
index 6c515035d1a..100f680fd02 100644
--- a/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-double.p9.c
+++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-double.p9.c
@@ -18,9 +18,15 @@ testd_var (vector double vd2, signed int si)
   return vec_extract (vd2, si);
 }

+#ifdef __BIG_ENDIAN__
+#define HIGH_ORDER_ELEMENT_INDEX 0
+#else
+#define HIGH_ORDER_ELEMENT_INDEX 1
+#endif
+
 double
 testd_cst (vector double vd2)
 {
-  return vec_extract (vd2, 1);
+  return vec_extract (vd2, HIGH_ORDER_ELEMENT_INDEX);
 }

  reply	other threads:[~2023-02-17  6:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-15 22:01 [Bug target/108810] New: " seurer at gcc dot gnu.org
2023-02-17  6:14 ` linkw at gcc dot gnu.org [this message]
2023-03-08  6:59 ` [Bug testsuite/108810] " cvs-commit at gcc dot gnu.org
2023-03-08  7:53 ` linkw at gcc dot gnu.org
2023-03-08  7:53 ` linkw at gcc dot gnu.org

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=bug-108810-4-uq9uH5fIHu@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).