PATCH: Update default arch for x86
Jack Howarth
howarth@bromo.med.uc.edu
Sun Feb 28 05:01:00 GMT 2010
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...
# GNU C++ (GCC) version 4.5.0 20100227 (experimental) (i686-apple-darwin10)
# compiled by GNU C version 4.5.0 20100227 (experimental), GMP version 5.0.0, MPFR version 2.4.1, MPC version 0.8
# GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
# options passed: -D__DYNAMIC__ t.cc -fPIC -mmacosx-version-min=10.6.3
# -mtune=generic -march=prescott -fverbose-asm
# options enabled: -fPIC -falign-loops -fargument-alias -fauto-inc-dec
# -fbranch-count-reg -fcommon -fdelete-null-pointer-checks -fearly-inlining
# -feliminate-unused-debug-types -fexceptions -ffunction-cse -fgcse-lm
# -fident -finline-functions-called-once -fira-share-save-slots
# -fira-share-spill-slots -fivopts -fkeep-static-consts
# -fleading-underscore -fmerge-debug-strings -fmove-loop-invariants
# -fpeephole -freg-struct-return -fsched-critical-path-heuristic
# -fsched-dep-count-heuristic -fsched-group-heuristic -fsched-interblock
# -fsched-last-insn-heuristic -fsched-rank-heuristic -fsched-spec
# -fsched-spec-insn-heuristic -fsched-stalled-insns-dep -fshow-column
# -fsigned-zeros -fsplit-ivs-in-unroller -ftrapping-math -ftree-cselim
# -ftree-forwprop -ftree-loop-im -ftree-loop-ivcanon -ftree-loop-optimize
# -ftree-parallelize-loops= -ftree-phiprop -ftree-pta -ftree-reassoc
# -ftree-scev-cprop -ftree-slp-vectorize -ftree-vect-loop-version
# -funit-at-a-time -fvect-cost-model -fverbose-asm
# -fzero-initialized-in-bss -gstrict-dwarf -m128bit-long-double -m32
# -m80387 -maccumulate-outgoing-args -malign-stringops -mfancy-math-387
# -mfp-ret-in-387 -mfused-madd -mieee-fp -mmmx -mno-red-zone -mno-sse4
# -mpush-args -msahf -msse -msse2 -msse3
# GNU C++ (GCC) version 4.5.0 20100227 (experimental) (x86_64-apple-darwin10.3.0)
# compiled by GNU C version 4.5.0 20100227 (experimental), GMP version 4.3.1, MPFR version 2.4.1, MPC version 0.8
# GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
# options passed: -D__DYNAMIC__ t.cc -fPIC -mmacosx-version-min=10.6.3
# -mtune=generic -march=x86-64 -fverbose-asm
# options enabled: -fPIC -falign-loops -fargument-alias
# -fasynchronous-unwind-tables -fauto-inc-dec -fbranch-count-reg -fcommon
# -fdelete-null-pointer-checks -fearly-inlining
# -feliminate-unused-debug-types -fexceptions -ffunction-cse -fgcse-lm
# -fident -finline-functions-called-once -fira-share-save-slots
# -fira-share-spill-slots -fivopts -fkeep-static-consts
# -fleading-underscore -fmerge-debug-strings -fmove-loop-invariants
# -fpeephole -freg-struct-return -fsched-critical-path-heuristic
# -fsched-dep-count-heuristic -fsched-group-heuristic -fsched-interblock
# -fsched-last-insn-heuristic -fsched-rank-heuristic -fsched-spec
# -fsched-spec-insn-heuristic -fsched-stalled-insns-dep -fshow-column
# -fsigned-zeros -fsplit-ivs-in-unroller -ftrapping-math -ftree-cselim
# -ftree-forwprop -ftree-loop-im -ftree-loop-ivcanon -ftree-loop-optimize
# -ftree-parallelize-loops= -ftree-phiprop -ftree-pta -ftree-reassoc
# -ftree-scev-cprop -ftree-slp-vectorize -ftree-vect-loop-version
# -funit-at-a-time -funwind-tables -fvect-cost-model -fverbose-asm
# -fzero-initialized-in-bss -gstrict-dwarf -m128bit-long-double -m64
# -m80387 -maccumulate-outgoing-args -malign-stringops -mfancy-math-387
# -mfp-ret-in-387 -mfused-madd -mieee-fp -mmmx -mno-sse4 -mpush-args
# -mred-zone -msse -msse2
What exactly is supposed to be the relationship between the new
x86 arch selections and those for x86_64? In particular, the x86_64
arch selection appears to be rather coarse and doesn't pick up on those
processors which could be supporting -msse3, etc on targets like
darwin. Is there any change we could make for darwin so that x86_64
effectively has the same feature set on darwin as using --arch=prescott
achieves for x*86 builds?
Jack
More information about the Gcc-patches
mailing list