diff options
author | Michael Zolotukhin <michael.v.zolotukhin@intel.com> | 2012-08-08 13:25:58 +0000 |
---|---|---|
committer | Kirill Yukhin <kyukhin@gcc.gnu.org> | 2012-08-08 13:25:58 +0000 |
commit | d05e383bc7a06abdc444ff6f42a91fdce0ff3551 (patch) | |
tree | 08fa7a69df52351b77d733e3e1b596f2a978f98f /gcc/common | |
parent | 916f8bbf52a678ae51404a571cdcaad19117aff3 (diff) | |
download | gcc-d05e383bc7a06abdc444ff6f42a91fdce0ff3551.zip gcc-d05e383bc7a06abdc444ff6f42a91fdce0ff3551.tar.gz gcc-d05e383bc7a06abdc444ff6f42a91fdce0ff3551.tar.bz2 |
i386-common.c (OPTION_MASK_ISA_ADX_SET): New.
ChangeLog:
2012-08-08 Michael Zolotukhin <michael.v.zolotukhin@intel.com>
* common/config/i386/i386-common.c (OPTION_MASK_ISA_ADX_SET): New.
(OPTION_MASK_ISA_ADX_UNSET): Likewise.
(ix86_handle_option): Handle madx option.
* config.gcc (i[34567]86-*-*): Add adxintrin.h.
(x86_64-*-*): Likewise.
* config/i386/adxintrin.h: New header.
* config/i386/driver-i386.c (host_detect_local_cpu): Detect ADCX/ADOX
support.
* config/i386/i386-builtin-types.def
(UCHAR_FTYPE_UCHAR_UINT_UINT_PUNSIGNED): New function type.
(UCHAR_FTYPE_UCHAR_ULONGLONG_ULONGLONG_PULONGLONG): Likewise.
* config/i386/i386-c.c: Define __ADX__ if needed.
* config/i386/i386.c (ix86_target_string): Define -madx option.
(PTA_ADX): New.
(ix86_option_override_internal): Handle new option.
(ix86_valid_target_attribute_inner_p): Add OPT_madx.
(ix86_builtins): Add IX86_BUILTIN_ADDCARRYX32,
IX86_BUILTIN_ADDCARRYX64.
(ix86_init_mmx_sse_builtins): Define corresponding built-ins.
(ix86_expand_builtin): Handle these built-ins.
(ix86_expand_args_builtin): Handle new function types.
* config/i386/i386.h (TARGET_ADX): New.
* config/i386/i386.md (adcx<mode>3): New define_insn.
* config/i386/i386.opt (madx): New.
* config/i386/x86intrin.h: Include adxintrin.h.
testsuite/ChangeLog:
* gcc.target/i386/adx-addcarryx32-1.c: New.
* gcc.target/i386/adx-addcarryx32-2.c: New.
* gcc.target/i386/adx-addcarryx64-1.c: New.
* gcc.target/i386/adx-addcarryx64-2.c: New.
* gcc.target/i386/adx-check.h: New.
* gcc.target/i386/i386.exp (check_effective_target_adx): New.
* gcc.target/i386/sse-12.c: Add -madx.
* 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.
* g++.dg/other/i386-2.C: Ditto.
* g++.dg/other/i386-3.C: Ditto.
From-SVN: r190227
Diffstat (limited to 'gcc/common')
-rw-r--r-- | gcc/common/config/i386/i386-common.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/common/config/i386/i386-common.c b/gcc/common/config/i386/i386-common.c index 70dcae0..e05cd56 100644 --- a/gcc/common/config/i386/i386-common.c +++ b/gcc/common/config/i386/i386-common.c @@ -57,6 +57,7 @@ along with GCC; see the file COPYING3. If not see #define OPTION_MASK_ISA_RTM_SET OPTION_MASK_ISA_RTM #define OPTION_MASK_ISA_PRFCHW_SET OPTION_MASK_ISA_PRFCHW #define OPTION_MASK_ISA_RDSEED_SET OPTION_MASK_ISA_RDSEED +#define OPTION_MASK_ISA_ADX_SET OPTION_MASK_ISA_ADX /* SSE4 includes both SSE4.1 and SSE4.2. -msse4 should be the same as -msse4.2. */ @@ -127,6 +128,7 @@ along with GCC; see the file COPYING3. If not see #define OPTION_MASK_ISA_RTM_UNSET OPTION_MASK_ISA_RTM #define OPTION_MASK_ISA_PRFCHW_UNSET OPTION_MASK_ISA_PRFCHW #define OPTION_MASK_ISA_RDSEED_UNSET OPTION_MASK_ISA_RDSEED +#define OPTION_MASK_ISA_ADX_UNSET OPTION_MASK_ISA_ADX /* SSE4 includes both SSE4.1 and SSE4.2. -mno-sse4 should the same as -mno-sse4.1. */ @@ -598,6 +600,19 @@ ix86_handle_option (struct gcc_options *opts, } return true; + case OPT_madx: + if (value) + { + opts->x_ix86_isa_flags |= OPTION_MASK_ISA_ADX_SET; + opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_ADX_SET; + } + else + { + opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_ADX_UNSET; + opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_ADX_UNSET; + } + return true; + /* Comes from final.c -- no real reason to change it. */ #define MAX_CODE_ALIGN 16 |