From 73e32c4743fbd0d2c16ea2fb9212540707f3c01a Mon Sep 17 00:00:00 2001 From: Julia Koval Date: Wed, 11 Jan 2017 22:41:13 +0100 Subject: i386-common.c (OPTION_MASK_ISA_SGX_UNSET): New. * common/config/i386/i386-common.c (OPTION_MASK_ISA_SGX_UNSET): New. (OPTION_MASK_ISA_SGX_SET): New. (ix86_handle_option): Handle OPT_msgx. * config.gcc: Added sgxintrin.h. * config/i386/driver-i386.c (host_detect_local_cpu): Detect sgx. * config/i386/i386-c.c (ix86_target_macros_internal): Define __SGX__. * config/i386/i386.c (ix86_target_string): Add -msgx. (PTA_SGX): New. (ix86_option_override_internal): Handle new options. (ix86_valid_target_attribute_inner_p): Add sgx. * config/i386/i386.h (TARGET_SGX, TARGET_SGX_P): New. * config/i386/i386.opt: Add msgx. * config/i386/sgxintrin.h: New file. * config/i386/x86intrin.h: Add sgxintrin.h. testsuite/ChangeLog: * gcc.target/i386/sgx.c New test. * gcc.target/i386/sse-12.c: Add -msgx. * 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. Co-Authored-By: Uros Bizjak From-SVN: r244339 --- gcc/common/config/i386/i386-common.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'gcc/common') diff --git a/gcc/common/config/i386/i386-common.c b/gcc/common/config/i386/i386-common.c index 4152ef8..5f6c3e2 100644 --- a/gcc/common/config/i386/i386-common.c +++ b/gcc/common/config/i386/i386-common.c @@ -116,6 +116,7 @@ along with GCC; see the file COPYING3. If not see #define OPTION_MASK_ISA_ABM_SET \ (OPTION_MASK_ISA_ABM | OPTION_MASK_ISA_POPCNT) +#define OPTION_MASK_ISA_SGX_SET OPTION_MASK_ISA_SGX #define OPTION_MASK_ISA_BMI_SET OPTION_MASK_ISA_BMI #define OPTION_MASK_ISA_BMI2_SET OPTION_MASK_ISA_BMI2 #define OPTION_MASK_ISA_LZCNT_SET OPTION_MASK_ISA_LZCNT @@ -214,6 +215,7 @@ along with GCC; see the file COPYING3. If not see #define OPTION_MASK_ISA_SHA_UNSET OPTION_MASK_ISA_SHA #define OPTION_MASK_ISA_PCLMUL_UNSET OPTION_MASK_ISA_PCLMUL #define OPTION_MASK_ISA_ABM_UNSET OPTION_MASK_ISA_ABM +#define OPTION_MASK_ISA_SGX_UNSET OPTION_MASK_ISA_SGX #define OPTION_MASK_ISA_BMI_UNSET OPTION_MASK_ISA_BMI #define OPTION_MASK_ISA_BMI2_UNSET OPTION_MASK_ISA_BMI2 #define OPTION_MASK_ISA_LZCNT_UNSET OPTION_MASK_ISA_LZCNT @@ -500,6 +502,19 @@ ix86_handle_option (struct gcc_options *opts, } return true; + case OPT_msgx: + if (value) + { + opts->x_ix86_isa_flags2 |= OPTION_MASK_ISA_SGX_SET; + opts->x_ix86_isa_flags2_explicit |= OPTION_MASK_ISA_SGX_SET; + } + else + { + opts->x_ix86_isa_flags2 &= ~OPTION_MASK_ISA_SGX_UNSET; + opts->x_ix86_isa_flags2_explicit |= OPTION_MASK_ISA_SGX_UNSET; + } + return true; + case OPT_mavx512dq: if (value) { -- cgit v1.1