PATCH: Update default arch for x86
H.J. Lu
hjl.tools@gmail.com
Sun Feb 28 08:52:00 GMT 2010
On Sat, Feb 27, 2010 at 11:19 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Sat, Feb 27, 2010 at 10:34 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> On Sat, Feb 27, 2010 at 6:22 PM, Jack Howarth <howarth@bromo.med.uc.edu> wrote:
>>> On Sat, Feb 27, 2010 at 01:36:07PM -0800, H.J. Lu wrote:
>>>>
>>>> This should work.
>>>>
>>>> --
>>>> H.J.
>>>
>>>> 2010-02-27 H.J. Lu <hongjiu.lu@intel.com>
>>>>
>>>> * config.gcc: Set the default 32bit/64bit archs with $with_arch
>>>> instead of $arch for i[34567]86-*-*|x86_64-*-* targets.
>>>>
>>>> diff --git a/gcc/config.gcc b/gcc/config.gcc
>>>> index 0d46878..28e69ba 100644
>>>> --- a/gcc/config.gcc
>>>> +++ b/gcc/config.gcc
>>>> @@ -2886,7 +2886,7 @@ if test x$with_arch = x ; then
>>>> i[34567]86-*-*|x86_64-*-*)
>>>> if test x$with_arch_32 != x || test x$with_arch_64 != x; then
>>>> if test x$with_arch_32 = x; then
>>>> - with_arch_32=$arch
>>>> + with_arch_32=$with_arch
>>>> fi
>>>> if test x$with_arch_64 = x; then
>>>> if test $arch_without_64bit = yes; then
>>>> @@ -2894,14 +2894,14 @@ if test x$with_arch = x ; then
>>>> # doesn't support 64bit.
>>>> with_arch_64=x86-64
>>>> else
>>>> - with_arch_64=$arch
>>>> + with_arch_64=$with_arch
>>>> fi
>>>> fi
>>>> with_arch=
>>>> elif test $arch_without_64bit$need_64bit_isa = yesyes; then
>>>> # Set the default 64bit arch to x86-64 if the default arch
>>>> # doesn't support 64bit and we need 64bit ISA.
>>>> - with_arch_32=$arch
>>>> + with_arch_32=$with_arch
>>>> with_arch_64=x86-64
>>>> with_arch=
>>>> fi
>>>
>>>
>>> HJ,
>>> I noticed that with this proposed patch and current gcc trunk, the default optimizations
>>> seem to be lower now for x86_64-apple-darwin10 than for i686-apple-darwin10...
>>>
>>
>> I can make them the same by defaulting i686-apple-darwin to pentium4.
>>
>
> This is the patch I checked in to restore Darwin bootstrap.
>
It turns out that Darwin sets the default arch via
TARGET_SUBTARGET32_ISA_DEFAULT and
TARGET_SUBTARGET64_ISA_DEFAULT in config/i386/darwin.h.
We shouldn't set it for Darwin. I checked in this patch to
revert Darwin changes and avoid setting the default arch
for Darwin.
--
H.J.
-------------- next part --------------
2010-02-27 H.J. Lu <hongjiu.lu@intel.com>
PR bootstrap/43202
* config.gcc: Don't enable SSE math for i[34567]86-*-darwin*
by default. Don't set the default arch for
i[34567]86-*-darwin*|x86_64-*-darwin*.
diff --git a/gcc/config.gcc b/gcc/config.gcc
index c0239c0..8d0475f 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -1086,9 +1086,6 @@ i[34567]86-*-darwin*)
need_64bit_hwint=yes
need_64bit_isa=yes
- # SSE math is enabled for Darwin by default.
- with_fpmath=${with_fpmath:-sse}
-
# This is so that '.../configure && make' doesn't fail due to
# config.guess deciding that the configuration is i386-*-darwin* and
# then this file using that to set --with-cpu=i386 which has no -m64
@@ -2860,6 +2857,10 @@ esac
# This block sets nothing except for with_arch.
if test x$with_arch = x ; then
case ${target} in
+ i[34567]86-*-darwin*|x86_64-*-darwin*)
+ # Default arch is set via TARGET_SUBTARGET32_ISA_DEFAULT
+ # and TARGET_SUBTARGET64_ISA_DEFAULT in config/i386/darwin.h.
+ ;;
i[34567]86-*-*)
# --with-fpmath sets the default ISA to SSE2, which is the same
# ISA supported by Pentium 4.
@@ -2876,6 +2877,10 @@ if test x$with_arch = x ; then
# Avoid overriding --with-arch-32 and --with-arch-64 values.
case ${target} in
+ i[34567]86-*-darwin*|x86_64-*-darwin*)
+ # Default arch is set via TARGET_SUBTARGET32_ISA_DEFAULT
+ # and TARGET_SUBTARGET64_ISA_DEFAULT in config/i386/darwin.h.
+ ;;
i[34567]86-*-*|x86_64-*-*)
if test x$with_arch_32 != x || test x$with_arch_64 != x; then
if test x$with_arch_32 = x; then
More information about the Gcc-patches
mailing list