This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: GCC options for Intel Atom processors
- From: Ian Lance Taylor <iant at google dot com>
- To: Morgan WesstrÃm <gcc-help at pp dot dyndns dot biz>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Wed, 08 Apr 2009 06:15:21 -0700
- Subject: Re: GCC options for Intel Atom processors
- References: <49DC9CED.7030803@pp.dyndns.biz>
Morgan WesstrÃm <gcc-help@pp.dyndns.biz> writes:
> 1) I understand that Intel Atom is an in-order processor and that the
> last such processor Intel made was the original Pentium. How big is the
> performance penalty if the code is not optimized for in-order execution?
The compiler will already do its best to optimize for in-order
execution, although it doesn't yet have any specific information about
scheduling for the Atom. The penalty depends on the code. It can be a
few percent.
> 2) If the answer to question 1 is that it does give a noticeable penalty
> how does one control the output of gcc to produce in-order code? Should
> I choose -march=pentium or is there a single option that is enabled by
> the -march option that controls this behaviour? I've even searched for
> "in-order" in gcc's source code but the few occurrences that turns up
> doesn't solve this puzzle for me.
No additional option is required. The relevant one is
-fschedule-insns2, which is on by default at -O2.
> 3) When it comes to cache sizes and available registers I think I
> understand that the -mtune option controls this optimization (which is
> automatically set to the same value as -march when using that). Since
> there is no -march option for Intel Atom yet, is there anyway to control
> these optimizations manually in gcc and what should they be in that case?
No, this requires specific support for the Atom.
Unsurprisingly, Intel is working on adding support for Atom
optimizations, and that support should wind up in gcc 4.5, though that
won't be out for a while.
http://gcc.gnu.org/ml/gcc-patches/2009-01/msg00923.html
Ian