From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 096173858431; Fri, 5 Apr 2024 13:47:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 096173858431 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1712324848; bh=krXNaNMxAa1wlNC5W7nGEE7dSGFSaejrkvNYVIMK5/A=; h=From:To:Subject:Date:In-Reply-To:References:From; b=LU9a1hOCmFxkpZllZvUC3Ux7VIoQ8q1bCpgHWOkfaYq1yjP0WahZ52WhjXn/uYIc8 KDSBC+rspHV6SkGWIjvoFA+HgdXcF2wZbs85BbWR3CsNgXIFwTVf8SCKdgPzk0EDKQ HsRSfF0JIhaLMAiHdloOmcODlCOLUwflFzqiTHnA= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/114603] aarch64: Invalid SVE cnot optimisation Date: Fri, 05 Apr 2024 13:47:26 +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: wrong-code 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=3D114603 --- Comment #1 from GCC Commits --- The trunk branch has been updated by Richard Sandiford : https://gcc.gnu.org/g:67cbb1c638d6ab3a9cb77e674541e2b291fb67df commit r14-9811-g67cbb1c638d6ab3a9cb77e674541e2b291fb67df Author: Richard Sandiford Date: Fri Apr 5 14:47:15 2024 +0100 aarch64: Fix bogus cnot optimisation [PR114603] aarch64-sve.md had a pattern that combined: cmpeq pb.T, pa/z, zc.T, #0 mov zd.T, pb/z, #1 into: cnot zd.T, pa/m, zc.T But this is only valid if pa.T is a ptrue. In other cases, the original would set inactive elements of zd.T to 0, whereas the combined form would copy elements from zc.T. gcc/ PR target/114603 * config/aarch64/aarch64-sve.md (@aarch64_pred_cnot): Rep= lace with... (@aarch64_ptrue_cnot): ...this, requiring operand 1 to be a ptrue. (*cnot): Require operand 1 to be a ptrue. * config/aarch64/aarch64-sve-builtins-base.cc (svcnot_impl::expand): Use aarch64_ptrue_cnot for _x operations that are predica= ted with a ptrue. Represent other _x operations as fully-defined _m operations. gcc/testsuite/ PR target/114603 * gcc.target/aarch64/sve/acle/general/cnot_1.c: New test.=