From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 42B7F3858CDB; Sat, 18 May 2024 15:17:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 42B7F3858CDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1716045433; bh=7k04LUYNF5bfZk5HKIh7R3Y8RKEaTaPphi044DJGiVQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=u4IPKQqf0NsWK5ojsMjY9xP7uiHHafWUU/QeEIUNUasUT+Dkm8HihAfodq4QxlpmU 05+2SYaA56b3fgD0EG2d0RDwxmu6LQye19CVkaXscUtMHhKUDmOhuqIEM3A+TQ6r3w tet8MHq8hPpAv5brzfeTPUQxCS3oTTkAFWFsaylo= From: "admin at levyhsu 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: Sat, 18 May 2024 15:17:12 +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: admin at levyhsu 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 #12 from Levy Hsu --- switch (d->vmode) { case E_V8QImode: if (!TARGET_MMX_WITH_SSE) return false; mode =3D V4HImode; gen_shr =3D gen_ashrv4hi3(should be gen_lshrv4hi3); gen_shl =3D gen_ashlv4hi3; gen_or =3D gen_iorv4hi3; break; case E_V16QImode: mode =3D V8HImode; gen_shr =3D gen_vlshrv8hi3; gen_shl =3D gen_vashlv8hi3; gen_or =3D gen_iorv8hi3; break; default: return false; } Obviously, under V8QImode it should be gen_lshrv4hi3 instead of gen_ashrv4h= i3. I mistakenly used gen_ashrv4hi3 due to the similar naming conventions and failed to find out. gen_lshrv4hi3 is the correct logical shift needed. Will send a patch soon=