From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8D6833858C56; Tue, 8 Nov 2022 00:11:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8D6833858C56 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1667866320; bh=wX/NjCwkhBOZyZiptwvq0GaNWzQvYNdOK9ET5dJ/dPE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=iKU20zHlzaBEXni+qJCwYJ53Fh5jHNboUZbNGiYvw7s54pfv8EUDnmetnqsw6MxgV Mopsan2O8ZsYkuRC7+S/E3faSn3ZOA/SsjY+dwN1X3ppowrAUeBJhGij9cnZ/h78Jm FstW7+T/CJBkD6T+4WjybIMJn7fr7ZFenQlBb+GQ= From: "unlvsur at live dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/107563] __builtin_shufflevector fails to pshufd instructions under default x86_64 compilation toggle which is the sse2 one Date: Tue, 08 Nov 2022 00:11:44 +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: 13.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: unlvsur at live dot com 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=3D107563 --- Comment #3 from cqwrteur --- (In reply to cqwrteur from comment #2) > (In reply to cqwrteur from comment #0) > > #if defined(__SSE2__) > >=20 > > using temp_vec_type [[__gnu__::__vector_size__ (16)]] =3D char; > > void foo(temp_vec_type& v) noexcept > > { > > v=3D__builtin_shufflevector(v,v,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0); > > } > >=20 > > #endif > >=20 > > g++ -S pq.cc -Ofast > > proves sse2 is enabled by default, but it does not call > > https://www.felixcloutier.com/x86/pshufb > > neither > > https://www.felixcloutier.com/x86/pshufd > >=20 > > while g++ -S pq.cc -Ofast -msse4.2 will generate them correctly. Which = is > > buggy >=20 > pshufb is sse3 sorry. but pshufd is sse2. It can be used for generating t= he > right instruction. https://godbolt.org/z/6baWWoE4e BTW. -msse3 does not use pshufb either. i do not know why=