0

I am trying to port some code that used to run on window to opensuse 12.1. But I am having problem with compiling a section of the code that use SSE instruction.

The opensuse is running on an intel Core i7 with these flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 popcnt aes lahf_lm ida arat dts tpr_shadow vnmi flexpriority ept vpid.

Most of the SSE instruction are fine, but the compiler can't seem to know: _mm_dp_ps. It is also complaining about __builtin_ia32_pshufd and _mm_cvtepu8_epi32.

Can anyone please help me? What am I missing?

Paul R
  • 208,748
  • 37
  • 389
  • 560
ALI
  • 125
  • 1
  • 10
  • 3
    Have you included the appropriate headers? Also, you may need to specify a compiler flag to enable SSE4 support. – Jason R Jun 20 '13 at 20:55

1 Answers1

1

_mm_dp_ps and _mm_cvtepu8_epi32 are both SSE4.1 - so you need:

#include <smmintrin.h> // SSE 4.1 intrinsics

and you also need to compile with:

$ gcc -msse4.1 ...
Paul R
  • 208,748
  • 37
  • 389
  • 560
  • Paul, thanks for a quick reply. I do have both the include and the compile flags, but the compiler still unable to find it. – ALI Jun 20 '13 at 21:18
  • Are you getting any other warnings or errors prior to the errors for the intrinsics ? E.g. for missing #include files ? – Paul R Jun 20 '13 at 21:24
  • There are warnings, but none that are in the function that calls these functions. – ALI Jun 20 '13 at 21:30
  • All of the warnings are about unused variables. – ALI Jun 20 '13 at 21:34
  • OK - well all I can suggest is to try compiling directly from the command line to see where the problem is coming from. – Paul R Jun 20 '13 at 21:40