[Bug target/98442] [X86] suboptimal for memset with CLEAR_BY_PIECES
hjl.tools at gmail dot com
gcc-bugzilla@gcc.gnu.org
Thu Dec 31 03:56:50 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98442
--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to H.J. Lu from comment #2)
> Please take a look at users/hjl/pieces/master branch:
>
> https://gitlab.com/x86-gcc/gcc/-/tree/users/hjl/pieces/master
>
> 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= 0; i != 64; i++)
Tab[i] = 0;
}
[hjl@gnu-cfl-1 gcc]$ ./xgcc -B./ -march=skylake -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]$
This requires middle-end changes.
More information about the Gcc-bugs
mailing list