I've a script that auto selects the appropriate flags for your CPU and compiler combination.
I've just updated it to support Intel Atom:
http://www.pixelbeat.org/scripts/gcccpuopt
Update:
I previously specified -march=prescott for Atom, but looking more into it
shows that Atom is merom ISA compliant, therefore -march=core2 is more appropriate.
Note however that Atoms are in-order cores, the last of those being the original pentium.
Therefore it's probably better to -mtune=pentium as well. Unfortunately I don't have
an Atom to test. I would really appreciate if anyone could benchmark the diff between:
-march=core2 -mfpmath=sse -O3
-march=core2 -mtune=pentium -mfpmath=sse -O3
Update:
Here are a couple of nice articles on low level optimization for Atom:
- http://virtualdub.org/blog/pivot/entry.php?id=286
- http://virtualdub.org/blog/pivot/entry.php?id=287