From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7D4463858C78; Mon, 4 Dec 2023 04:12:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7D4463858C78 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1701663178; bh=8dgsQmz0eh0StHrpIC6I663fF7YpeVRZ0HhyAK4z9O4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=yOrcGCSYOG/u4p394yA3m+5OKScwvOndRgVA3NqD5UT8Ugo1Xi/qLIM0dB6R3pkd+ CJz45/562mh0IIeZ8IMZDcFXpk/xn6qUbCdKHfjo9E5YOTETWCjiUNl/q8FvBfAnFb uNCwx4VotGq0UcpgU0jjbM6q6+ay9022iS0E8gLI= From: "liuhongt at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/112816] [11/12/13/14 Regression] ICE unrecognizable_insn with __builtin_signbit and returning struct with int[4] Date: Mon, 04 Dec 2023 04:12:57 +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: 11.4.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: liuhongt at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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=3D112816 liuhongt at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |liuhongt at gcc dot gnu.org --- Comment #6 from liuhongt at gcc dot gnu.org --- (In reply to Jakub Jelinek from comment #3) > Created attachment 56767 [details] > gcc14-pr112816.patch >=20 > Untested fix. >=20 > Another issue is that the emitted code is terrible: > pxor %xmm1, %xmm1 > psrld $31, %xmm0 > pcmpeqd %xmm1, %xmm0 > pcmpeqd %xmm1, %xmm0 > Why not just > psrad $31, %xmm0 > instead of all this? We have optimization in ix86_expand_int_vcond. 5090 /* Try to optimize x < 0 ? -1 : 0 into (signed) x >> 31 5091 and x < 0 ? 1 : 0 into (unsigned) x >> 31. */ But for signbit case, it's=20 vect__1.10_4 =3D MEM [(float *)&x]; vect__2.11_3 =3D .SIGNBIT (vect__1.10_4); mask__11.12_22 =3D vect__2.11_3 !=3D { 0, 0, 0, 0 }; vect__13.14_26 =3D VIEW_CONVERT_EXPR(mask__11.12_22); I'm curious, can we move all of those to the middle-end, like match.pd?=