summaryrefslogtreecommitdiff
path: root/gcc/common
diff options
context:
space:
mode:
authorkyukhin <kyukhin@138bc75d-0d04-0410-961f-82ee72b054a4>2012-10-26 09:45:46 +0000
committerkyukhin <kyukhin@138bc75d-0d04-0410-961f-82ee72b054a4>2012-10-26 09:45:46 +0000
commit32eca732897e9d19bf26f1283582ee3ff120ffed (patch)
tree1b96719a7b5555bb3bf9215deb11b80b13b827c0 /gcc/common
parentf8a22db12792095b65e73ef9c6c46f75ca2272f0 (diff)
downloadgcc-32eca732897e9d19bf26f1283582ee3ff120ffed.tar.gz
ChangeLog/
* gcc/common/config/i386/i386-common.c (OPTION_MASK_ISA_FXSR_SET): New. (OPTION_MASK_ISA_XSAVE_SET): Likewise. (OPTION_MASK_ISA_XSAVEOPT_SET): Likewise. (ix86_handle_option): Handle mfxsr, mxsave, mxsaveopt options. * gcc/config.gcc (i[34567]86-*-*): Add fxsrintrin.h, xsaveintrin.h, xsaveoptintrin.h. (x86_64-*-*): Likewise. * config/i386/fxsrintrin.h: New header. * config/i386/xsaveintrin.h: Likewise. * config/i386/xsaveoptintrin.h: Likewise. * gcc/config/i386/driver-i386.c (host_detect_local_cpu): Detect FXSR/XSAVE/XSAVEOPT support. * gcc/config/i386/i386-builtin-types.def (VOID_FTYPE_PVOID_INT64): New function type. * gcc/config/i386/i386-c.c: Define __FXSR__, __XSAVE__ and __XSAVEOPT__ if needed. * gcc/config/i386/i386.c (ix86_target_string): Define -mfxsr, -mxsave and -mxsaveopt options. (PTA_FXSR): New. (PTA_XSAVE): Likewise. (PTA_XSAVEOPT): Likewise. (ix86_option_override_internal): Handle new option. (processor_alias_table): Added PTA_FXSR, PTA_XSAVE, PTA_XSAVEOPT. (ix86_valid_target_attribute_inner_p): Add OPT_mfxsr, OPT_mxsave, OPT_mxsaveopt. (ix86_builtins): Add IX86_BUILTIN_FXSAVE, IX86_BUILTIN_FXRSTOR, IX86_BUILTIN_FXSAVE64, IX86_BUILTIN_XSAVE, IX86_BUILTIN_XSAVE64, IX86_BUILTIN_XRSTOR, IX86_BUILTIN_XRSTOR64, IX86_BUILTIN_XSAVEOPT, IX86_BUILTIN_XSAVEOPT64. (ix86_expand_builtin): Handle these built-ins. * gcc/config/i386/i386.h (TARGET_FXSR): New. (TARGET_XSAVE): Likewise. (TARGET_XSAVEOPT): Likewise. * gcc/config/i386/i386.md (ANY_XSAVE): New int iterator. (ANY_XSAVE64): Likewise. (xsave): New int attribute. (fxsave): New instruction. (fxsave64): Likewise. (fxrstor): Likewise. (fxrstor64): Likewise. (<xsave>): Likewise. (<xsave>_rex64): Likewise. (xrstor): Likewise. (xrstor_rex64): Likewise. (xrstor64): Likewise. * gcc/config/i386/i386.opt (mfxsr): New. (mxsave): Likewise. (mxsaveopt): Likewise. * gcc/config/i386/x86intrin.h: Include xsaveintrin.h, fxsrintrin.h, xsaveoptintrin.h. testsuite/ChangeLog * gcc.target/i386/fxsave-1.c: New. * gcc.target/i386/fxsave64-1.c: Ditto. * gcc.target/i386/fxrstor-1.c: Ditto. * gcc.target/i386/fxrstor64-1.c: Ditto. * gcc.target/i386/xsave-1.c: Ditto. * gcc.target/i386/xsave64-1.c: Ditto. * gcc.target/i386/xrstor-1.c: Ditto. * gcc.target/i386/xrstor64-1.c: Ditto. * gcc.target/i386/xsaveopt-1.c: Ditto. * gcc.target/i386/xsaveopt64-1.c: Ditto. * gcc.target/i386/sse-12.c: Add -mfxsr, -mxsaveopt. * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@192840 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/common')
-rw-r--r--gcc/common/config/i386/i386-common.c52
1 files changed, 50 insertions, 2 deletions
diff --git a/gcc/common/config/i386/i386-common.c b/gcc/common/config/i386/i386-common.c
index e05cd562f44..da3967ea8c6 100644
--- a/gcc/common/config/i386/i386-common.c
+++ b/gcc/common/config/i386/i386-common.c
@@ -49,11 +49,16 @@ along with GCC; see the file COPYING3. If not see
#define OPTION_MASK_ISA_SSE4_2_SET \
(OPTION_MASK_ISA_SSE4_2 | OPTION_MASK_ISA_SSE4_1_SET)
#define OPTION_MASK_ISA_AVX_SET \
- (OPTION_MASK_ISA_AVX | OPTION_MASK_ISA_SSE4_2_SET)
+ (OPTION_MASK_ISA_AVX | OPTION_MASK_ISA_SSE4_2_SET \
+ | OPTION_MASK_ISA_XSAVE_SET)
#define OPTION_MASK_ISA_FMA_SET \
(OPTION_MASK_ISA_FMA | OPTION_MASK_ISA_AVX_SET)
#define OPTION_MASK_ISA_AVX2_SET \
(OPTION_MASK_ISA_AVX2 | OPTION_MASK_ISA_AVX_SET)
+#define OPTION_MASK_ISA_FXSR_SET OPTION_MASK_ISA_FXSR
+#define OPTION_MASK_ISA_XSAVE_SET OPTION_MASK_ISA_XSAVE
+#define OPTION_MASK_ISA_XSAVEOPT_SET \
+ (OPTION_MASK_ISA_XSAVEOPT | OPTION_MASK_ISA_XSAVE)
#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
@@ -122,9 +127,13 @@ along with GCC; see the file COPYING3. If not see
#define OPTION_MASK_ISA_AVX_UNSET \
(OPTION_MASK_ISA_AVX | OPTION_MASK_ISA_FMA_UNSET \
| OPTION_MASK_ISA_FMA4_UNSET | OPTION_MASK_ISA_F16C_UNSET \
- | OPTION_MASK_ISA_AVX2_UNSET)
+ | OPTION_MASK_ISA_AVX2_UNSET | OPTION_MASK_ISA_XSAVE_UNSET)
#define OPTION_MASK_ISA_FMA_UNSET OPTION_MASK_ISA_FMA
#define OPTION_MASK_ISA_AVX2_UNSET OPTION_MASK_ISA_AVX2
+#define OPTION_MASK_ISA_FXSR_UNSET OPTION_MASK_ISA_FXSR
+#define OPTION_MASK_ISA_XSAVE_UNSET \
+ (OPTION_MASK_ISA_XSAVE | OPTION_MASK_ISA_XSAVEOPT_UNSET)
+#define OPTION_MASK_ISA_XSAVEOPT_UNSET OPTION_MASK_ISA_XSAVEOPT
#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
@@ -574,6 +583,45 @@ ix86_handle_option (struct gcc_options *opts,
}
return true;
+ case OPT_mfxsr:
+ if (value)
+ {
+ opts->x_ix86_isa_flags |= OPTION_MASK_ISA_FXSR_SET;
+ opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_FXSR_SET;
+ }
+ else
+ {
+ opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_FXSR_UNSET;
+ opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_FXSR_UNSET;
+ }
+ return true;
+
+ case OPT_mxsave:
+ if (value)
+ {
+ opts->x_ix86_isa_flags |= OPTION_MASK_ISA_XSAVE_SET;
+ opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_XSAVE_SET;
+ }
+ else
+ {
+ opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_XSAVE_UNSET;
+ opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_XSAVE_UNSET;
+ }
+ return true;
+
+ case OPT_mxsaveopt:
+ if (value)
+ {
+ opts->x_ix86_isa_flags |= OPTION_MASK_ISA_XSAVEOPT_SET;
+ opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_XSAVEOPT_SET;
+ }
+ else
+ {
+ opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_XSAVEOPT_UNSET;
+ opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_XSAVEOPT_UNSET;
+ }
+ return true;
+
case OPT_mrdseed:
if (value)
{