Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does gcc 4.8.1 enable sse by default?

Tags:

c++

c

gcc

gcc4.8

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?

like image 551
Marco A. Avatar asked Nov 22 '13 16:11

Marco A.


1 Answers

You can see what optimizations are used by GCC with the following command:

$ gcc -Q --help=target

For instance, on my machine, GCC does not enable sse4.1 by default:

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

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]
like image 126
Christophe Vu-Brugier Avatar answered Oct 13 '22 16:10

Christophe Vu-Brugier