Enable GCC support for AMX-TILE,AMX-INT8,AMX-BF16.
authorliuhongt <hongtao.liu@intel.com>
Thu, 25 Jul 2019 08:49:36 +0000 (16:49 +0800)
committerH.J. Lu <hjl.tools@gmail.com>
Mon, 28 Sep 2020 12:30:30 +0000 (05:30 -0700)
commit5c609842d13a4c9c6be1a10f7980a74d27daeb85
tree07c87896cb1402fbdd84d01ca81e5f0404783824
parent92f0d3d03a78a8aabe62e4c1e1b300b01516732f
Enable GCC support for AMX-TILE,AMX-INT8,AMX-BF16.

AMX-TILE:ldtilecfg/sttilecfg/tileloadd/tileloaddt1/tilezero/tilerelease
AMX-INT8:tdpbssd/tdpbsud/tdpbusd/tdpbuud
AMX-BF16:tdpbf16ps

gcc/ChangeLog

* common/config/i386/i386-common.c (OPTION_MASK_ISA2_AMX_TILE_SET,
OPTION_MASK_ISA2_AMX_INT8_SET, OPTION_MASK_ISA2_AMX_BF16_SET,
OPTION_MASK_ISA2_AMX_TILE_UNSET, OPTION_MASK_ISA2_AMX_INT8_UNSET,
OPTION_MASK_ISA2_AMX_BF16_UNSET, OPTION_MASK_ISA2_XSAVE_UNSET):
New marcos.
(ix86_handle_option): Hanlde -mamx-tile, -mamx-int8, -mamx-bf16.
* common/config/i386/i386-cpuinfo.h (processor_types): Add
FEATURE_AMX_TILE, FEATURE_AMX_INT8, FEATURE_AMX_BF16.
* common/config/i386/cpuinfo.h (XSTATE_TILECFG,
XSTATE_TILEDATA, XCR_AMX_ENABLED_MASK): New macro.
(get_available_features): Enable AMX features only if
their states are suoorited by OSXSAVE.
* common/config/i386/i386-isas.h: Add ISA_NAME_TABLE_ENTRY
for amx-tile, amx-int8, amx-bf16.
* config.gcc: Add amxtileintrin.h, amxint8intrin.h,
amxbf16intrin.h to extra headers.
* config/i386/amxbf16intrin.h: New file.
* config/i386/amxint8intrin.h: Ditto.
* config/i386/amxtileintrin.h: Ditto.
* config/i386/cpuid.h (bit_AMX_BF16, bit_AMX_TILE, bit_AMX_INT8):
New macro.
* config/i386/i386-c.c (ix86_target_macros_internal): Define
__AMX_TILE__, __AMX_INT8__, AMX_BF16__.
* config/i386/i386-options.c (ix86_target_string): Add
-mamx-tile, -mamx-int8, -mamx-bf16.
(ix86_option_override_internal): Handle AMX-TILE,
AMX-INT8, AMX-BF16.
* config/i386/i386.h (TARGET_AMX_TILE, TARGET_AMX_TILE_P,
TARGET_AMX_INT8, TARGET_AMX_INT8_P, TARGET_AMX_BF16_P,
PTA_AMX_TILE, PTA_AMX_INT8, PTA_AMX_BF16): New macros.
* config/i386/i386.opt: Add -mamx-tile, -mamx-int8, -mamx-bf16.
* config/i386/immintrin.h: Include amxtileintrin.h,
amxint8intrin.h, amxbf16intrin.h.
* doc/invoke.texi: Document -mamx-tile, -mamx-int8, -mamx-bf16.
* doc/extend.texi: Document amx-tile, amx-int8, amx-bf16.
* doc/sourcebuild.texi ((Effective-Target Keywords, Other
hardware attributes): Document amx_int8, amx_tile, amx_bf16.

gcc/testsuite/ChangeLog

* lib/target-supports.exp (check_effective_target_amx_tile,
check_effective_target_amx_int8,
check_effective_target_amx_bf16): New proc.
* g++.dg/other/i386-2.C: Add -mamx-tile, -mamx-int8, -mamx-bf16.
* g++.dg/other/i386-3.C: Ditto.
* gcc.target/i386/sse-12.c: Ditto.
* gcc.target/i386/sse-13.c: Ditto.
* gcc.target/i386/sse-14.c: Ditto.
* gcc.target/i386/sse-22.c: Ditto.
* gcc.target/i386/sse-23.c: Ditto.
* gcc.target/i386/funcspec-56.inc: Add new target attribute.
* gcc.target/i386/amx-check.h: New header file.
* gcc.target/i386/amxbf16-asmatt-1.c: New test.
* gcc.target/i386/amxint8-asmatt-1.c: New test.
* gcc.target/i386/amxtile-asmatt-1.c: Ditto.
* gcc.target/i386/amxbf16-asmintel-1.c: Ditto.
* gcc.target/i386/amxint8-asmintel-1.c: Ditto.
* gcc.target/i386/amxtile-asmintel-1.c: Ditto.
* gcc.target/i386/amxbf16-dpbf16ps-2.c: Ditto.
* gcc.target/i386/amxint8-dpbssd-2.c: Ditto.
* gcc.target/i386/amxint8-dpbsud-2.c: Ditto.
* gcc.target/i386/amxint8-dpbusd-2.c: Ditto.
* gcc.target/i386/amxint8-dpbuud-2.c: Ditto.
* gcc.target/i386/amxtile-2.c: Ditto.
39 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/amxbf16intrin.h [new file with mode: 0644]
gcc/config/i386/amxint8intrin.h [new file with mode: 0644]
gcc/config/i386/amxtileintrin.h [new file with mode: 0644]
gcc/config/i386/cpuid.h
gcc/config/i386/i386-c.c
gcc/config/i386/i386-options.c
gcc/config/i386/i386.h
gcc/config/i386/i386.opt
gcc/config/i386/immintrin.h
gcc/doc/extend.texi
gcc/doc/invoke.texi
gcc/doc/sourcebuild.texi
gcc/testsuite/g++.dg/other/i386-2.C
gcc/testsuite/g++.dg/other/i386-3.C
gcc/testsuite/gcc.target/i386/amx-check.h [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/amxbf16-asmatt-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/amxbf16-asmintel-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/amxbf16-dpbf16ps-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/amxint8-asmatt-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/amxint8-asmintel-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/amxint8-dpbssd-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/amxint8-dpbsud-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/amxint8-dpbusd-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/amxint8-dpbuud-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/amxtile-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/amxtile-asmatt-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/amxtile-asmintel-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/funcspec-56.inc
gcc/testsuite/gcc.target/i386/sse-12.c
gcc/testsuite/gcc.target/i386/sse-13.c
gcc/testsuite/gcc.target/i386/sse-14.c
gcc/testsuite/gcc.target/i386/sse-22.c
gcc/testsuite/gcc.target/i386/sse-23.c
gcc/testsuite/lib/target-supports.exp