GCC options for Intel Atom processors

Ian Lance Taylor iant@google.com
Wed Apr 8 13:15:00 GMT 2009

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.



More information about the Gcc-help mailing list