Go to file
liuhongt 632a2f50b8 Enable GCC to support Intel Key Locker ISA
gcc/ChangeLog

2018-12-15  Xuepeng Guo  <xuepeng.guo@intel.com>
	    Hongyu Wang  <hongyu.wang@intel.com>
	    Hongtao Liu  <hongtao.liu@intel.com>

	* common/config/i386/cpuinfo.h (get_available_features):
	Detect KL, AESKLE and WIDEKL features.
	* common/config/i386/i386-common.c
	(OPTION_MASK_ISA_KL_SET): New.
	(OPTION_MASK_ISA_WIDEKL_SET): Likewise.
	(OPTION_MASK_ISA_KL_UNSET): Likewise.
	(OPTION_MASK_ISA_WIDEKL_UNSET): Likewise.
	(OPTION_MASK_ISA2_AVX2_UNSET): Likewise.
	(OPTION_MASK_ISA2_AVX_UNSET): Likewise.
	(OPTION_MASK_ISA2_SSE4_2_UNSET): Likewise.
	(OPTION_MASK_ISA2_SSE4_1_UNSET): Likewise.
	(OPTION_MASK_ISA2_SSE4_UNSET): Likewise.
	(OPTION_MASK_ISA2_SSSE3_UNSET): Likewise.
	(OPTION_MASK_ISA2_SSE3_UNSET): Likewise.
	(OPTION_MASK_ISA2_SSE2_UNSET): Likewise.
	(OPTION_MASK_ISA2_SSE_UNSET): Likewise.
	(ix86_handle_option): Handle kl and widekl, add dependency chain
	for KL and SSE2.
	* common/config/i386/i386-cpuinfo.h (enum processor_features):
	(FEATURE_KL, FEATURE_AESKLE, FEATURE_WIDEKL): New.
	* common/config/i386/i386-isas.h: Add ISA_NAMES_TABLE_ENTRY
	for KL, AESKLE and WIDEKL.
	* config.gcc: Add keylockerintrin.h.
	* doc/invoke.texi: Document new option -mkl and -mwidekl.
	* doc/extend.texi: Document kl and widekl.
	* config/i386/cpuid.h (bit_KL, bit_AESKLE, bit_WIDEKL): New.
	* config/i386/i386-builtin-types.def ((UINT, UINT, V2DI, V2DI, PVOID),
	(UINT, UINT, V2DI, PVOID), (VOID, V2DI, V2DI, V2DI, UINT),
	(UINT8, PV2DI, V2DI, PCVOID), (UINT8, PV2DI, PCV2DI, PCVOID)): New
	function types.
	* config/i386/i386-builtin.def: Add
	__builtin_ia32_loadiwkey,
	__builtin_ia32_aesdec128kl_u8,
	__builtin_ia32_aesdec256kl_u8,
	__builtin_ia32_aesenc128kl_u8,
	__builtin_ia32_aesenc256kl_u8,
	__builtin_ia32_aesdecwide128kl_u8,
	__builtin_ia32_aesdecwide256kl_u8,
	__builtin_ia32_aesencwide128kl_u8,
	__builtin_ia32_aesencwide256kl_u8,
	__builtin_ia32_encodekey128_u32,
	__builtin_ia32_encodekey256_u32.
	* config/i386/i386-c.c (ix86_target_macros_internal): Handle
	kl and widekl.
	* config/i386/i386-options.c (isa2_opts): Add -mkl and -mwidekl.
	(ix86_option_override_internal): Handle KL and WIDEKL.
	(ix86_valid_target_attribute_inner_p): Add attribute for kl and widekl.
	* config/i386/i386-expand.c
	(ix86_expand_builtin): Expand Keylocker Builtins.
	* config/i386/i386.h (TARGET_KL): New.
	(TARGET_KL_P): Likewise.
	(TARGET_WIDEKL): Likewise.
	(TARGET_WIDEKL_P): Likewise.
	(PTA_KL): Likewise.
	(PTA_WIDEKL): Likewise.
	(PTA_TIGERLAKE): Add PTA_KL, PTA_WIDEKL.
	(PTA_ALDERLAKE): Likewise.
	* config/i386/i386.opt: Add new option mkl and mwidekl.
	* config/i386/keylockerintrin.h: New header file for Keylocker.
	* config/i386/immintrin.h: Include keylockerintrin.h.
	* config/i386/predicates.md (encodekey128_operation): New
	predicate.
	(encodekey256_operation): Likewise.
	(aeswidekl_operation): Likewise.
	* config/i386/sse.md (UNSPECV_LOADIWKEY): New.
	(UNSPECV_AESDEC128KLU8): Likewise.
	(UNSPECV_AESENC128KLU8): Likewise.
	(UNSPECV_AESDEC256KLU8): Likewise.
	(UNSPECV_AESENC256KLU8): Likewise.
	(UNSPECV_AESDECWIDE128KLU8): Likewise.
	(UNSPECV_AESENCWIDE128KLU8): Likewise.
	(UNSPECV_AESDECWIDE256KLU8): Likewise.
	(UNSPECV_AESENCWIDE256KLU8): Likewise.
	(UNSPECV_ENCODEKEY128U32): Likewise.
	(UNSPECV_ENCODEKEY256U32): Likewise.
	(encodekey128u32): New expander.
	(encodekey256u32): Likewise.
	(aes<aeswideklvariant>u8): Likewise.
	(loadiwkey): New insn pattern.
	(*encodekey128u32): Likewise.
	(*encodekey256u32): Likewise.
	(aes<aesklvariant>u8): Likewise.
	(*aes<aeswideklvariant>u8): Likewise.

gcc/testsuite/ChangeLog

	* gcc.target/i386/keylocker-aesdec128kl.c: New test.
	* gcc.target/i386/keylocker-aesdec256kl.c: Likewise.
	* gcc.target/i386/keylocker-aesdecwide128kl.c: Likewise.
	* gcc.target/i386/keylocker-aesdecwide256kl.c: Likewise.
	* gcc.target/i386/keylocker-aesenc128kl.c: Likewise.
	* gcc.target/i386/keylocker-aesencwide128kl.c: Likewise.
	* gcc.target/i386/keylocker-aesencwide256kl.c: Likewise.
	* gcc.target/i386/keylocker-encodekey128.c: Likewise.
	* gcc.target/i386/keylocker-encodekey256.c: Likewise.
	* gcc.target/i386/keylocker-loadiwkey.c: Likewise.
	* g++.dg/other/i386-2.C: Add -mkl and -mwidekl.
	* g++.dg/other/i386-3.C: Likewise.
	* gcc.target/i386/sse-12.c: Likewise.
	* gcc.target/i386/sse-13.c: Likewise.
	* gcc.target/i386/sse-14.c: Likewise.
	* gcc.target/i386/sse-22.c: Add kl and widekl.
	* gcc.target/i386/sse-23.c: Likewise.
	* gcc.target/i386/funcspec-56.inc: Add new target attribute test.
2020-10-29 16:42:47 +08:00
config
contrib
fixincludes
gcc Enable GCC to support Intel Key Locker ISA 2020-10-29 16:42:47 +08:00
gnattools
gotools libgo: handle linking to NetBSD's versioned symbols 2020-10-28 18:20:50 -07:00
include
INSTALL
intl
libada
libatomic
libbacktrace
libcc1
libcpp
libdecnumber
libffi
libgcc Daily bump. 2020-10-28 00:16:38 +00:00
libgfortran
libgo libgo: handle linking to NetBSD's versioned symbols 2020-10-28 18:20:50 -07:00
libgomp Daily bump. 2020-10-29 00:16:50 +00:00
libhsail-rt
libiberty
libitm
libobjc
liboffloadmic
libphobos Daily bump. 2020-10-28 00:16:38 +00:00
libquadmath
libsanitizer
libssp
libstdc++-v3 libstdc++: Fix new basic_stringbuf constructor 2020-10-29 01:28:12 +00:00
libvtv
lto-plugin
maintainer-scripts
zlib
.dir-locals.el
.gitattributes
.gitignore
ABOUT-NLS
ar-lib
ChangeLog
ChangeLog.jit
ChangeLog.tree-ssa
compile
config-ml.in
config.guess
config.rpath
config.sub
configure
configure.ac
COPYING
COPYING3
COPYING3.LIB
COPYING.LIB
COPYING.RUNTIME
depcomp
install-sh
libtool-ldflags
libtool.m4
lt~obsolete.m4
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
MAINTAINERS
Makefile.def
Makefile.in
Makefile.tpl
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
README
symlink-tree
test-driver
ylwrap

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.