Tested on x86_64, i686-darwin, pushed to trunk, thanks
Iain
--- 8< ---
64b Darwin had a minimum processor of "core2" we have been defaulting
to tuning for this for many years. However, that does not produce
default code that takes advantage of the processor features (especially
16byte compare & swap). To fix this, make core2 the default 64b arch.
The 32b default is handled specially, since there is no GCC core
definition that matches.
gcc/ChangeLog:
* config.gcc: Default the 64b arch to core2.
Signed-off-by: Iain Sandoe <[email protected]>
---
gcc/config.gcc | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 6968d666b89..0913dd8d98b 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -1966,8 +1966,13 @@ i[34567]86-*-darwin1[89]* | i[34567]86-*-darwin2*)
;;
i[34567]86-*-darwin*)
need_64bit_isa=yes
- # Baseline choice for a machine that allows m64 support.
+ # Baseline choice for a machine that allows m64 support. This is the
+ # minimum arch that supported Darwin.
with_cpu=${with_cpu:-core2}
+ # Ensure that we actually set the capabilities (not just the tune)
+ # Note that 32b is handled specially in darwin.h because there is no
+ # GCC arch that matches.
+ with_arch_64=${with_arch_64:-core2}
tmake_file="${tmake_file} ${cpu_type}/t-darwin32-biarch t-slibgcc"
tm_file="${cpu_type}/darwin32-biarch.h ${tm_file} "
;;
@@ -1976,10 +1981,13 @@ x86_64-*-darwin1[89]* | x86_64-*-darwin2*)
tm_defines="${tm_defines}
TARGET_64BIT_DEFAULT=(OPTION_MASK_ISA_64BIT|OPTION_MASK_ABI_64)"
tm_defines="${tm_defines} TARGET_BI_ARCH=0"
with_cpu=${with_cpu:-core2}
+ # TODO: bump this for OS versions that require haswell.
+ with_arch=${with_arch:-core2}
tmake_file="${tmake_file} t-slibgcc"
;;
x86_64-*-darwin*)
with_cpu=${with_cpu:-core2}
+ with_arch_64=${with_arch_64:-core2}
tmake_file="${tmake_file} ${cpu_type}/t-darwin64-biarch t-slibgcc"
tm_file="${cpu_type}/darwin64-biarch.h ${tm_file} "
;;
--
2.50.1 (Apple Git-155)