I am trying to figure out how to set the -march parameter -march to see how much the performance difference between the enabled and disabled option can occur on my PC using gcc 4.7.2.
Before trying to compile, I tried to find the best option -march for my PC. My computer has a Pentium G850 whose architecture is Sandy Bridge. So I mentioned the gcc 4.7.2 manual and found that -march=corei7-avx seems to be the best.
However, I recalled that the Sandy Bridge-based Pentium does not support the AVX and AES-NI instruction set support, which is true for the Pentium G850 . Therefore, -march=corei7-avx not a suitable option.
I came up with some possible options:
-march=corei7-avx -mno-avx -mno-aes-march=corei7 -mtune=corei7-avx-march=native
The first option looks reasonable, given the information I have, but I'm worried that there may be a feature other than AVX and AES-NI. The second option looks safe, but it may miss some minor features on Sandy Bridge due to -march=corei7 . The third option will take care of all my problems, but I heard that this option sometimes incorrectly evaluates the functions of the processor, so I would like to know how to do it manually.
I googled and searched for StackOverflow and SuperUser, but I cannot find clear solutions ...
What parameters should be set?
k2_8191
source share