1890f2f0e2
Both x86 backend and libgcc define enum processor_features. libgcc sets enum processor_feature and x86 backend checks enum processor_feature. They are very easy out of sync and it has happened multiple times in the past. 1. Move cpuinfo.h from libgcc to common/config/i386 so that we can share the same enum processor_features in x86 backend and libgcc. 2. Change __cpu_features2 to an array to support more processor features. 3. Add more processor features to enum processor_features. gcc/ PR target/95259 * common/config/i386/cpuinfo.h: New file. (__processor_model): Moved from libgcc/config/i386/cpuinfo.h. (__processor_model2): New. (CHECK___builtin_cpu_is): New. Defined as empty if not defined. (has_cpu_feature): New function. (set_cpu_feature): Likewise. (get_amd_cpu): Moved from libgcc/config/i386/cpuinfo.c. Use CHECK___builtin_cpu_is. Return AMD CPU name. (get_intel_cpu): Moved from libgcc/config/i386/cpuinfo.c. Use Use CHECK___builtin_cpu_is. Return Intel CPU name. (get_available_features): Moved from libgcc/config/i386/cpuinfo.c. Also check FEATURE_3DNOW, FEATURE_3DNOWP, FEATURE_ADX, FEATURE_ABM, FEATURE_CLDEMOTE, FEATURE_CLFLUSHOPT, FEATURE_CLWB, FEATURE_CLZERO, FEATURE_CMPXCHG16B, FEATURE_CMPXCHG8B, FEATURE_ENQCMD, FEATURE_F16C, FEATURE_FSGSBASE, FEATURE_FXSAVE, FEATURE_HLE, FEATURE_IBT, FEATURE_LAHF_LM, FEATURE_LM, FEATURE_LWP, FEATURE_LZCNT, FEATURE_MOVBE, FEATURE_MOVDIR64B, FEATURE_MOVDIRI, FEATURE_MWAITX, FEATURE_OSXSAVE, FEATURE_PCONFIG, FEATURE_PKU, FEATURE_PREFETCHWT1, FEATURE_PRFCHW, FEATURE_PTWRITE, FEATURE_RDPID, FEATURE_RDRND, FEATURE_RDSEED, FEATURE_RTM, FEATURE_SERIALIZE, FEATURE_SGX, FEATURE_SHA, FEATURE_SHSTK, FEATURE_TBM, FEATURE_TSXLDTRK, FEATURE_VAES, FEATURE_WAITPKG, FEATURE_WBNOINVD, FEATURE_XSAVE, FEATURE_XSAVEC, FEATURE_XSAVEOPT and FEATURE_XSAVES (cpu_indicator_init): Moved from libgcc/config/i386/cpuinfo.c. Also update cpu_model2. * common/config/i386/i386-cpuinfo.h (processor_vendor): Add Add VENDOR_CENTAUR, VENDOR_CYRIX and VENDOR_NSC. (processor_features): Moved from gcc/config/i386/i386-builtins.c. Renamed F_XXX to FEATURE_XXX. Add FEATURE_3DNOW, FEATURE_3DNOWP, FEATURE_ADX, FEATURE_ABM, FEATURE_CLDEMOTE, FEATURE_CLFLUSHOPT, FEATURE_CLWB, FEATURE_CLZERO, FEATURE_CMPXCHG16B, FEATURE_CMPXCHG8B, FEATURE_ENQCMD, FEATURE_F16C, FEATURE_FSGSBASE, FEATURE_FXSAVE, FEATURE_HLE, FEATURE_IBT, FEATURE_LAHF_LM, FEATURE_LM, FEATURE_LWP, FEATURE_LZCNT, FEATURE_MOVBE, FEATURE_MOVDIR64B, FEATURE_MOVDIRI, FEATURE_MWAITX, FEATURE_OSXSAVE, FEATURE_PCONFIG, FEATURE_PKU, FEATURE_PREFETCHWT1, FEATURE_PRFCHW, FEATURE_PTWRITE, FEATURE_RDPID, FEATURE_RDRND, FEATURE_RDSEED, FEATURE_RTM, FEATURE_SERIALIZE, FEATURE_SGX, FEATURE_SHA, FEATURE_SHSTK, FEATURE_TBM, FEATURE_TSXLDTRK, FEATURE_VAES, FEATURE_WAITPKG, FEATURE_WBNOINVD, FEATURE_XSAVE, FEATURE_XSAVEC, FEATURE_XSAVEOPT, FEATURE_XSAVES and CPU_FEATURE_MAX. (SIZE_OF_CPU_FEATURES): New. * config/i386/i386-builtins.c (processor_features): Removed. (isa_names_table): Replace F_XXX with FEATURE_XXX. (fold_builtin_cpu): Change __cpu_features2 to an array. libgcc/ PR target/95259 * config/i386/cpuinfo.c: Don't include "cpuinfo.h". Include "common/config/i386/i386-cpuinfo.h" and "common/config/i386/cpuinfo.h". (__cpu_features2): Changed to array. (get_amd_cpu): Removed. (get_intel_cpu): Likewise. (get_available_features): Likewise. (__cpu_indicator_init): Call cpu_indicator_init. * config/i386/cpuinfo.h: Removed. |
||
---|---|---|
.. | ||
aarch64 | ||
alpha | ||
arc | ||
arm | ||
avr | ||
bfin | ||
bpf | ||
c6x | ||
cr16 | ||
cris | ||
csky | ||
epiphany | ||
fr30 | ||
frv | ||
ft32 | ||
gcn | ||
h8300 | ||
i386 | ||
ia64 | ||
iq2000 | ||
libbid | ||
lm32 | ||
m32c | ||
m32r | ||
m68k | ||
mcore | ||
microblaze | ||
mips | ||
mmix | ||
moxie | ||
msp430 | ||
nds32 | ||
nios2 | ||
nvptx | ||
or1k | ||
pa | ||
pdp11 | ||
pru | ||
riscv | ||
rl78 | ||
rs6000 | ||
rx | ||
s390 | ||
score | ||
sh | ||
sol2 | ||
sparc | ||
stormy16 | ||
tilegx | ||
tilepro | ||
v850 | ||
vax | ||
visium | ||
vms | ||
xtensa | ||
darwin10-unwind-find-enc-func.c | ||
darwin-64.c | ||
darwin-crt3.c | ||
darwin-crt-tm.c | ||
gthr-lynx.h | ||
gthr-rtems.h | ||
gthr-vxworks-cond.c | ||
gthr-vxworks-thread.c | ||
gthr-vxworks-tls.c | ||
gthr-vxworks.c | ||
gthr-vxworks.h | ||
hardfp.c | ||
libgcc-glibc.ver | ||
libgcc-libsystem.ver | ||
no-sfp-machine.h | ||
no-unwind.h | ||
t-crtfm | ||
t-crtstuff-pic | ||
t-darwin | ||
t-dfprules | ||
t-eh-dw2-dip | ||
t-fdpbit | ||
t-fixedpoint-gnu-prefix | ||
t-fpbit | ||
t-freebsd-thread | ||
t-gnu-prefix | ||
t-gthr-noweak | ||
t-gthr-vxworks | ||
t-gthr-vxworksae | ||
t-hardfp | ||
t-hardfp-sfdf | ||
t-libgcc-pic | ||
t-libunwind | ||
t-libunwind-elf | ||
t-linux | ||
t-openbsd-thread | ||
t-rtems | ||
t-slibgcc | ||
t-slibgcc-darwin | ||
t-slibgcc-elf-ver | ||
t-slibgcc-fuchsia | ||
t-slibgcc-gld | ||
t-slibgcc-gld-nover | ||
t-slibgcc-hpux | ||
t-slibgcc-libgcc | ||
t-slibgcc-nolc-override | ||
t-slibgcc-sld | ||
t-slibgcc-vms | ||
t-softfp | ||
t-softfp-compat | ||
t-softfp-excl | ||
t-softfp-sfdf | ||
t-softfp-sfdftf | ||
t-softfp-tf | ||
t-stack | ||
t-tls | ||
t-vxcrtstuff | ||
t-vxworks | ||
t-vxworks7 | ||
t-vxworksae | ||
unwind-dw2-fde-darwin.c | ||
vxcache.c | ||
vxcrtstuff.c |