@@ -1,8 +1,8 @@
/* Verify that hardware multiply is preferred on XScale. */
/* { dg-do compile } */
/* { dg-options "-O2" } */
-/* { dg-require-effective-target arm_arch_xscale_arm_ok } */
-/* { dg-add-options arm_arch_xscale_arm } */
+/* { dg-require-effective-target arm_cpu_xscale_arm_ok } */
+/* { dg-add-options arm_cpu_xscale_arm } */
/* Brett Gaines' test case. */
@@ -1,8 +1,8 @@
/* Verify that mov is preferred on XScale for loading a 2 byte constant. */
/* { dg-do compile } */
-/* { dg-require-effective-target arm_arch_xscale_arm_ok } */
+/* { dg-require-effective-target arm_cpu_xscale_arm_ok } */
/* { dg-options "-O" } */
-/* { dg-add-options arm_arch_xscale_arm } */
+/* { dg-add-options arm_cpu_xscale_arm } */
unsigned load2(void) __attribute__ ((naked));
unsigned load2(void)
@@ -5679,6 +5679,9 @@ proc check_effective_target_arm_fp16_hw { } {
# Usage: /* { dg-require-effective-target arm_arch_v5_ok } */
# /* { dg-add-options arm_arch_v5t } */
# /* { dg-require-effective-target arm_arch_v5t_multilib } */
+
+# This table should only be used to set -march= (and associated
+# flags). See below for setting -mcpu
foreach { armfunc armflag armdefs } {
v4 "-march=armv4 -marm" __ARM_ARCH_4__
v4t "-march=armv4t -mfloat-abi=softfp" __ARM_ARCH_4T__
@@ -5690,7 +5693,6 @@ foreach { armfunc armflag armdefs } {
v5te "-march=armv5te+fp -mfloat-abi=softfp" __ARM_ARCH_5TE__
v5te_arm "-march=armv5te+fp -marm" "__ARM_ARCH_5TE__ && !__thumb__"
v5te_thumb "-march=armv5te+fp -mthumb -mfloat-abi=softfp" "__ARM_ARCH_5TE__ && __thumb__"
- xscale_arm "-mcpu=xscale -mfloat-abi=soft -marm" "__XSCALE__ && !__thumb__"
v6 "-march=armv6+fp -mfloat-abi=softfp" __ARM_ARCH_6__
v6_arm "-march=armv6+fp -marm" "__ARM_ARCH_6__ && !__thumb__"
v6_thumb "-march=armv6+fp -mthumb -mfloat-abi=softfp" "__ARM_ARCH_6__ && __thumb__"
@@ -5735,11 +5737,11 @@ foreach { armfunc armflag armdefs } {
{
return 0;
}
- } "FLAG" ]
+ } "-mcpu=unset FLAG" ]
}
proc add_options_for_arm_arch_FUNC { flags } {
- return "$flags FLAG"
+ return "$flags -mcpu=unset FLAG"
}
proc check_effective_target_arm_arch_FUNC_link { } {
@@ -5762,6 +5764,57 @@ foreach { armfunc armflag armdefs } {
}]
}
+# Creates a series of routines that return 1 if the given CPU
+# can be selected and a routine to give the flags to select that CPU
+# Note: Extra flags may be added to disable options from newer compilers
+# (Thumb in particular - but others may be added in the future).
+# Usage: /* { dg-require-effective-target arm_cpu_xscale_ok } */
+# /* { dg-add-options arm_cpu_xscale } */
+# /* { dg-require-effective-target arm_xscale_multilib } */
+
+# This table should only be used to set -mcpu= (and associated
+# flags). See above for setting -march=.
+foreach { armfunc armflag armdefs } {
+ xscale_arm "-mcpu=xscale -mfloat-abi=soft -marm" "__XSCALE__ && !__thumb__"
+ } {
+ eval [string map [list FUNC $armfunc FLAG $armflag DEFS $armdefs ] {
+ proc check_effective_target_arm_cpu_FUNC_ok { } {
+ return [check_no_compiler_messages arm_cpu_FUNC_ok assembly {
+ #if !(DEFS)
+ #error !(DEFS)
+ #endif
+ int
+ main (void)
+ {
+ return 0;
+ }
+ } "-march=unset FLAG" ]
+ }
+
+ proc add_options_for_arm_cpu_FUNC { flags } {
+ return "$flags -march=unset FLAG"
+ }
+
+ proc check_effective_target_arm_cpu_FUNC_link { } {
+ return [check_no_compiler_messages arm_cpu_FUNC_link executable {
+ #include <stdint.h>
+ int dummy;
+ int main (void) { return 0; }
+ } [add_options_for_arm_cpu_FUNC ""]]
+ }
+
+ proc check_effective_target_arm_cpu_FUNC_multilib { } {
+ return [check_runtime arm_cpu_FUNC_multilib {
+ int
+ main (void)
+ {
+ return 0;
+ }
+ } [add_options_for_arm_cpu_FUNC ""]]
+ }
+ }]
+}
+
# Return 1 if GCC was configured with --with-mode=
proc check_effective_target_default_mode { } {