简体   繁体   English

究竟是什么-march = native呢?

[英]What exactly does -march=native do?

Gentoo Wiki told me the following: Gentoo Wiki告诉我以下内容:

Warning: GCC 4.2 and above support -march=native. 警告:GCC 4.2及以上版本支持-march = native。 -march=native applies additional settings beyond -march, specific to your CPU. -march = native应用超出-march的其他设置,特定于CPU。 Unless you have a specific reason not to (eg distcc cross-compiling), you should probably be using -march=native, rather than anything listed below. 除非您有特殊原因(例如,distcc交叉编译),否则您应该使用-march = native,而不是下面列出的任何内容。

What are those additional settings? 那些额外的设置是什么?

Nevermind. 没关系。

$ cc -march=core2 -E -v - </dev/null 2>&1 | grep cc1
 /[...]/cc1 -E -quiet -v -iprefix /[...]/4.3.2/ - -march=core2

$ cc -march=native -E -v - </dev/null 2>&1 | grep cc1
 /[...]/cc1 -E -quiet -v -iprefix /[...]/4.3.2/ - -march=core2 -mcx16 -msahf --param l1-cache-size=32 --param l1-cache-line-size=64 -mtune=core2

I'm starting to like this option a lot. 我开始喜欢这个选项了很多。 -mcx16 and -msahf are two additional CPU instructions gcc can now use, which weren't available in earlier Core2's. -mcx16-msahf是gcc现在可以使用的另外两个CPU指令,这些指令在早期的Core2中不可用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM