From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 23DDA3858D39; Thu, 3 Mar 2022 01:14:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 23DDA3858D39 From: "crazylht at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/104704] [12 Regression] ix86_gen_scratch_sse_rtx doesn't work with explicit XMM7/XMM15/XMM31 usage Date: Thu, 03 Mar 2022 01:14:50 +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: 12.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: crazylht at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.0 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 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, 03 Mar 2022 01:14:50 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104704 --- Comment #11 from Hongtao.liu --- (In reply to H.J. Lu from comment #9) > --- pieces-memset-46.s 2022-03-02 06:44:55.845212762 -0800 > +++ > /export/build/gnu/tools-build/gcc-gitlab-debug/build-x86_64-linux/gcc/pie= ces- > memset-46.s 2022-03-02 06:45:03.313188978 -0800 > @@ -8,9 +8,11 @@ foo: > .cfi_startproc > movq dst(%rip), %rdx > movl $3, %eax > - vpbroadcastb %eax, %zmm31 > - vmovdqu8 %zmm31, (%rdx) > - vmovw %xmm31, 64(%rdx) > + vpbroadcastb %eax, %zmm0 > + movl $771, %eax > + movw %ax, 64(%rdx) > + vmovdqu8 %zmm0, (%rdx) > + vzeroupper > ret > .cfi_endproc > .LFE0: >=20 > gen_reg_rtx generates 2 extra instructions for pieces-memset-46.c. It's on purpose. ;; Don't move an immediate directly to memory when the instruction ;; gets too big, or if LCP stalls are a problem for 16-bit moves. (define_peephole2 [(match_scratch:SWI124 2 "") (set (match_operand:SWI124 0 "memory_operand") (match_operand:SWI124 1 "immediate_operand"))] "optimize_insn_for_speed_p () && ((mode =3D=3D HImode && TARGET_LCP_STALL) || (TARGET_SPLIT_LONG_MOVES && get_attr_length (insn) >=3D ix86_cur_cost ()->large_insn))" [(set (match_dup 2) (match_dup 1)) (set (match_dup 0) (match_dup 2))])=