Enable gcc support for UINTR
authorliuhongt <hongtao.liu@intel.com>
Mon, 20 May 2019 09:56:41 +0000 (17:56 +0800)
committerliuhongt <hongtao.liu@intel.com>
Thu, 15 Oct 2020 03:02:49 +0000 (11:02 +0800)
commit299a53d7979aaa639298b95bd46b69d3a8546f49
tree38526ee4a057f3d8b01d302af56a847911809f03
parentb2698c21f2cdbe579bd0271cca8dc7fba7a3dc25
Enable gcc support for UINTR

2020-05-20  Hongtao Liu  <hongtao.liu@intel.com>

gcc/
* common/config/i386/cpuinfo.h (get_available_features):
Detect UINTR.
* common/config/i386/i386-common.c (OPTION_MASK_ISA2_UINTR_SET
OPTION_MASK_ISA2_UINTR_UNSET): New.
(ix86_handle_option): Handle -muintr.
* common/config/i386/i386-cpuinfo.h (enum processor_features):
Add FEATURE_UINTR.
* common/config/i386/i386-isas.h: Add ISA_NAMES_TABLE_ENTRY
for uintr.
* config.gcc: Add uintrintrin.h to extra_headers.
* config/i386/uintrintrin.h: New.
* config/i386/cpuid.h (bit_UINTR): New.
* config/i386/i386-builtin-types.def: Add new types.
* config/i386/i386-builtin.def: Add new builtins.
* config/i386/i386-builtins.c (ix86_init_mmx_sse_builtins): Add
__builtin_ia32_testui.
* config/i386/i386-builtins.h (ix86_builtins): Add
IX86_BUILTIN_TESTUI.
* config/i386/i386-c.c (ix86_target_macros_internal): Define
__UINTR__.
* config/i386/i386-expand.c (ix86_expand_special_args_builtin):
Handle UINT8_FTYPE_VOID.
(ix86_expand_builtin): Handle IX86_BUILTIN_TESTUI.
* config/i386/i386-options.c (isa2_opts): Add -muintr.
(ix86_valid_target_attribute_inner_p): Handle UINTR.
(ix86_option_override_internal): Add TARGET_64BIT check for UINTR.
* config/i386/i386.h (TARGET_UINTR, TARGET_UINTR_P, PTA_UINTR): New.
(PTA_SAPPHIRRAPIDS): Add PTA_UINTR.
* config/i386/i386.opt: Add -muintr.
* config/i386/i386.md
(define_int_iterator UINTR_UNSPECV): New.
(define_int_attr uintr_unspecv): New.
(uintr_<uintr_unspecv>, uintr_senduipi, testui):
New define_insn patterns.
* config/i386/x86gprintrin.h: Include uintrintrin.h
* doc/invoke.texi: Document -muintr.
* doc/extend.texi: Document uintr.

gcc/testsuite/

* gcc.target/i386/funcspec-56.inc: Add new target attribute.
* gcc.target/i386/uintr-1.c: New test.
* gcc.target/i386/uintr-2.c: Ditto.
* gcc.target/i386/uintr-3.c: Ditto.
* gcc.target/i386/uintr-4.c: Ditto.
* gcc.target/i386/uintr-5.c: Ditto.
* gcc.target/i386/x86gprintrin-1.c: Add -muintr for 64bit target.
* gcc.target/i386/x86gprintrin-2.c: Ditto.
* gcc.target/i386/x86gprintrin-3.c: Ditto.
* gcc.target/i386/x86gprintrin-4.c: Add muintr for 64bit target.
* gcc.target/i386/x86gprintrin-5.c: Ditto.
31 files changed:
gcc/common/config/i386/cpuinfo.h
gcc/common/config/i386/i386-common.c
gcc/common/config/i386/i386-cpuinfo.h
gcc/common/config/i386/i386-isas.h
gcc/config.gcc
gcc/config/i386/cpuid.h
gcc/config/i386/i386-builtin-types.def
gcc/config/i386/i386-builtin.def
gcc/config/i386/i386-builtins.c
gcc/config/i386/i386-builtins.h
gcc/config/i386/i386-c.c
gcc/config/i386/i386-expand.c
gcc/config/i386/i386-options.c
gcc/config/i386/i386.h
gcc/config/i386/i386.md
gcc/config/i386/i386.opt
gcc/config/i386/uintrintrin.h [new file with mode: 0644]
gcc/config/i386/x86gprintrin.h
gcc/doc/extend.texi
gcc/doc/invoke.texi
gcc/testsuite/gcc.target/i386/funcspec-56.inc
gcc/testsuite/gcc.target/i386/uintr-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/uintr-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/uintr-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/uintr-4.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/uintr-5.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/x86gprintrin-1.c
gcc/testsuite/gcc.target/i386/x86gprintrin-2.c
gcc/testsuite/gcc.target/i386/x86gprintrin-3.c
gcc/testsuite/gcc.target/i386/x86gprintrin-4.c
gcc/testsuite/gcc.target/i386/x86gprintrin-5.c