From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6E6113858404; Fri, 8 Dec 2023 17:07:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6E6113858404 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1702055263; bh=GS/hEblBw3co8Y3B8/Uk8P7quY+bq0XPhB8NFW4mxHg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Le1HuLiHU/Pb6/M9NIrVujjPevcXieW/L7H8aHnFJpfy5uhsPnV2Xg24qu7r00pus 0vNHLK18d2Lf7aa1aEdv4uJ8i+tyzcpJMQQyM5Yeii6vl1lHKb4tmQ5Oon8Up6F9ol zZ06HLHTeeECRMfRJGoKadKemVjLwRbzlHKhr8bY= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/112109] Missing riscv vectorized strcmp (and other) expanders Date: Fri, 08 Dec 2023 17:07:42 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D112109 --- Comment #2 from GCC Commits --- The master branch has been updated by Robin Dapp : https://gcc.gnu.org/g:2664964b2f695e947faea4c29dbddd3615cc4b0b commit r14-6340-g2664964b2f695e947faea4c29dbddd3615cc4b0b Author: Robin Dapp Date: Fri Dec 1 09:57:15 2023 +0100 RISC-V: Add vectorized strlen. This patch implements a vectorized strlen by re-using and slightly adjusting the rawmemchr implementation. Rawmemchr returns the address of the needle while strlen returns the difference between needle address and start address. As before, strlen expansion is guarded by -minline-strlen. While testing with -minline-strlen I encountered a vsetvl problem in memcpy-chk.c where we didn't insert a vsetvl at the proper spot (after a setjmp). This needs to be fixed separately and I figured I'd post this patch as-is. gcc/ChangeLog: PR target/112109 * config/riscv/riscv-protos.h (expand_rawmemchr): Add strlen parameter. * config/riscv/riscv-string.cc (riscv_expand_strlen): Call rawmemchr. (expand_rawmemchr): Add strlen handling. * config/riscv/riscv.md: Add TARGET_VECTOR to strlen expander. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/builtin/strlen-run.c: New test. * gcc.target/riscv/rvv/autovec/builtin/strlen.c: New test.=