This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: Update default arch for x86


On Sun, Feb 28, 2010 at 07:34:40AM -0800, H.J. Lu wrote:
> On Sun, Feb 28, 2010 at 7:12 AM, Jack Howarth <howarth@bromo.med.uc.edu> wrote:
> > On Sat, Feb 27, 2010 at 10:34:15PM -0800, H.J. Lu wrote:
> >>
> >> I can make them the same by defaulting i686-apple-darwin to pentium4.
> >>
> >> --
> >> H.J.
> >
> > HJ,
> > ? I was hoping to make x86_64-apple-darwin10 higher instead so that it
> > supports -msse3 by default as was i686-apple-darwin10 in your previous
> > patch. Note that in Snow Leopard, Apple's system gcc-4.2.1 compiler shows...
> 
> You can try this.
> 
> ---
> diff --git a/gcc/config/i386/darwin.h b/gcc/config/i386/darwin.h
> index eb9ee70..49863a6 100644
> --- a/gcc/config/i386/darwin.h
> +++ b/gcc/config/i386/darwin.h
> @@ -162,14 +162,12 @@ extern void darwin_x86_file_end (void);
>  #undef TARGET_SUBTARGET32_ISA_DEFAULT
>  #define TARGET_SUBTARGET32_ISA_DEFAULT (OPTION_MASK_ISA_MMX		\
>  					| OPTION_MASK_ISA_SSE		\
> -					| OPTION_MASK_ISA_SSE2)
> -
> -#undef TARGET_SUBTARGET64_ISA_DEFAULT
> -#define TARGET_SUBTARGET64_ISA_DEFAULT (OPTION_MASK_ISA_MMX		\
> -					| OPTION_MASK_ISA_SSE		\
>  					| OPTION_MASK_ISA_SSE2		\
>  					| OPTION_MASK_ISA_SSE3)
> 
> +#undef TARGET_SUBTARGET64_ISA_DEFAULT
> +#define TARGET_SUBTARGET64_ISA_DEFAULT TARGET_SUBTARGET32_ISA_DEFAULT
> +
>  /* For now, disable dynamic-no-pic.  We'll need to go through i386.c
>     with a fine-tooth comb looking for refs to flag_pic!  */
>  #define MASK_MACHO_DYNAMIC_NO_PIC 0
> ----
> 
> 
> -- 
> H.J.

HJ,
   Thanks. This change restores the use of sse3...

# GNU C++ (GCC) version 4.5.0 20100228 (experimental) (i686-apple-darwin10)
#       compiled by GNU C version 4.5.0 20100228 (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 -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 20100228 (experimental) (x86_64-apple-darwin10.3.0)
#       compiled by GNU C version 4.5.0 20100228 (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 -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 -msse3

Can you check that change into gcc trunk?
                   Jack
ps Would it be a net win for darwin if we also set...

with_cpu=${with_cpu:-core2}

for both i[34567]86-*-darwin* and x86_64-*-darwin* in gcc/config.gcc 
like Apple's gcc 4.2.1 compiler to set -mtune= to core2?



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]