From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8A8843858D28; Wed, 15 Dec 2021 01:50:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8A8843858D28 From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/101846] Improve __builtin_shufflevector emitted code Date: Wed, 15 Dec 2021 01:50:08 +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: 12.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 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: Wed, 15 Dec 2021 01:50:08 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101846 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |enhancement --- Comment #7 from Andrew Pinski --- With just -mavx512f we produce a bunch of instructions (looking like we wen= t to scalar mode) while LLVM is able to produce: foo(short __vector(16)): # @foo(short __vector(16= )) .cfi_startproc # %bb.0: vpmovzxwd ymm1, xmm0 # ymm1 =3D xmm0[0],zero,xmm0[1],zero,xmm0[2],zero,xmm0[3],zero,xmm0[4],zero,xmm0[5],ze= ro,xmm0[6],zero,xmm0[7],zero vextracti128 xmm0, ymm0, 1 vpmovzxwd ymm0, xmm0 # ymm0 =3D xmm0[0],zero,xmm0[1],zero,xmm0[2],zero,xmm0[3],zero,xmm0[4],zero,xmm0[5],ze= ro,xmm0[6],zero,xmm0[7],zero vinserti64x4 zmm0, zmm1, ymm0, 1 ret bar(short __vector(32)): # @bar(short __vector(32= )) .cfi_startproc # %bb.0: vpmovdw ymm0, zmm0 ret For -march=3Dskylake512 we do produce now: foo(short __vector(16)): vpmovzxwd zmm0, ymm0 ret bar(short __vector(32)): vpmovdw ymm0, zmm0 ret So still confirmed for the -mavx512f case.=