public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/101464] New: Replace zveroupper with vpxor
@ 2021-07-15 18:26 hjl.tools at gmail dot com
2021-07-16 1:54 ` [Bug target/101464] " crazylht at gmail dot com
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: hjl.tools at gmail dot com @ 2021-07-15 18:26 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101464
Bug ID: 101464
Summary: Replace zveroupper with vpxor
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: hjl.tools at gmail dot com
Target Milestone: ---
Target: i386, x86-64
[hjl@gnu-cfl-2 pr101456]$ cat y.c
#include <x86intrin.h>
extern __m256d x, y;
void
foo (void)
{
x = y;
}
[hjl@gnu-cfl-2 pr101456]$ gcc -S -O2 -mavx2 y.c
[hjl@gnu-cfl-2 pr101456]$ cat y.s
.file "y.c"
.text
.p2align 4
.globl foo
.type foo, @function
foo:
.LFB5667:
.cfi_startproc
vmovapd y(%rip), %ymm0
vmovapd %ymm0, x(%rip)
vzeroupper
ret
.cfi_endproc
.LFE5667:
.size foo, .-foo
.ident "GCC: (GNU) 11.1.1 20210531 (Red Hat 11.1.1-3)"
.section .note.GNU-stack,"",@progbits
[hjl@gnu-cfl-2 pr101456]$
vzeroupper can be replaced by a single pxor.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug target/101464] Replace zveroupper with vpxor
2021-07-15 18:26 [Bug target/101464] New: Replace zveroupper with vpxor hjl.tools at gmail dot com
@ 2021-07-16 1:54 ` crazylht at gmail dot com
2021-07-16 2:00 ` hjl.tools at gmail dot com
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: crazylht at gmail dot com @ 2021-07-16 1:54 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101464
Hongtao.liu <crazylht at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |crazylht at gmail dot com
--- Comment #1 from Hongtao.liu <crazylht at gmail dot com> ---
>From the implementation perspective, we need to record all usage of sse
registers which is AVX_U128_DIRTY and clear them all.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug target/101464] Replace zveroupper with vpxor
2021-07-15 18:26 [Bug target/101464] New: Replace zveroupper with vpxor hjl.tools at gmail dot com
2021-07-16 1:54 ` [Bug target/101464] " crazylht at gmail dot com
@ 2021-07-16 2:00 ` hjl.tools at gmail dot com
2021-07-16 6:26 ` rguenth at gcc dot gnu.org
2021-07-16 12:07 ` hjl.tools at gmail dot com
3 siblings, 0 replies; 5+ messages in thread
From: hjl.tools at gmail dot com @ 2021-07-16 2:00 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101464
--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> ---
Created attachment 51159
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51159&action=edit
A patch
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug target/101464] Replace zveroupper with vpxor
2021-07-15 18:26 [Bug target/101464] New: Replace zveroupper with vpxor hjl.tools at gmail dot com
2021-07-16 1:54 ` [Bug target/101464] " crazylht at gmail dot com
2021-07-16 2:00 ` hjl.tools at gmail dot com
@ 2021-07-16 6:26 ` rguenth at gcc dot gnu.org
2021-07-16 12:07 ` hjl.tools at gmail dot com
3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-07-16 6:26 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101464
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
But in the long discussion involving vzeroupper and HTM aborts in glibc memory
functions it came up that vpxor is _not_ properly clearing the upper state and
thus does _not_ remove the penalty that following non-VEX SSE instructions get?
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug target/101464] Replace zveroupper with vpxor
2021-07-15 18:26 [Bug target/101464] New: Replace zveroupper with vpxor hjl.tools at gmail dot com
` (2 preceding siblings ...)
2021-07-16 6:26 ` rguenth at gcc dot gnu.org
@ 2021-07-16 12:07 ` hjl.tools at gmail dot com
3 siblings, 0 replies; 5+ messages in thread
From: hjl.tools at gmail dot com @ 2021-07-16 12:07 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101464
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #4 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Richard Biener from comment #3)
> But in the long discussion involving vzeroupper and HTM aborts in glibc
> memory functions it came up that vpxor is _not_ properly clearing the upper
> state and thus does _not_ remove the penalty that following non-VEX SSE
> instructions get?
From
https://sourceware.org/bugzilla/show_bug.cgi?id=27457
we can't use VPXOR to replace VZEROUPPER.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-07-16 12:07 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-15 18:26 [Bug target/101464] New: Replace zveroupper with vpxor hjl.tools at gmail dot com
2021-07-16 1:54 ` [Bug target/101464] " crazylht at gmail dot com
2021-07-16 2:00 ` hjl.tools at gmail dot com
2021-07-16 6:26 ` rguenth at gcc dot gnu.org
2021-07-16 12:07 ` hjl.tools at gmail dot com
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).