config.gcc (extra_headers): Add wmmintrin.h for x86 and x86-64.
authorH.J. Lu <hongjiu.lu@intel.com>
Fri, 4 Apr 2008 16:10:52 +0000 (16:10 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Fri, 4 Apr 2008 16:10:52 +0000 (09:10 -0700)
commit8b96a312a0dbbfb84f5162a8a1cca553edac6fa8
tree25211283997297a5a20cd8a102186f545171ee39
parente892493899b225a21746d24221d7dc45fc19fed2
config.gcc (extra_headers): Add wmmintrin.h for x86 and x86-64.

gcc/

2008-04-04  H.J. Lu  <hongjiu.lu@intel.com>

* config.gcc (extra_headers): Add wmmintrin.h for x86 and x86-64.

* config/i386/cpuid.h (bit_AES): New.
(bit_PCLMUL): Likewise.

* config/i386/i386.c (pta_flags): Add PTA_AES and PTA_PCLMUL.
(override_options): Handle PTA_AES and PTA_PCLMUL.  Enable
SSE2 if AES or PCLMUL is enabled.
(ix86_builtins): Add IX86_BUILTIN_AESENC128,
IX86_BUILTIN_AESENCLAST128, IX86_BUILTIN_AESDEC128,
IX86_BUILTIN_AESDECLAST128, IX86_BUILTIN_AESIMC128,
IX86_BUILTIN_AESKEYGENASSIST128 and IX86_BUILTIN_PCLMULQDQ128.
(bdesc_sse_3arg): Add IX86_BUILTIN_PCLMULQDQ128.
(bdesc_2arg): Add IX86_BUILTIN_AESENC128,
IX86_BUILTIN_AESENCLAST128, IX86_BUILTIN_AESDEC128,
IX86_BUILTIN_AESDECLAST128 and IX86_BUILTIN_AESKEYGENASSIST128.
(bdesc_1arg): Add IX86_BUILTIN_AESIMC128.
(ix86_init_mmx_sse_builtins): Define __builtin_ia32_aesenc128,
__builtin_ia32_aesenclast128, __builtin_ia32_aesdec128,
__builtin_ia32_aesdeclast128,__builtin_ia32_aesimc128,
__builtin_ia32_aeskeygenassist128 and
__builtin_ia32_pclmulqdq128.
* config/i386/i386.c (ix86_expand_binop_imm_builtin): New.
(ix86_expand_builtin): Use it for IX86_BUILTIN_PSLLDQI128 and
IX86_BUILTIN_PSRLDQI128.  Handle IX86_BUILTIN_AESKEYGENASSIST128.

* config/i386/i386.h (TARGET_AES): New.
(TARGET_PCLMUL): Likewise.
(TARGET_CPU_CPP_BUILTINS): Handle TARGET_AES and TARGET_PCLMUL.

* config/i386/i386.md (UNSPEC_AESENC): New.
(UNSPEC_AESENCLAST): Likewise.
(UNSPEC_AESDEC): Likewise.
(UNSPEC_AESDECLAST): Likewise.
(UNSPEC_AESIMC): Likewise.
(UNSPEC_AESKEYGENASSIST): Likewise.
(UNSPEC_PCLMULQDQ): Likewise.

* config/i386/i386.opt (maes): New.
(mpclmul): Likewise.

* config/i386/sse.md (aesenc): New pattern.
(aesenclast): Likewise.
(aesdec): Likewise.
(aesdeclast): Likewise.
(aesimc): Likewise.
(aeskeygenassist): Likewise.
(pclmulqdq): Likewise.

* config/i386/wmmintrin.h: New.

* doc/extend.texi: Document AES and PCLMUL built-in function.

* doc/invoke.texi: Document -maes and -mpclmul.

gcc/testsuite/

2008-04-04  H.J. Lu  <hongjiu.lu@intel.com>

* g++.dg/other/i386-2.C: Include <wmmintrin.h>.
* g++.dg/other/i386-3.C: Likewise.
* gcc.target/i386/sse-13.c: Likewise.
* gcc.target/i386/sse-14.c: Likewise.

* gcc.target/i386/aes-check.h: New.
* gcc.target/i386/aesdec.c: Likewise.
* gcc.target/i386/aesdeclast.c: Likewise.
* gcc.target/i386/aesenc.c: Likewise.
* gcc.target/i386/aesenclast.c: Likewise.
* gcc.target/i386/aesimc.c: Likewise.
* gcc.target/i386/aeskeygenassist.c: Likewise.
* gcc.target/i386/pclmulqdq.c: Likewise.
* gcc.target/i386/pclmul-check.h: Likewise.

* gcc.target/i386/i386.exp (check_effective_target_aes): New.
(check_effective_target_pclmul): Likewise.

From-SVN: r133902
26 files changed:
gcc/ChangeLog
gcc/config.gcc
gcc/config/i386/cpuid.h
gcc/config/i386/i386.c
gcc/config/i386/i386.h
gcc/config/i386/i386.md
gcc/config/i386/i386.opt
gcc/config/i386/sse.md
gcc/config/i386/wmmintrin.h [new file with mode: 0644]
gcc/doc/extend.texi
gcc/doc/invoke.texi
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/other/i386-2.C
gcc/testsuite/g++.dg/other/i386-3.C
gcc/testsuite/gcc.target/i386/aes-check.h [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/aesdec.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/aesdeclast.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/aesenc.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/aesenclast.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/aesimc.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/aeskeygenassist.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/i386.exp
gcc/testsuite/gcc.target/i386/pclmul-check.h [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pclmulqdq.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/sse-13.c
gcc/testsuite/gcc.target/i386/sse-14.c