gcc 4.8.1是否默认启用sse? [英] Does gcc 4.8.1 enable sse by default?
问题描述
在不支持SSE4.1的系统上运行我的旧代码时,我遇到了崩溃,我调试了一下,在glibc中找到了SSE指令,这可能吗?为什么在gcc 4.8.1发行说明中没有对此进行报告?
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? Why isn't this reported in gcc 4.8.1 release notes?
推荐答案
您可以通过以下命令查看GCC使用了哪些优化:
You can see what optimizations are used by GCC with the following command:
$ gcc -Q --help=target
例如,在我的计算机上,默认情况下,GCC不会启用sse4.1:
For instance, on my machine, GCC does not enable sse4.1 by default:
$ gcc -Q --help=target | grep msse4.1
-msse4.1 [disabled]
但是,它受支持,因为它出现在/proc/cpuinfo
中.确实,如果我要求GCC为我的机器优化生成的代码,它将启用sse4.1:
However, it is supported because it appears in /proc/cpuinfo
. And indeed, if I ask GCC to optimize the generated code for my machine, it enables sse4.1:
$ gcc -Q --help=target -march=native | grep msse4.1
-msse4.1 [enabled]
这篇关于gcc 4.8.1是否默认启用sse?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!