Enable Intel HRESET Instruction
authorHongyu Wang <hongyu.wang@intel.com>
Tue, 7 Apr 2020 18:39:53 +0000 (18:39 +0000)
committerliuhongt <hongtao.liu@intel.com>
Thu, 15 Oct 2020 03:07:16 +0000 (11:07 +0800)
commit83927c63897ec25b2efb5dac58f20a0561d28f26
tree401fab74035eb564e3b00f8e6e78f7077f84b365
parent299a53d7979aaa639298b95bd46b69d3a8546f49
Enable Intel HRESET Instruction

gcc/

* common/config/i386/cpuinfo.h (get_available_features):
Detect HRESET.
* common/config/i386/i386-common.c (OPTION_MASK_ISA2_HRESET_SET,
OPTION_MASK_ISA2_HRESET_UNSET): New macros.
(ix86_handle_option): Handle -mhreset.
* common/config/i386/i386-cpuinfo.h (enum processor_features):
Add FEATURE_HRESET.
* common/config/i386/i386-isas.h: Add ISA_NAMES_TABLE_ENTRY
for hreset.
* config.gcc: Add hresetintrin.h
* config/i386/hresetintrin.h: New header file.
* config/i386/x86gprintrin.h: Include hresetintrin.h.
* config/i386/cpuid.h (bit_HRESET): New.
* config/i386/i386-builtin.def: Add new builtin.
* config/i386/i386-expand.c (ix86_expand_builtin):
Handle new builtin.
* config/i386/i386-c.c (ix86_target_macros_internal): Define
__HRESET__.
* config/i386/i386-options.c (isa2_opts): Add -mhreset.
(ix86_valid_target_attribute_inner_p): Handle hreset.
* config/i386/i386.h (TARGET_HRESET, TARGET_HRESET_P,
PTA_HRESET): New.
(PTA_ALDERLAKE): Add PTA_HRESET.
* config/i386/i386.opt: Add option -mhreset.
* config/i386/i386.md (UNSPECV_HRESET): New unspec.
(hreset): New define_insn.
* doc/invoke.texi: Document -mhreset.
* doc/extend.texi: Document hreset.

gcc/testsuite/

* gcc.target/i386/hreset-1.c: New test.
* gcc.target/i386/funcspec-56.inc: Add new target attribute.
* gcc.target/i386/x86gprintrin-1.c: Add -mhreset.
* gcc.target/i386/x86gprintrin-2.c: Ditto.
* gcc.target/i386/x86gprintrin-3.c: Ditto.
* gcc.target/i386/x86gprintrin-4.c: Add mhreset.
* gcc.target/i386/x86gprintrin-5.c: Ditto.
24 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/hresetintrin.h [new file with mode: 0644]
gcc/config/i386/i386-builtin.def
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/x86gprintrin.h
gcc/doc/extend.texi
gcc/doc/invoke.texi
gcc/testsuite/gcc.target/i386/funcspec-56.inc
gcc/testsuite/gcc.target/i386/hreset-1.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