From 5254564176b94689e94d6d57f489f740a254f920 Mon Sep 17 00:00:00 2001 From: Thomas Preud'homme Date: Tue, 31 May 2016 10:10:18 +0000 Subject: [PATCH] arm-protos.h (arm_arch_thumb1): Declare. 2016-05-31 Thomas Preud'homme gcc/ * config/arm/arm-protos.h (arm_arch_thumb1): Declare. * config/arm/arm.c (arm_arch_thumb1): Define. (arm_option_override): Initialize arm_arch_thumb1. * config/arm/arm.h (arm_arch_thumb1): Declare. (TARGET_ARM_ARCH_ISA_THUMB): Use arm_arch_thumb to determine if target support Thumb-1 ISA. gcc/testsuite/ * gcc.target/arm/armv5_thumb_isa.c: New test. From-SVN: r236913 --- gcc/ChangeLog | 9 +++++++++ gcc/config/arm/arm-protos.h | 3 +++ gcc/config/arm/arm.c | 4 ++++ gcc/config/arm/arm.h | 8 +++++--- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.target/arm/armv5_thumb_isa.c | 8 ++++++++ 6 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 gcc/testsuite/gcc.target/arm/armv5_thumb_isa.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 587afe0b1f1..b4f8c5650c2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2016-05-31 Thomas Preud'homme + + * config/arm/arm-protos.h (arm_arch_thumb1): Declare. + * config/arm/arm.c (arm_arch_thumb1): Define. + (arm_option_override): Initialize arm_arch_thumb1. + * config/arm/arm.h (arm_arch_thumb1): Declare. + (TARGET_ARM_ARCH_ISA_THUMB): Use arm_arch_thumb to determine if target + support Thumb-1 ISA. + 2016-05-31 Kirill Yukhin PR target/71346 diff --git a/gcc/config/arm/arm-protos.h b/gcc/config/arm/arm-protos.h index d8179c441bb..34fd06a92d9 100644 --- a/gcc/config/arm/arm-protos.h +++ b/gcc/config/arm/arm-protos.h @@ -603,6 +603,9 @@ extern int arm_tune_cortex_a9; interworking clean. */ extern int arm_cpp_interwork; +/* Nonzero if chip supports Thumb 1. */ +extern int arm_arch_thumb1; + /* Nonzero if chip supports Thumb 2. */ extern int arm_arch_thumb2; diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 4e453fd7101..16499ce647b 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -847,6 +847,9 @@ int arm_tune_cortex_a9 = 0; interworking clean. */ int arm_cpp_interwork = 0; +/* Nonzero if chip supports Thumb 1. */ +int arm_arch_thumb1; + /* Nonzero if chip supports Thumb 2. */ int arm_arch_thumb2; @@ -3165,6 +3168,7 @@ arm_option_override (void) arm_arch7em = ARM_FSET_HAS_CPU1 (insn_flags, FL_ARCH7EM); arm_arch8 = ARM_FSET_HAS_CPU1 (insn_flags, FL_ARCH8); arm_arch8_1 = ARM_FSET_HAS_CPU2 (insn_flags, FL2_ARCH8_1); + arm_arch_thumb1 = ARM_FSET_HAS_CPU1 (insn_flags, FL_THUMB); arm_arch_thumb2 = ARM_FSET_HAS_CPU1 (insn_flags, FL_THUMB2); arm_arch_xscale = ARM_FSET_HAS_CPU1 (insn_flags, FL_XSCALE); diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index 1e817a88e8f..065e7da4bfa 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -479,6 +479,9 @@ extern int arm_tune_cortex_a9; interworking clean. */ extern int arm_cpp_interwork; +/* Nonzero if chip supports Thumb 1. */ +extern int arm_arch_thumb1; + /* Nonzero if chip supports Thumb 2. */ extern int arm_arch_thumb2; @@ -2189,9 +2192,8 @@ extern int making_const_table; (arm_base_arch) \ /* The highest Thumb instruction set version supported by the chip. */ -#define TARGET_ARM_ARCH_ISA_THUMB \ - (arm_arch_thumb2 ? 2 \ - : ((TARGET_ARM_ARCH >= 5 || arm_arch4t) ? 1 : 0)) +#define TARGET_ARM_ARCH_ISA_THUMB \ + (arm_arch_thumb2 ? 2 : (arm_arch_thumb1 ? 1 : 0)) /* Expands to an upper-case char of the target's architectural profile. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 05eb1e8d084..563d5e5885c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2016-05-31 Thomas Preud'homme + + * gcc.target/arm/armv5_thumb_isa.c: New test. + 2016-05-31 Kirill Yukhin PR target/71346 diff --git a/gcc/testsuite/gcc.target/arm/armv5_thumb_isa.c b/gcc/testsuite/gcc.target/arm/armv5_thumb_isa.c new file mode 100644 index 00000000000..80a00aec978 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/armv5_thumb_isa.c @@ -0,0 +1,8 @@ +/* { dg-require-effective-target arm_arch_v5_ok } */ +/* { dg-add-options arm_arch_v5 } */ + +#if __ARM_ARCH_ISA_THUMB +#error "__ARM_ARCH_ISA_THUMB defined for ARMv5" +#endif + +int foo; -- 2.30.2