public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-5696] RISC-V: testsuite: Fix popcount test.
@ 2023-11-21 20:10 Robin Dapp
  0 siblings, 0 replies; only message in thread
From: Robin Dapp @ 2023-11-21 20:10 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:638c2f3caf01b1b570b403235ad6a28bd8245fc6

commit r14-5696-g638c2f3caf01b1b570b403235ad6a28bd8245fc6
Author: Robin Dapp <rdapp@ventanamicro.com>
Date:   Mon Nov 20 17:12:14 2023 +0100

    RISC-V: testsuite: Fix popcount test.
    
    Due to Jakub's recent middle-end changes we now vectorize some more
    popcount instances.  This patch just adjusts the dump check.
    
    gcc/testsuite/ChangeLog:
    
            * gcc.target/riscv/rvv/autovec/unop/popcount.c: Adjust check.
            * lib/target-supports.exp: Add riscv_zbb.

Diff:
---
 gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/popcount.c | 10 +++++++++-
 gcc/testsuite/lib/target-supports.exp                      | 11 +++++++++++
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/popcount.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/popcount.c
index 585a522aa81..ca1319c2e7e 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/popcount.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/popcount.c
@@ -1461,4 +1461,12 @@ main ()
   RUN_ALL ()
 }
 
-/* { dg-final { scan-tree-dump-times "LOOP VECTORIZED" 229 "vect" } } */
+/* TODO: Due to an over-zealous check in tree-vect-patterns we do not vectorize
+   e.g.
+     uint64_t dst[];
+     uint32_t src[];
+     dst[i] = __builtin_popcountll (src[i]);
+   even though we could.  Therefore, for now, adjust the following checks.
+   This difference was exposed in r14-5557-g6dd4c703be17fa.  */
+/* { dg-final { scan-tree-dump-times "LOOP VECTORIZED" 229 "vect" { target { { rv64 } && { ! riscv_zbb } } } } } */
+/* { dg-final { scan-tree-dump-times "LOOP VECTORIZED" 250 "vect" { target { { rv32 } || { riscv_zbb } } } } } */
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index f3cd0311e27..87b2ae58720 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -1983,6 +1983,17 @@ proc check_effective_target_riscv_ztso { } {
     }]
 }
 
+# Return 1 if the target arch supports the Zbb extension, 0 otherwise.
+# Cache the result.
+
+proc check_effective_target_riscv_zbb { } {
+    return [check_no_compiler_messages riscv_ext_zbb assembly {
+       #ifndef __riscv_zbb
+       #error "Not __riscv_zbb"
+       #endif
+    }]
+}
+
 # Return 1 if we can execute code when using dg-add-options riscv_v
 
 proc check_effective_target_riscv_v_ok { } {

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-11-21 20:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-21 20:10 [gcc r14-5696] RISC-V: testsuite: Fix popcount test Robin Dapp

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).