diff options
author | kyukhin <kyukhin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-07-30 13:40:25 +0000 |
---|---|---|
committer | kyukhin <kyukhin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-07-30 13:40:25 +0000 |
commit | eff9fe284fb7b0844e3f247f409dafa7c1e48592 (patch) | |
tree | 04e7ea9f770791813a992b8c189720b259018848 /gcc/common | |
parent | 5aabc5f292b78a0817d5e92bb0132e96d949aaef (diff) | |
download | gcc-eff9fe284fb7b0844e3f247f409dafa7c1e48592.tar.gz |
/
* common/config/i386/i386-common.c (OPTION_MASK_ISA_RDSEED_SET): New.
(OPTION_MASK_ISA_RDSEED_UNSET): Likewise.
(ix86_handle_option): Handle mrdseed option.
* config.gcc (i[34567]86-*-*): Add rdseedintrin.h.
(x86_64-*-*): Likewise.
* config/i386/prfchwintrin.h: New header.
* config/i386/cpuid.h (bit_RDSEED): New.
* config/i386/driver-i386.c (host_detect_local_cpu): Detect
RDSEED support.
* config/i386/i386-c.c: Define __RDSEED__ if needed.
* config/i386/i386.c (ix86_target_string): Define
-mrdseed option.
(PTA_RDSEED): New.
(ix86_option_override_internal): Handle new option.
(ix86_valid_target_attribute_inner_p): Add OPT_mrdseed.
(ix86_builtins): Add enum entries for RDSEED* builtins.
(ix86_init_mmx_sse_builtins): Define new builtins.
(ix86_expand_builtin): Expand RDSEED* builtins.
* config/i386/i386.h (TARGET_RDSEED): New.
* config/i386/i386.md (rdseed<mode>_1): New.
* config/i386/i386.opt (mrdseed): New.
* config/i386/x86intrin.h: Include rdseedintrin.h.
testsuite/
* gcc.target/i386/rdseed16-1.c: New.
* gcc.target/i386/rdseed32-1.c: Ditto
* gcc.target/i386/rdseed64-1.c: Ditto
* gcc.target/i386/sse-12.c: Add -mrdseed.
* gcc.target/i386/sse-13.c: Ditto.
* gcc.target/i386/sse-14.c: Ditto.
* g++.dg/other/i386-2.C: Ditto.
* g++.dg/other/i386-3.C: Ditto.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@189973 138bc75d-0d04-0410-961f-82ee72b054a4
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 e2e4814e808..70dcae07a33 100644 --- a/gcc/common/config/i386/i386-common.c +++ b/gcc/common/config/i386/i386-common.c @@ -56,6 +56,7 @@ along with GCC; see the file COPYING3. If not see (OPTION_MASK_ISA_AVX2 | OPTION_MASK_ISA_AVX_SET) #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 /* SSE4 includes both SSE4.1 and SSE4.2. -msse4 should be the same as -msse4.2. */ @@ -125,6 +126,7 @@ along with GCC; see the file COPYING3. If not see #define OPTION_MASK_ISA_AVX2_UNSET OPTION_MASK_ISA_AVX2 #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 /* SSE4 includes both SSE4.1 and SSE4.2. -mno-sse4 should the same as -mno-sse4.1. */ @@ -570,6 +572,19 @@ ix86_handle_option (struct gcc_options *opts, } return true; + case OPT_mrdseed: + if (value) + { + opts->x_ix86_isa_flags |= OPTION_MASK_ISA_RDSEED_SET; + opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_RDSEED_SET; + } + else + { + opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_RDSEED_UNSET; + opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_RDSEED_UNSET; + } + return true; + case OPT_mprfchw: if (value) { |