From: "Kewen.Lin" <linkw@linux.ibm.com>
To: GCC Patches <gcc-patches@gcc.gnu.org>
Cc: Segher Boessenkool <segher@kernel.crashing.org>,
Richard Biener <richard.guenther@gmail.com>,
David Edelsohn <dje.gcc@gmail.com>,
Richard Sandiford <richard.sandiford@arm.com>
Subject: [PATCH] rs6000/test: Adjust pr104992.c with vect_int_mod [PR106516]
Date: Wed, 24 Aug 2022 16:17:55 +0800 [thread overview]
Message-ID: <1fb4035e-a15e-5031-3b2f-9ba5dfcb1786@linux.ibm.com> (raw)
Hi,
As PR106516 shows, we can get unexpected gimple outputs for
function thud on some target which supports modulus operation
for vector int. This patch introduces one effective target
vect_int_mod for it, then adjusts the test case with it.
Tested on x86_64-redhat-linux and powerpc64{,le}-linux-gnu,
especially powerpc64le Power10.
Is it ok for trunk?
BR,
Kewen
-----
PR testsuite/106516
gcc/testsuite/ChangeLog:
* gcc.dg/pr104992.c: Adjust with vect_int_mod.
* lib/target-supports.exp (check_effective_target_vect_int_mod): New
proc for effective target vect_int_mod.
---
gcc/testsuite/gcc.dg/pr104992.c | 3 ++-
gcc/testsuite/lib/target-supports.exp | 8 ++++++++
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/gcc/testsuite/gcc.dg/pr104992.c b/gcc/testsuite/gcc.dg/pr104992.c
index 217c89a458c..82f8c75559c 100644
--- a/gcc/testsuite/gcc.dg/pr104992.c
+++ b/gcc/testsuite/gcc.dg/pr104992.c
@@ -54,4 +54,5 @@ __attribute__((noipa)) unsigned waldo (unsigned x, unsigned y, unsigned z) {
return x / y * z == x;
}
-/* { dg-final {scan-tree-dump-times " % " 9 "optimized" } } */
+/* { dg-final { scan-tree-dump-times " % " 9 "optimized" { target { ! vect_int_mod } } } } */
+/* { dg-final { scan-tree-dump-times " % " 6 "optimized" { target vect_int_mod } } } */
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 04a2a8e8659..a4bdd23bed0 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -8239,6 +8239,14 @@ proc check_effective_target_vect_long_mult { } {
return $answer
}
+# Return 1 if the target supports vector int modulus, 0 otherwise.
+
+proc check_effective_target_vect_int_mod { } {
+ return [check_cached_effective_target_indexed vect_int_mod {
+ expr { [istarget powerpc*-*-*]
+ && [check_effective_target_power10_ok] }}]
+}
+
# Return 1 if the target supports vector even/odd elements extraction, 0 otherwise.
proc check_effective_target_vect_extract_even_odd { } {
--
2.27.0
next reply other threads:[~2022-08-24 8:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-24 8:17 Kewen.Lin [this message]
2022-09-28 5:35 ` PING^1 " Kewen.Lin
2022-09-28 15:00 ` Segher Boessenkool
2022-09-28 14:55 ` Segher Boessenkool
2022-09-30 12:25 ` Kewen.Lin
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=1fb4035e-a15e-5031-3b2f-9ba5dfcb1786@linux.ibm.com \
--to=linkw@linux.ibm.com \
--cc=dje.gcc@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=richard.guenther@gmail.com \
--cc=richard.sandiford@arm.com \
--cc=segher@kernel.crashing.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).