From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 533A43858C60; Thu, 23 Dec 2021 08:58:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 533A43858C60 From: "ubizjak at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/103797] Clang vectorized LightPixel while GCC does not Date: Thu, 23 Dec 2021 08:58:48 +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: unknown X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: ubizjak at gmail dot com X-Bugzilla-Status: NEW 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Dec 2021 08:58:48 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103797 --- Comment #14 from Uro=C5=A1 Bizjak --- (In reply to Uro=C5=A1 Bizjak from comment #13) > Created attachment 52051 [details] > Patch that implements v2sf division This patch also enables vectorization of the testcase from Comment #7. Using -ffast-math, it also generates vectorized reciprocal: movss f(%rip), %xmm4 movss test+8(%rip), %xmm3 movq test(%rip), %xmm2 mulss %xmm4, %xmm3 movaps %xmm4, %xmm0 shufps $0xe0, %xmm0, %xmm0 mulps %xmm0, %xmm2 movhps .LC0(%rip), %xmm0 --> rcpps %xmm0, %xmm1 sqrtss %xmm3, %xmm3 mulps %xmm1, %xmm0 sqrtps %xmm2, %xmm2 divss %xmm4, %xmm3 movaps %xmm2, %xmm5 mulps %xmm1, %xmm0 addps %xmm1, %xmm1 subps %xmm0, %xmm1 mulps %xmm1, %xmm5 movlps %xmm5, test(%rip) movss %xmm3, test+8(%rip) ret=