Fix PR82941 and PR82942 by adding proper vzeroupper generation on SKX.
authorSebastian Peryt <sebastian.peryt@intel.com>
Wed, 15 Nov 2017 12:27:31 +0000 (13:27 +0100)
committerSebastian Peryt <speryt@gcc.gnu.org>
Wed, 15 Nov 2017 12:27:31 +0000 (13:27 +0100)
commite6f146d226b225b1aa2fdcd0a868cb24e88321fd
tree4ac58fc68cfd734d17108553814b245e1616b1f4
parent8744c9bf825e2f13934040101d085621135a24fe
Fix PR82941 and PR82942 by adding proper vzeroupper generation on SKX.

2017-11-15  Sebastian Peryt  <sebastian.peryt@intel.com>

gcc/

PR target/82941
PR target/82942
* config/i386/i386.c (pass_insert_vzeroupper): Modify gate condition
to return true on Xeon and not on Xeon Phi.
(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.
* config/i386/i386.h: (host_detect_local_cpu): New define.

2017-11-15  Sebastian Peryt  <sebastian.peryt@intel.com>

gcc/testsuite/

PR target/82941
PR target/82942
* gcc.target/i386/pr82941-1.c: New test.
* gcc.target/i386/pr82941-2.c: New test.
* gcc.target/i386/pr82942-1.c: New test.
* gcc.target/i386/pr82942-2.c: New test.

From-SVN: r254763
gcc/ChangeLog
gcc/config/i386/i386.c
gcc/config/i386/i386.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr82941-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr82941-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr82942-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr82942-2.c [new file with mode: 0644]