public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/101495] New: Unnecessary vzeroupper
@ 2021-07-18 3:56 hjl.tools at gmail dot com
2021-07-18 19:23 ` [Bug target/101495] " cvs-commit at gcc dot gnu.org
2021-07-18 19:53 ` hjl.tools at gmail dot com
0 siblings, 2 replies; 3+ messages in thread
From: hjl.tools at gmail dot com @ 2021-07-18 3:56 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101495
Bug ID: 101495
Summary: Unnecessary vzeroupper
Product: gcc
Version: 11.1.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: hjl.tools at gmail dot com
CC: crazylht at gmail dot com
Target Milestone: ---
Target: i386,x86-64
[hjl@gnu-cfl-2 pr101456]$ cat y.c
#include <x86intrin.h>
extern __m256d x;
extern __m256d bar (void);
__m256d
foo (void)
{
x = _mm256_setzero_pd ();
return bar ();
}
[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
vxorpd %xmm0, %xmm0, %xmm0
vmovapd %ymm0, x(%rip)
vzeroupper
jmp bar
.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]$
Since bar returns __m256d, it must be compiled with AVX and there is no
need for vzeroupper.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug target/101495] Unnecessary vzeroupper
2021-07-18 3:56 [Bug target/101495] New: Unnecessary vzeroupper hjl.tools at gmail dot com
@ 2021-07-18 19:23 ` cvs-commit at gcc dot gnu.org
2021-07-18 19:53 ` hjl.tools at gmail dot com
1 sibling, 0 replies; 3+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-07-18 19:23 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101495
--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by H.J. Lu <hjl@gcc.gnu.org>:
https://gcc.gnu.org/g:5586e7e85de381f3df843091494889f8ad8e3e1f
commit r12-2385-g5586e7e85de381f3df843091494889f8ad8e3e1f
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Sun Jul 18 06:12:29 2021 -0700
x86: Don't issue vzeroupper if callee returns AVX register
Don't issue vzeroupper before function call if callee returns AVX
register since callee must be compiled with AVX.
gcc/
PR target/101495
* config/i386/i386.c (ix86_check_avx_upper_stores): Moved before
ix86_avx_u128_mode_needed.
(ix86_avx_u128_mode_needed): Return AVX_U128_DIRTY if callee
returns AVX register.
gcc/testsuite/
PR target/101495
* gcc.target/i386/avx-vzeroupper-28.c: New test.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug target/101495] Unnecessary vzeroupper
2021-07-18 3:56 [Bug target/101495] New: Unnecessary vzeroupper hjl.tools at gmail dot com
2021-07-18 19:23 ` [Bug target/101495] " cvs-commit at gcc dot gnu.org
@ 2021-07-18 19:53 ` hjl.tools at gmail dot com
1 sibling, 0 replies; 3+ messages in thread
From: hjl.tools at gmail dot com @ 2021-07-18 19:53 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101495
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |12.0
Status|UNCONFIRMED |RESOLVED
Resolution|--- |FIXED
--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> ---
Fixed for GCC 12.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-07-18 19:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-18 3:56 [Bug target/101495] New: Unnecessary vzeroupper hjl.tools at gmail dot com
2021-07-18 19:23 ` [Bug target/101495] " cvs-commit at gcc dot gnu.org
2021-07-18 19:53 ` 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).