This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/82990] Update the default -mzeroupper setting
- From: "speryt at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 04 Dec 2017 11:04:10 +0000
- Subject: [Bug target/82990] Update the default -mzeroupper setting
- Auto-submitted: auto-generated
- References: <bug-82990-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82990
--- Comment #9 from speryt at gcc dot gnu.org ---
Author: speryt
Date: Mon Dec 4 11:03:37 2017
New Revision: 255378
URL: https://gcc.gnu.org/viewcvs?rev=255378&root=gcc&view=rev
Log:
Fix PR82941 and PR82942 by adding proper vzeroupper generation on SKX.
Add X86_TUNE_EMIT_VZEROUPPER to indicate if vzeroupper instruction should
be inserted before a transfer of control flow out of the function. It is
turned on by default unless we are tuning for KNL. Users can always use
-mzeroupper or -mno-zeroupper to override X86_TUNE_EMIT_VZEROUPPER.
2017-12-04 Sebastian Peryt <sebastian.peryt@intel.com>
H.J. Lu <hongjiu.lu@intel.com>
gcc/
Bakcported from trunk
PR target/82941
PR target/82942
PR target/82990
* config/i386/i386.c (pass_insert_vzeroupper): Remove
TARGET_AVX512F check from gate condition.
(ix86_check_avx256_register): Changed to ...
(ix86_check_avx_upper_register): ... this. Add extra check for
VALID_AVX512F_REG_OR_XI_MODE.
(ix86_avx_u128_mode_needed): Changed
ix86_check_avx256_register to ix86_check_avx_upper_register.
(ix86_check_avx256_stores): Changed to ...
(ix86_check_avx_upper_stores): ... this. Changed
ix86_check_avx256_register to ix86_check_avx_upper_register.
(ix86_avx_u128_mode_after): Changed
avx_reg256_found to avx_upper_reg_found. Changed
ix86_check_avx256_stores to ix86_check_avx_upper_stores.
(ix86_avx_u128_mode_entry): Changed
ix86_check_avx256_register to ix86_check_avx_upper_register.
(ix86_avx_u128_mode_exit): Ditto.
(ix86_option_override_internal): Set MASK_VZEROUPPER if
neither -mzeroupper nor -mno-zeroupper is used and
TARGET_EMIT_VZEROUPPER is set.
* config/i386/i386.h: (host_detect_local_cpu): New define.
(TARGET_EMIT_VZEROUPPER): New.
* config/i386/x86-tune.def: Add X86_TUNE_EMIT_VZEROUPPER.
2017-12-04 Sebastian Peryt <sebastian.peryt@intel.com>
H.J. Lu <hongjiu.lu@intel.com>
gcc/testsuite/
Backported from trunk
PR target/82941
PR target/82942
PR target/82990
* gcc.target/i386/pr82941-1.c: New test.
* gcc.target/i386/pr82941-2.c: Likewise.
* gcc.target/i386/pr82942-1.c: Likewise.
* gcc.target/i386/pr82942-2.c: Likewise.
* gcc.target/i386/pr82990-1.c: Likewise.
* gcc.target/i386/pr82990-2.c: Likewise.
* gcc.target/i386/pr82990-3.c: Likewise.
* gcc.target/i386/pr82990-4.c: Likewise.
* gcc.target/i386/pr82990-5.c: Likewise.
* gcc.target/i386/pr82990-6.c: Likewise.
* gcc.target/i386/pr82990-7.c: Likewise.
Added:
branches/gcc-7-branch/gcc/testsuite/gcc.target/i386/pr82941-1.c
branches/gcc-7-branch/gcc/testsuite/gcc.target/i386/pr82941-2.c
branches/gcc-7-branch/gcc/testsuite/gcc.target/i386/pr82942-1.c
branches/gcc-7-branch/gcc/testsuite/gcc.target/i386/pr82942-2.c
branches/gcc-7-branch/gcc/testsuite/gcc.target/i386/pr82990-1.c
branches/gcc-7-branch/gcc/testsuite/gcc.target/i386/pr82990-2.c
branches/gcc-7-branch/gcc/testsuite/gcc.target/i386/pr82990-3.c
branches/gcc-7-branch/gcc/testsuite/gcc.target/i386/pr82990-4.c
branches/gcc-7-branch/gcc/testsuite/gcc.target/i386/pr82990-5.c
branches/gcc-7-branch/gcc/testsuite/gcc.target/i386/pr82990-6.c
branches/gcc-7-branch/gcc/testsuite/gcc.target/i386/pr82990-7.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/config/i386/i386.c
branches/gcc-7-branch/gcc/config/i386/i386.h
branches/gcc-7-branch/gcc/config/i386/x86-tune.def
branches/gcc-7-branch/gcc/testsuite/ChangeLog