From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 19B1F3858294; Mon, 7 Nov 2022 23:05:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 19B1F3858294 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1667862350; bh=dNE5zUmT2uIzSmq1VVCMYsADVEHCTuhN9MQYD6og+VU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=tqyVSbTJgtzG3mJi1FLDw6QIO18xayxJZ8U6Hzx1XgXL6mBqzyhUm/d4ANQSQvpXK k9utc8xVSqkTfJr/6AyiD1tZqCOGm1WgBzUCNaRD31o7joZONUA7g+92+GtFxDuXIA e9VyzjaP9GcE/bMkZ4nN8dDOMgCsWZw2ITiXUHS0= 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: Mon, 07 Nov 2022 23:05:43 +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 #2 from cqwrteur --- (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 pshufb is sse3 sorry. but pshufd is sse2. It can be used for generating the right instruction.=