From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0C9D63856964; Tue, 18 Apr 2023 09:02:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0C9D63856964 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1681808554; bh=bFNf8i+j444NKWlFhctm1CZVjdE/PspPM67iaR8A/yk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=JVM7xEIJL5OfxwbE1lSM42AbesgOTf/in+QmCVZSO1O5ePk09KNq7whHxXgDtaUbI nfqhlBf74lN10QerlngI1YNf+0f8Iw97EU+hDUUokwBRLR7LTIf/pOyydZtENMBNq8 +/rN0/wrmL1kx+K62b3QEehOuJSu7vKuxTxp0xSI= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/109240] Missed fneg/fsub optimization Date: Tue, 18 Apr 2023 09:02:33 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jakub 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=3D109240 --- Comment #3 from CVS Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:2349e69125335d4c8c5e43cf3643844519d154c3 commit r14-22-g2349e69125335d4c8c5e43cf3643844519d154c3 Author: Jakub Jelinek Date: Tue Apr 18 11:01:47 2023 +0200 match.pd: Improve fneg/fadd optimization [PR109240] match.pd has mostly for AArch64 an optimization in which it optimizes certain forms of __builtin_shuffle of x + y and x - y vectors into fneg using twice as wide element type so that every other sign is chang= ed, followed by fadd. The following patch extends that optimization, so that it can handle other forms as well, using the same fneg but fsub instead of fadd. As the plus is commutative and minus is not and I want to handle vec_perm with plus minus and minus plus order preferrably in one pattern, I had to do the matching operand checks by hand. 2023-04-18 Jakub Jelinek PR tree-optimization/109240 * match.pd (fneg/fadd): Rewrite such that it handles both plus = as first vec_perm operand and minus as second using fneg/fadd and minus as first vec_perm operand and plus as second using fneg/f= sub. * gcc.target/aarch64/simd/addsub_2.c: New test. * gcc.target/aarch64/sve/addsub_2.c: New test.=