From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2119) id 719A33858D38; Wed, 22 Nov 2023 05:08:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 719A33858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1700629732; bh=+HraVxL/f7ibRM7Bh3rMm0HKifARFGHDI886BnzMptE=; h=From:To:Subject:Date:From; b=ka+4Ztb416tRt4PKhK8K/CstYacY9SnRuvZpvmM3QZIbdZmRWx2khqjkBT8J0hDKZ xaiLST4kQoJceB7d8mX+3KTlXxv2XpQU56kLSDLpivDncR8Zy3+VmuqrTH/0hOC4wl Y1aof/O1kXzkh1EZe32GwrslJ80V+FYqjz7jdaak= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Jeff Law To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/vendors/riscv/heads/gcc-13-with-riscv-opts)] RISC-V: testsuite: Fix popcount test. X-Act-Checkin: gcc X-Git-Author: Robin Dapp X-Git-Refname: refs/vendors/riscv/heads/gcc-13-with-riscv-opts X-Git-Oldrev: d3e3bf1a2a845f3155878105e041ed3c3644ca6c X-Git-Newrev: c3e42f67eef84fa7d002f316a7a454ca169ab74d Message-Id: <20231122050852.719A33858D38@sourceware.org> Date: Wed, 22 Nov 2023 05:08:52 +0000 (GMT) List-Id: https://gcc.gnu.org/g:c3e42f67eef84fa7d002f316a7a454ca169ab74d commit c3e42f67eef84fa7d002f316a7a454ca169ab74d Author: Robin Dapp 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. (cherry picked from commit 638c2f3caf01b1b570b403235ad6a28bd8245fc6) 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 81725c3e412..e8bca8383ed 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -1941,6 +1941,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 { } {