简体   繁体   English

gcc 4.8.1默认启用sse吗?

[英]Does gcc 4.8.1 enable sse by default?

I experienced crashes running an old code of mine on a system which doesn't support SSE4.1, I debugged a bit and found SSE instructions in the glibc, is that possible? 我遇到了在不支持SSE4.1的系统上运行我的旧代码的崩溃,我调试了一下并在glibc中找到了SSE指令,这可能吗? Why isn't this reported in gcc 4.8.1 release notes? 为什么不在gcc 4.8.1发布说明中报告这个?

You can see what optimizations are used by GCC with the following command: 您可以使用以下命令查看GCC使用的优化:

$ gcc -Q --help=target

For instance, on my machine, GCC does not enable sse4.1 by default: 例如,在我的机器上,GCC默认不启用sse4.1:

$ gcc -Q --help=target | grep msse4.1
  -msse4.1                              [disabled]

However, it is supported because it appears in /proc/cpuinfo . 但是,它受支持,因为它出现在/proc/cpuinfo And indeed, if I ask GCC to optimize the generated code for my machine, it enables sse4.1: 事实上,如果我要求GCC优化我的机器生成的代码,它将启用sse4.1:

$ gcc -Q --help=target -march=native | grep msse4.1
  -msse4.1                              [enabled]

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

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