From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E1E75385803C; Thu, 31 Dec 2020 03:56:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E1E75385803C From: "hjl.tools at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/98442] [X86] suboptimal for memset with CLEAR_BY_PIECES Date: Thu, 31 Dec 2020 03:56: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: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hjl.tools 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: --- 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, 31 Dec 2020 03:56:51 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98442 --- Comment #3 from H.J. Lu --- (In reply to H.J. Lu from comment #2) > Please take a look at users/hjl/pieces/master branch: >=20 > https://gitlab.com/x86-gcc/gcc/-/tree/users/hjl/pieces/master >=20 > You may get some ideas. I got [hjl@gnu-cfl-1 gcc]$ cat /tmp/x.c char Tab[64]; void foo(int n) { for (int i=3D 0; i !=3D 64; i++) Tab[i] =3D 0; } [hjl@gnu-cfl-1 gcc]$ ./xgcc -B./ -march=3Dskylake -S -O2 /tmp/x.c [hjl@gnu-cfl-1 gcc]$ cat x.s .file "x.c" .text .p2align 4 .globl foo .type foo, @function foo: .LFB0: .cfi_startproc vpxor %xmm0, %xmm0, %xmm0 vmovups %ymm0, Tab(%rip) vmovups %ymm0, Tab+32(%rip) vzeroupper ret .cfi_endproc .LFE0: .size foo, .-foo .comm Tab,64,32 .ident "GCC: (GNU) 10.0.0 20190523 (experimental)" .section .note.GNU-stack,"",@progbits [hjl@gnu-cfl-1 gcc]$=20 This requires middle-end changes.=