Software Tuning, Performance Optimization & Platform Monitoring
Discussion regarding monitoring and software tuning methodologies, Performance Monitoring Unit (PMU) of Intel microprocessors, and platform updating.

Optimal GCC compile flags for 2nd gen i7

jpburke
Beginner
1,180 Views
Hello - Can anyone suggest optimal GCC compile flags (march, tune, sse, etc) for 2nd gen i7?

I read GCC 4.6 adds support for -march=corei7, but I am using GCC 4.4 and 4.5. Also, I am cross compilng on a pentium4 host so -march=native may not be ideal.

Any suggestions would be appreciated.

Thanks
0 Kudos
2 Replies
TimP
Honored Contributor III
1,180 Views
The Pentium4 native options are probably OK, if you want a 32-bit build. If you are able to get auto-vectorization at -O3, -march=pentium4 -mtune=barcelona will favor performance on CoreI7 while still running on Pentium4. Adding -msse4should help certain applications (e.g. complex data types), but won't run on Pentium4.
The -march=corei7 option of gcc 4.6 (replacing the pentium4 and barcelona options)is intended for the original Core I7 (still OK for I7-2). With gcc 4.5 on I7-2,you can use -mavx in place of -msse4and sometimes get an advantage. I expect 4.6 would get more out of -mavx.I've never tried -mavx for 32-bit compilation.
0 Kudos
TimP
Honored Contributor III
1,180 Views
Recent gcc versions support -flto (link time optimization) which is said to work well with suitable applications.
0 Kudos
Reply