Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果在 linux 上我尝试以标准方式编译 c 代码
gcc -myprog.c
生成的二进制文件仅使用基本 CPU 功能,因为现代 CPU 具有许多特殊功能来提高性能,如 AVX、AVX2、SSE3、SSE4 等。
由于我只想针对特定的 CPU 类型(i7 Sandy Bridge),有没有办法设置编译器以利用这些功能?
查看 -march 和 -mtune gcc 标志