OSDN Git Service

2009-09-29 Harsha Jagasia <harsha.jagasia@amd.com>
authorhjagasia <hjagasia@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 30 Sep 2009 00:00:45 +0000 (00:00 +0000)
committerhjagasia <hjagasia@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 30 Sep 2009 00:00:45 +0000 (00:00 +0000)
commit2f212aae96e5a5b2c09d87fa91592b5a2a573e7e
treea6738f5a8818475b5816bfd870277e6deb35e967
parente9d5f86f47e11658e51f16ff38fd87729cbe688d
2009-09-29  Harsha Jagasia  <harsha.jagasia@amd.com>

* config.gcc (i[34567]86-*-*): Include fma4intrin.h.
(x86_64-*-*): Ditto.

* config/i386/fma4intrin.h: New file, provide common x86 compiler
intrinisics for FMA4.
* config/i386/cpuid.h (bit_FMA4): Define FMA4 bit.
* config/i386/x86intrin.h: Fix typo to SSE4A instead of SSE4a.
Add FMA4 check and fma4intrin.h.
* config/i386/i386-c.c(ix86_target_macros_internal): Check
ISA_FLAG for FMA4.
* config/i386/i386.h(TARGET_FMA4): New macro for FMA4.
* config/i386/i386.md (UNSPEC_FMA4_INTRINSIC): Add new UNSPEC
constant for FMA4 support.
(UNSPEC_FMA4_FMADDSUB): Ditto.
(UNSPEC_FMA4_FMSUBADD): Ditto.
* config/i386/i386.opt (-mfma4): New switch for FMA4 support.
* config/i386/i386-protos.h (ix86_fma4_valid_op_p): Add
declaration.
(ix86_expand_fma4_multiple_memory): Ditto.
* config/i386/i386.c (OPTION_MASK_ISA_FMA4_SET): New.
(OPTION_MASK_ISA_FMA4_UNSET): New.
(OPTION_MASK_ISA_SSE4A_UNSET): Change definition to
depend on FMA4.
(OPTION_MASK_ISA_AVX_UNSET): Change definition to
depend on FMA4.
(ix86_handle_option): Handle -mfma4.
(isa_opts): Handle -mfma4.
(enum pta_flags): Add PTA_FMA4.
(override_options): Add FMA4 support.
(IX86_BUILTIN_VFMADDSS): New for FMA4 intrinsic.
(IX86_BUILTIN_VFMADDSD): Ditto.
(IX86_BUILTIN_VFMADDPS): Ditto.
(IX86_BUILTIN_VFMADDPD): Ditto.
(IX86_BUILTIN_VFMSUBSS): Ditto.
(IX86_BUILTIN_VFMSUBSD): Ditto.
(IX86_BUILTIN_VFMSUBPS): Ditto.
(IX86_BUILTIN_VFMSUBPD): Ditto.
(IX86_BUILTIN_VFMADDSUBPS): Ditto.
(IX86_BUILTIN_VFMADDSUBPD): Ditto.
(IX86_BUILTIN_VFMSUBADDPS): Ditto.
(IX86_BUILTIN_VFMSUBADDPD): Ditto.
(IX86_BUILTIN_VFNMADDSS): Ditto.
(IX86_BUILTIN_VFNMADDSD): Ditto.
(IX86_BUILTIN_VFNMADDPS): Ditto.
(IX86_BUILTIN_VFNMADDPD): Ditto.
(IX86_BUILTIN_VFNMSUBSS): Ditto.
(IX86_BUILTIN_VFNMSUBSD): Ditto.
(IX86_BUILTIN_VFNMSUBPS): Ditto.
(IX86_BUILTIN_VFNMSUBPD): Ditto.
(IX86_BUILTIN_VFMADDPS256): Ditto.
(IX86_BUILTIN_VFMADDPD256): Ditto.
(IX86_BUILTIN_VFMSUBPS256): Ditto.
(IX86_BUILTIN_VFMSUBPD256): Ditto.
(IX86_BUILTIN_VFMADDSUBPS256): Ditto.
(IX86_BUILTIN_VFMADDSUBPD256): Ditto.
(IX86_BUILTIN_VFMSUBADDPS256): Ditto.
(IX86_BUILTIN_VFMSUBADDPD256): Ditto.
(IX86_BUILTIN_VFNMADDPS256): Ditto.
(IX86_BUILTIN_VFNMADDPD256): Ditto.
(IX86_BUILTIN_VFNMSUBPS256): Ditto.
(IX86_BUILTIN_VFNMSUBPD256): Ditto.
(enum multi_arg_type): New enum for describing the various FMA4
intrinsic argument types.
(bdesc_multi_arg): New table for FMA4 intrinsics.
(ix86_init_mmx_sse_builtins): Add FMA4 intrinsic support.
(ix86_expand_multi_arg_builtin): New function for creating FMA4
intrinsics.
(ix86_expand_builtin): Add FMA4 intrinsic support.
(ix86_fma4_valid_op_p): New function to validate FMA4 3 and 4
operand instructions.
(ix86_expand_fma4_multiple_memory): New function to split the
second memory reference from FMA4 instructions.
* config/i386/sse.md (ssemodesuffixf4): New mode attribute for FMA4.
(ssemodesuffixf2s): Ditto.
(fma4_fmadd<mode>4): Add FMA4 floating point multiply/add
instructions.
(fma4_fmsub<mode>4): Ditto.
(fma4_fnmadd<mode>4): Ditto.
(fma4_fnmsub<mode>4): Ditto.
(fma4_vmfmadd<mode>4): Ditto.
(fma4_vmfmsub<mode>4): Ditto.
(fma4_vmfnmadd<mode>4): Ditto.
(fma4_vmfnmsub<mode>4): Ditto.
(fma4_fmadd<mode>4256): Ditto.
(fma4_fmsub<mode>4256): Ditto.
(fma4_fnmadd<mode>4256): Ditto.
(fma4_fnmsub<mode>4256): Ditto.
(fma4_fmaddsubv8sf4): Ditto.
(fma4_fmaddsubv4sf4): Ditto.
(fma4_fmaddsubv4df4): Ditto.
(fma4_fmaddsubv2df4): Ditto.
(fma4_fmsubaddv8sf4): Ditto.
(fma4_fmsubaddv4sf4): Ditto.
(fma4_fmsubaddv4df4): Ditto.
(fma4_fmsubaddv2df4): Ditto.
(fma4i_fmadd<mode>4): Add FMA4 floating point multiply/add
instructions for intrinsics.
(fma4i_fmsub<mode>4): Ditto.
(fma4i_fnmadd<mode>4): Ditto.
(fma4i_fnmsub<mode>4): Ditto.
(fma4i_vmfmadd<mode>4): Ditto.
(fma4i_vmfmsub<mode>4): Ditto.
(fma4i_vmfnmadd<mode>4): Ditto.
(fma4i_vmfnmsub<mode>4): Ditto.
(fma4i_fmadd<mode>4256): Ditto.
(fma4i_fmsub<mode>4256): Ditto.
(fma4i_fnmadd<mode>4256): Ditto.
(fma4i_fnmsub<mode>4256): Ditto.
(fma4i_fmaddsubv8sf4): Ditto.
(fma4i_fmaddsubv4sf4): Ditto.
(fma4i_fmaddsubv4df4): Ditto.
(fma4i_fmaddsubv2df4): Ditto.
(fma4i_fmsubaddv8sf4): Ditto.
(fma4i_fmsubaddv4sf4): Ditto.
(fma4i_fmsubaddv4df4): Ditto.
(fma4i_fmsubaddv2df4): Ditto.

* doc/invoke.texi (-mfma4): Add documentation.
* doc/extend.texi (x86 intrinsics): Add FMA4 intrinsics.

* gcc.target/i386/fma4-check.h
* gcc.target/i386/fma4-fma.c
* gcc.target/i386/fma4-maccXX.c
* gcc.target/i386/fma4-msubXX.c
* gcc.target/i386/fma4-nmaccXX.c
* gcc.target/i386/fma4-nmsubXX.c
* gcc.target/i386/fma4-vector.c
* gcc.target/i386/fma4-256-maccXX.c
* gcc.target/i386/fma4-256-msubXX.c
* gcc.target/i386/fma4-256-nmaccXX.c
* gcc.target/i386/fma4-256-nmsubXX.c
* gcc.target/i386/fma4-256-vector.c
* gcc.target/i386/funcspec-2.c: New file.
* gcc.target/i386/funcspec-4.c: Test error conditions
related to FMA4.
* gcc.target/i386/funcspec-5.c
* gcc.target/i386/funcspec-6.c
* gcc.target/i386/funcspec-8.c: Add FMA4.
* gcc.target/i386/funcspec-9.c: New file.
* gcc.target/i386/i386.exp: Add check_effective_target_fma4.
* gcc.target/i386/isa-10.c
* gcc.target/i386/isa-11.c
* gcc.target/i386/isa-12.c
* gcc.target/i386/isa-13.c
* gcc.target/i386/isa-2.c
* gcc.target/i386/isa-3.c
* gcc.target/i386/isa-4.c
* gcc.target/i386/isa-7.c
* gcc.target/i386/isa-8.c
* gcc.target/i386/isa-9.c: New file.
* gcc.target/i386/isa-14.c
* gcc.target/i386/isa-1.c
* gcc.target/i386/isa-5.c
* gcc.target/i386/isa-6.c: Add FMA4.
* gcc.target/i386/sse-12.c
* gcc.target/i386/sse-13.c
* gcc.target/i386/sse-14.c
* gcc.target/i386/sse-22.c: New file.
* g++.dg/other/i386-2.C
* g++.dg/other/i386-3.C
* g++.dg/other/i386-5.C
* g++.dg/other/i386-6.C: Add -mfma4 in dg-options.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@152311 138bc75d-0d04-0410-961f-82ee72b054a4
56 files changed:
gcc/ChangeLog
gcc/config.gcc
gcc/config/i386/cpuid.h
gcc/config/i386/fma4intrin.h [new file with mode: 0644]
gcc/config/i386/i386-c.c
gcc/config/i386/i386-protos.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/x86intrin.h
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/g++.dg/other/i386-5.C
gcc/testsuite/g++.dg/other/i386-6.C
gcc/testsuite/gcc.target/i386/fma4-256-maccXX.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/fma4-256-msubXX.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/fma4-256-nmaccXX.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/fma4-256-nmsubXX.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/fma4-256-vector.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/fma4-check.h [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/fma4-fma.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/fma4-maccXX.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/fma4-msubXX.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/fma4-nmaccXX.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/fma4-nmsubXX.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/fma4-vector.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/funcspec-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/funcspec-4.c
gcc/testsuite/gcc.target/i386/funcspec-5.c
gcc/testsuite/gcc.target/i386/funcspec-6.c
gcc/testsuite/gcc.target/i386/funcspec-8.c
gcc/testsuite/gcc.target/i386/funcspec-9.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/i386.exp
gcc/testsuite/gcc.target/i386/isa-1.c
gcc/testsuite/gcc.target/i386/isa-10.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/isa-11.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/isa-12.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/isa-13.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/isa-14.c
gcc/testsuite/gcc.target/i386/isa-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/isa-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/isa-4.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/isa-5.c
gcc/testsuite/gcc.target/i386/isa-6.c
gcc/testsuite/gcc.target/i386/isa-7.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/isa-8.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/isa-9.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/sse-12.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/sse-13.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/sse-14.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/sse-22.c [new file with mode: 0644]