Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot use SSSE3 on enabled cpu

I have a Xeon W3550 processor that is supposed to have support for the SSE4.2 instruction set but when I try and use anything past SSE2 in my c program I get a compiler error e.g.

#error "SSE4.2 instruction set not enabled"

When I use

$cat /procs/cpuinfo

it detects all relevant sse instruction sets but

$cpuid

only detects SSE and SSE2.

My operating system is ubuntu 11.04 with kernel 2.6.38-11-generic.

Any ideas on how to fix this? Thanks.

EDIT: An update based on Steve-o's comment below. The header files <*mmintrin.h> perform a check for the sse version that they are associated with by using #ifndef preprocessor directive e.g.

#ifndef __SSSE3__ 
#error "SSSE3 instruction set not enabled".

So I guess the question is then why is this coming back false despite the cpu being SSSE3 enabled.

like image 600
NGaffney Avatar asked Aug 24 '11 05:08

NGaffney


1 Answers

Did you try building with -msse4.2?

  • Support for SSE4.2 built-in functions and code generation are available via -msse4.2.
  • Both SSE4.1 and SSE4.2 support can be enabled via -msse4.

http://gcc.gnu.org/gcc-4.3/changes.html

like image 121
Steve-o Avatar answered Nov 05 '22 00:11

Steve-o