This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch][x86, backport] Backport to GCC-7 vzeroupper patches


Hi,

I'd like to ask for backporting to GCC-7 branch vzeroupper generation patches from trunk,
that are resolving 3 PRs:
PR target/82941
PR target/82942
PR target/82990

Two patches were combined into one and rebased. Bootstraped and tested.
Is it ok for merge?

Changelog:

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-11-29  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-11-29  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.


Thanks,
Sebastian

Attachment: 0001-backportPR82942-GCC-7.patch
Description: 0001-backportPR82942-GCC-7.patch


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]