From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 703CB3858433; Thu, 28 Mar 2024 23:09:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 703CB3858433 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1711667368; bh=CXEZijmvbRkXXG0PxCzLTpGhBPc+wylhMXHXl43j6mM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=jN1gezy8FKf+UFyTcL0uKb72dZynQ1MDylQhXRCSRFgcrP4xLhUhRBT6QiLxlpaC7 ilGAUcyzXpukuFra3MW4Nxshd1ykaMpJ+u4V1kwmny0J097Qz0DXyAo8aa19A0awQw oArKaXlU76+lHX/K/qWKYCKQeOnl9vRPT+mGK8z4= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/114514] v16qi >> 7 can be optimized with vpcmpgtb Date: Thu, 28 Mar 2024 23:09:28 +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: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: pinskia at gcc dot gnu.org 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: bug_severity cf_reconfirmed_on cc everconfirmed bug_status 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=3D114514 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |enhancement Last reconfirmed| |2024-03-28 CC| |pinskia at gcc dot gnu.org Ever confirmed|0 |1 Status|UNCONFIRMED |NEW --- Comment #1 from Andrew Pinski --- Confirmed. Note non sign bit can be improved too: ``` #define vector __attribute__((vector_size(16))) typedef vector signed char v16qi; typedef vector unsigned char v16uqi; v16qi foo2 (v16qi a, v16qi b) { return a >> 6; } v16uqi foo1 (v16uqi a, v16uqi b) { return a >> 6; } ``` clang produces: ``` _Z4foo2Dv16_aS_: psrlw $6, %xmm0 pand .LCPI0_0(%rip), %xmm0 #{3,3,3,...} movdqa .LCPI0_1(%rip), %xmm1 #{2,2,2,...} pxor %xmm1, %xmm0 psubb %xmm1, %xmm0 retq _Z4foo1Dv16_hS_: psrlw $6, %xmm0 pand .LCPI1_0(%rip), %xmm0 #{3,3,3,...} retq ```=