From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9EE27384D157; Thu, 23 Jun 2022 15:46:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9EE27384D157 From: "hjl.tools at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/106060] Inefficient constant broadcast on x86_64 Date: Thu, 23 Jun 2022 15:46:36 +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: X-Bugzilla-Severity: normal X-Bugzilla-Who: hjl.tools at gmail 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: attachments.created 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: Thu, 23 Jun 2022 15:46:36 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106060 --- Comment #2 from H.J. Lu --- Created attachment 53196 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D53196&action=3Dedit A patch This generates: 0000000000000000 : 0: b8 7b 00 00 00 mov $0x7b,%eax 5: c5 f9 6e c0 vmovd %eax,%xmm0 9: c4 e2 7d 78 c0 vpbroadcastb %xmm0,%ymm0 e: c3 ret f: 90 nop 0000000000000010 : 10: b8 01 00 00 00 mov $0x1,%eax 15: c5 f9 6e c0 vmovd %eax,%xmm0 19: c4 e2 7d 78 c0 vpbroadcastb %xmm0,%ymm0 1e: c3 ret 1f: 90 nop 0000000000000020 : 20: b8 fe ff ff ff mov $0xfffffffe,%eax 25: c5 f9 6e c0 vmovd %eax,%xmm0 29: c4 e2 7d 78 c0 vpbroadcastb %xmm0,%ymm0 2e: c3 ret=