optimization based on CPU type or flags?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I noticed that I can specify -march=native and -mtune=native.

I have few questions:
- On some boxes, I noticed that if I specify -march=native and -mtune=native, g++ might "convert" -march=native into -march=corei7-avx along with a list of flags such as -mcx16 -msahf -mavx -msse4.2 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=10240 (there are a lot more flags but I have to take them out as GCC mailing server marked my mail as spam if I listed all), and -mtune=generic.  how come gcc recognize the CPU type as corei7-avx but it can't recognize the CPU type for -mtune?
- Let's say g++ figures that my CPU support sse4.1, and how does it choose between sse4.1 instructions and other set of instructions (assuming both achieve the same task)?  Does g++ have a database that it computes the numbers of CPU cycles for all the possible combinations before it decides?
- Also, how does the l1-cache-size and l2-cache-size parameters affect the optimization?  Only affecting the decision of inline?  Or there are more?
- Is there any tool that will tell me what CPU specific instructions are used (other than going through the object files manually with objdump one by one)?

Thanks in advance.


Cheers,
Hei






[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux