Intel® ISA Extensions
Use hardware-based isolation and memory encryption to provide more code protection in your solutions.
1093 Discussions

Problem in compiling SSSE3 in Ubuntu12.04LTS

Hari_K_2
Beginner
787 Views

Hi

            I have a code  in which i used the SSSE3 inrtuctions, i wanted to compile in Ubuntu12.04 , the same code is compiling in Windows.My system  is Intel Xeon which supports SSSE3.(Got the info from the following command "more /proc/cpuinfo" .

While compiling in Ubuntu i added compiler option  "-mssse3 ", but still it is giving Error ."_mm_shuffle_epi8 was not declared in scope" , other instructions of SSSE3 are also not recognized.

Please let me know what might be the reason.Please reply.

Thanks in Advance.

Regards,

Harikrishna.K

0 Kudos
9 Replies
TimP
Honored Contributor III
787 Views

Compilers have varying tactics for including the intrinsics header files.  For example, in an installation of gcc, you would require

#include <immintrin.h>

where you should see the inclusion of tmmintrin.h for the case where you have set -mssse3. 

Likewise, in an icc installation, you should find immintrin.h chaining down into tmmintrin.h, but by a more obscure sequence, which you may need to verify by saving pre-processed source code (icc -E....).

0 Kudos
SergeyKostrov
Valued Contributor II
787 Views
Please include tmmintrin.h - Intel(R) HPI intrinsics. HPI is my abbreviation and it means Horizonally Packed Intrinsics
0 Kudos
TimP
Honored Contributor III
787 Views

Neither icc nor gcc normally want tmmintrin.h included directly, as immintrin.h provides for including tmmintrin.h when SSSE3 or hgiht option is set, as well as the intrinsics headers for earlier instruction sets.

0 Kudos
SergeyKostrov
Valued Contributor II
787 Views
I just did additional verification and here are results: The only header that includes tmmintrin.h is smmintrin.h. ... /* * smmintrin.h * * Principal header file for Intel(R) Core(TM) 2 Duo processor * SSE4.1 intrinsics */ #ifndef _INCLUDED_SMM #define _INCLUDED_SMM #include "tmmintrin.h" /* * Rounding mode macros */ #define _MM_FROUND_TO_NEAREST_INT 0x00 #define _MM_FROUND_TO_NEG_INF 0x01 #define _MM_FROUND_TO_POS_INF 0x02 ... Then, smmintrin.h is included in nmmintrin.h.
0 Kudos
Hari_K_2
Beginner
787 Views

Hi Tim,Sergey,

                    Thanks for the reply.

1) I have included "immintrin.h" which includes "tmmintrin.h" ,if SSSE3 is enabled in System.But if add "tmmintrin.h" again it gives an error  "SSSE3 instruction Set is not enabled".

2) if i give this command  in terminal  " gcc -Q -march=native --help=target " it shows that -mssse3 is disabled how to enabled it .

3) I tried the same code in another System (HP Z400 Workstation) where -mssse3 is enabled , i got the error when i am using _mm_load_si128 insruction as  "Segmentation Fault" ,though the argunment i am passing is filled Buffer(Frame Buffer of 1920x1080)

Please reply , Thanks in advance.

Regards,

Harikrishna

0 Kudos
SergeyKostrov
Valued Contributor II
787 Views
Please verify in docs that a version of GCC compiler you use really supports SSSE3 instructions set. Note: I will verify if a GCC-like MinGW C++ compiler v3.4.2 ( very old! ) supports SSSE3 instructions set.
0 Kudos
SergeyKostrov
Valued Contributor II
787 Views
>>Please verify in docs that a version of GCC compiler you use really supports SSSE3 instructions set. >> >>Note: I will verify if a GCC-like MinGW C++ compiler v3.4.2 ( very old! ) supports SSSE3 instructions set. There is no a switch for SSSE3 as you can see: ... -mno-sse3 Do not support MMX, SSE, SSE2 and SSE3 built-in functions and code generation -msse3 Support MMX, SSE, SSE2 and SSE3 built-in functions and code generation -mno-sse2 Do not support MMX, SSE and SSE2 built-in functions and code generation -msse2 Support MMX, SSE and SSE2 built-in functions and code generation -mno-sse Do not support MMX and SSE built-in functions and code generation -msse Support MMX and SSE built-in functions and code generation -mno-3dnow Do not support 3DNow! built-in functions -m3dnow Support 3DNow! built-in functions -mno-mmx Do not support MMX built-in functions -mmmx Support MMX built-in functions ... I'll do a real test tomorrow ( I'd like to see a possible compilation error ) and let you know results.
0 Kudos
SergeyKostrov
Valued Contributor II
787 Views
When a GCC-like compiler doesn't support SSSE3 the following error message is displayed: ...error: invalid option `ssse3'...
0 Kudos
SergeyKostrov
Valued Contributor II
787 Views
>>...i got the error when i am using _mm_load_si128 insruction as "Segmentation Fault" ,though the argunment i am passing is >>filled Buffer(Frame Buffer of 1920x1080)... Address to the buffer must be 16-byte aligned. In case of unaligned address to the buffer use _mm_loadu_si128. At the moment it is Not clear how you declared the Buffer.
0 Kudos
Reply