gcc/libgcc/config
H.J. Lu 59a95143dd x86: Add <x86gprintrin.h>
For sources which can't use any vector instructions, <x86intrin.h> and
<immintrin.h> cannot be included for compiler intrinsics:

$ echo "#include <x86intrin.h>" | gcc -S -O2 -mno-sse -mno-mmx -x c -
In file included from /usr/include/stdlib.h:1013,
                 from /usr/lib/gcc/x86_64-redhat-linux/10/include/mm_malloc.h:27,
                 from /usr/lib/gcc/x86_64-redhat-linux/10/include/xmmintrin.h:34,
                 from /usr/lib/gcc/x86_64-redhat-linux/10/include/immintrin.h:29,
                 from /usr/lib/gcc/x86_64-redhat-linux/10/include/x86intrin.h:32,
                 from <stdin>:1:
/usr/include/bits/stdlib-float.h: In function ‘atof’:
/usr/include/bits/stdlib-float.h:26:1: error: SSE register return with SSE disabled
   26 | {
      | ^
$

libgcc/config/i386/shadow-stack-unwind.h has a workaround:

/* NB: We need _get_ssp and _inc_ssp from <cetintrin.h>.  But we can't
   include <x86intrin.h> which ends up including <mm_malloc.h>, which
   includes <stdlib.h> and <errno.h> unconditionally.  But we can't
   include any libc system headers unconditionally from libgcc.  Avoid
   including <mm_malloc.h> here by defining _IMMINTRIN_H_INCLUDED.  */
 #define _IMMINTRIN_H_INCLUDED
 #include <cetintrin.h>
 #undef _IMMINTRIN_H_INCLUDED

Add a standalone intrinsic header file, <x86gprintrin.h>, to provide
integer only intrinsics.  All integer only intrinsics are placed in
<x86gprintrin.h>.  <x86intrin.h> and <immintrin.h> simply include
<x86gprintrin.h>.

gcc/

	PR target/97148
	* config.gcc (extra_headers): Add x86gprintrin.h.
	* config/i386/adxintrin.h: Check _X86GPRINTRIN_H_INCLUDED for
	<x86gprintrin.h>.
	* config/i386/bmi2intrin.h: Likewise.
	* config/i386/bmiintrin.h: Likewise.
	* config/i386/cetintrin.h: Likewise.
	* config/i386/cldemoteintrin.h: Likewise.
	* config/i386/clflushoptintrin.h: Likewise.
	* config/i386/clwbintrin.h: Likewise.
	* config/i386/enqcmdintrin.h: Likewise.
	* config/i386/fxsrintrin.h: Likewise.
	* config/i386/ia32intrin.h: Likewise.
	* config/i386/lwpintrin.h: Likewise.
	* config/i386/lzcntintrin.h: Likewise.
	* config/i386/movdirintrin.h: Likewise.
	* config/i386/pconfigintrin.h: Likewise.
	* config/i386/pkuintrin.h: Likewise.
	* config/i386/rdseedintrin.h: Likewise.
	* config/i386/rtmintrin.h: Likewise.
	* config/i386/serializeintrin.h: Likewise.
	* config/i386/tbmintrin.h: Likewise.
	* config/i386/tsxldtrkintrin.h: Likewise.
	* config/i386/waitpkgintrin.h: Likewise.
	* config/i386/wbnoinvdintrin.h: Likewise.
	* config/i386/xsavecintrin.h: Likewise.
	* config/i386/xsaveintrin.h: Likewise.
	* config/i386/xsaveoptintrin.h: Likewise.
	* config/i386/xsavesintrin.h: Likewise.
	* config/i386/xtestintrin.h: Likewise.
	* config/i386/immintrin.h: Include <x86gprintrin.h> instead of
	<fxsrintrin.h>, <xsaveintrin.h>, <xsaveoptintrin.h>,
	<xsavesintrin.h>, <xsavecintrin.h>, <lzcntintrin.h>,
	<bmiintrin.h>, <bmi2intrin.h>, <xtestintrin.h>, <cetintrin.h>,
	<movdirintrin.h>, <sgxintrin.h, <pconfigintrin.h>,
	<waitpkgintrin.h>, <cldemoteintrin.h>, <enqcmdintrin.h>,
	<serializeintrin.h>, <tsxldtrkintrin.h>, <adxintrin.h>,
	<clwbintrin.h>, <clflushoptintrin.h>, <wbnoinvdintrin.h> and
	<pkuintrin.h>.
	(_wbinvd): Moved to config/i386/x86gprintrin.h.
	(_rdrand16_step): Likewise.
	(_rdrand32_step): Likewise.
	(_rdpid_u32): Likewise.
	(_readfsbase_u32): Likewise.
	(_readfsbase_u64): Likewise.
	(_readgsbase_u32): Likewise.
	(_readgsbase_u64): Likewise.
	(_writefsbase_u32): Likewise.
	(_writefsbase_u64): Likewise.
	(_writegsbase_u32): Likewise.
	(_writegsbase_u64): Likewise.
	(_rdrand64_step): Likewise.
	(_ptwrite64): Likewise.
	(_ptwrite32): Likewise.
	* config/i386/x86gprintrin.h: New file.
	* config/i386/x86intrin.h: Include <x86gprintrin.h>.  Don't
	include <ia32intrin.h>, <lwpintrin.h>, <tbmintrin.h>,
	<popcntintrin.h>, <mwaitxintrin.h> and <clzerointrin.h>.

gcc/testsuite/

	* gcc.target/i386/avx-1.c (__builtin_ia32_lwpval32): New to
	support <lwpintrin.h> included in <x86gprintrin.h>.
	(__builtin_ia32_lwpval64): Likewise.
	(__builtin_ia32_lwpins32): Likewise.
	(__builtin_ia32_lwpins64): Likewise.
	(__builtin_ia32_bextri_u32): New to support <tbmintrin.h>
	included in <x86gprintrin.h>.
	(__builtin_ia32_bextri_u64): Likewise.
	* gcc.target/i386/x86gprintrin-1.c: New test.
	* gcc.target/i386/x86gprintrin-2.c: Likewise.
	* gcc.target/i386/x86gprintrin-3.c: Likewise.
	* gcc.target/i386/x86gprintrin-4.c: Likewise.
	* gcc.target/i386/x86gprintrin-4a.c: Likewise.
	* gcc.target/i386/x86gprintrin-5.c: Likewise.
	* gcc.target/i386/x86gprintrin-5a.c: Likewise.
	* gcc.target/i386/x86gprintrin-5b.c: Likewise.
	* gcc.target/i386/x86gprintrin-6.c: Likewise.

libgcc/

	PR target/97148
	* config/i386/shadow-stack-unwind.h: Include <x86gprintrin.h>
	instead of <cetintrin.h>.
2020-10-09 05:08:41 -07:00
..
aarch64 aarch64: Add HF routines to libgcc_s.so 2020-09-28 11:26:53 +01:00
alpha Update copyright years. 2020-01-01 12:51:42 +01:00
arc [ARC] Make libgcc compatible with ARC's reduced register set config. 2020-01-27 14:51:03 +02:00
arm libgcc/config/arm/fp16.c: Make _internal functions static inline 2020-09-17 12:23:36 +00:00
avr Fix typo in ChangeLog 2020-06-24 10:10:56 -04:00
bfin Update copyright years. 2020-01-01 12:51:42 +01:00
bpf GCC port for eBPF 2019-09-09 12:13:23 +02:00
c6x Update copyright years. 2020-01-01 12:51:42 +01:00
cr16 Update copyright years. 2020-01-01 12:51:42 +01:00
cris libgcc: cris: Remove support for crisv32-*-* and cris*-*-linux 2020-05-09 03:00:38 +02:00
csky Update copyright years. 2020-01-01 12:51:42 +01:00
epiphany Update copyright years. 2020-01-01 12:51:42 +01:00
fr30 Update copyright years. 2020-01-01 12:51:42 +01:00
frv Fix libgcc build failure for FRV with recent versions of gas. 2020-02-10 14:12:32 -07:00
ft32 Update copyright years. 2020-01-01 12:51:42 +01:00
gcn [amdgcn] Remove dependency on stdint.h in libgcc 2020-01-10 23:19:41 +00:00
h8300 Update copyright years. 2020-01-01 12:51:42 +01:00
i386 x86: Add <x86gprintrin.h> 2020-10-09 05:08:41 -07:00
ia64 Missing __divtf3@@GCC_4.4.0 on ia64 2020-06-04 09:56:32 +02:00
iq2000 Update copyright years. 2020-01-01 12:51:42 +01:00
libbid Add missing ChangeLog entries. 2020-05-05 16:10:13 +02:00
lm32 Update copyright years. 2020-01-01 12:51:42 +01:00
m32c Update copyright years. 2020-01-01 12:51:42 +01:00
m32r Update copyright years. 2020-01-01 12:51:42 +01:00
m68k Update copyright years. 2020-01-01 12:51:42 +01:00
mcore Update copyright years. 2020-01-01 12:51:42 +01:00
microblaze Update copyright years. 2020-01-01 12:51:42 +01:00
mips Emit .note.GNU-stack for hard-float linux targets. 2020-01-23 17:00:03 +01:00
mmix Update copyright years. 2020-01-01 12:51:42 +01:00
moxie Update copyright years. 2020-01-01 12:51:42 +01:00
msp430 MSP430: Simplify and extend shift instruction patterns 2020-08-26 20:50:58 +01:00
nds32 Update copyright years. 2020-01-01 12:51:42 +01:00
nios2 nios2: Support for GOT-relative DW_EH_PE_datarel encoding. 2020-01-31 16:46:50 -08:00
nvptx [nvptx, libgcc] Fix Wbuiltin-declaration-mismatch in atomic.c 2020-09-09 19:22:07 +02:00
or1k Update copyright years. 2020-01-01 12:51:42 +01:00
pa Update copyright years. 2020-01-01 12:51:42 +01:00
pdp11 t-pdp11 (LIB2ADD): Add divmod.c. 2018-11-01 14:36:52 -04:00
pru Update copyright years. 2020-01-01 12:51:42 +01:00
riscv RISC-V/libgcc: Use `-fasynchronous-unwind-tables' for LIB2_DIVMOD_FUNCS 2020-09-29 01:20:01 +01:00
rl78 Update copyright years. 2020-01-01 12:51:42 +01:00
rs6000 [RS6000] Adjust gcc asm for power10 2020-10-01 10:34:48 +09:30
rx Update copyright years. 2020-01-01 12:51:42 +01:00
s390 S/390 zTPF: Handle skip trace addresses when unwinding 2020-04-03 08:46:11 +02:00
score Update copyright years. 2020-01-01 12:51:42 +01:00
sh Update copyright years. 2020-01-01 12:51:42 +01:00
sol2 Update copyright years. 2020-01-01 12:51:42 +01:00
sparc Update copyright years. 2020-01-01 12:51:42 +01:00
stormy16 Update copyright years. 2020-01-01 12:51:42 +01:00
tilegx
tilepro Update copyright years. 2020-01-01 12:51:42 +01:00
v850 Update copyright years. 2020-01-01 12:51:42 +01:00
vax Update copyright years. 2020-01-01 12:51:42 +01:00
visium Update copyright years. 2020-01-01 12:51:42 +01:00
vms Update copyright years. 2020-01-01 12:51:42 +01:00
xtensa xtensa: libgcc: fix PR target/95571 2020-06-08 18:30:07 -07:00
darwin10-unwind-find-enc-func.c
darwin-64.c Update copyright years. 2020-01-01 12:51:42 +01:00
darwin-crt3.c Update copyright years. 2020-01-01 12:51:42 +01:00
darwin-crt-tm.c Update copyright years. 2020-01-01 12:51:42 +01:00
gthr-lynx.h Update copyright years. 2020-01-01 12:51:42 +01:00
gthr-rtems.h Update copyright years. 2020-01-01 12:51:42 +01:00
gthr-vxworks-cond.c Update copyright years. 2020-01-01 12:51:42 +01:00
gthr-vxworks-thread.c Update copyright years. 2020-01-01 12:51:42 +01:00
gthr-vxworks-tls.c Update copyright years. 2020-01-01 12:51:42 +01:00
gthr-vxworks.c Update copyright years. 2020-01-01 12:51:42 +01:00
gthr-vxworks.h Guard inclusion of vxAtomicLib.h from gthr-vxworks.h 2020-01-05 12:45:54 +00:00
hardfp.c Update copyright years. 2020-01-01 12:51:42 +01:00
libgcc-glibc.ver Update copyright years. 2020-01-01 12:51:42 +01:00
libgcc-libsystem.ver
no-sfp-machine.h
no-unwind.h
t-crtfm
t-crtstuff-pic
t-darwin [Darwin] Some TLC for older Darwin versions. 2019-07-03 18:36:28 +00:00
t-dfprules
t-eh-dw2-dip
t-fdpbit
t-fixedpoint-gnu-prefix
t-fpbit
t-freebsd-thread
t-gnu-prefix
t-gthr-noweak musl: Don't use gthr weak refs in libgcc PR91737 2019-11-18 12:08:18 +00:00
t-gthr-vxworks Improve the thread support for VxWorks 2019-11-14 15:58:31 +00:00
t-gthr-vxworksae Update the libgcc support for VxWorks AE/653 2019-11-14 16:00:55 +00:00
t-hardfp Update copyright years. 2020-01-01 12:51:42 +01:00
t-hardfp-sfdf Update copyright years. 2020-01-01 12:51:42 +01:00
t-libgcc-pic
t-libunwind
t-libunwind-elf Update copyright years. 2020-01-01 12:51:42 +01:00
t-linux
t-openbsd-thread
t-rtems
t-slibgcc Update copyright years. 2020-01-01 12:51:42 +01:00
t-slibgcc-darwin
t-slibgcc-elf-ver
t-slibgcc-fuchsia Update copyright years. 2020-01-01 12:51:42 +01:00
t-slibgcc-gld
t-slibgcc-gld-nover
t-slibgcc-hpux
t-slibgcc-libgcc Update copyright years. 2020-01-01 12:51:42 +01:00
t-slibgcc-nolc-override
t-slibgcc-sld
t-slibgcc-vms
t-softfp Update copyright years. 2020-01-01 12:51:42 +01:00
t-softfp-compat
t-softfp-excl
t-softfp-sfdf
t-softfp-sfdftf
t-softfp-tf
t-stack
t-tls
t-vxcrtstuff Introduce vxworks specific crtstuff support 2019-11-14 15:53:23 +00:00
t-vxworks Improve the thread support for VxWorks 2019-11-14 15:58:31 +00:00
t-vxworks7 Improve the thread support for VxWorks 2019-11-14 15:58:31 +00:00
t-vxworksae Update the libgcc support for VxWorks AE/653 2019-11-14 16:00:55 +00:00
unwind-dw2-fde-darwin.c Update copyright years. 2020-01-01 12:51:42 +01:00
vxcache.c Update copyright years. 2020-01-01 12:51:42 +01:00
vxcrtstuff.c Fix typo in macro name guarding conditional in vxcrtstuff.c 2019-12-30 21:11:22 +00:00