SSE2
Hi,
I develop a MPI code using SS2 instruction, under gcc 4.0. I would like now run my code under our SUN Cluster AMD64, but when I use mpCC option -xarch=sse2 and I also included (sunmedia_intrin.h) in my .cpp. I get :
"Paroi.cpp", line 25: Error: __m128d is not defined.
"Paroi.cpp", line 43: Error: The function "_mm_set1_pd" must have a prototype.
"Paroi.cpp", line 45: Error: The function "_mm_setr_pd" must have a prototype.
..........
Somebody have a solution ?
[511 byte] By [
frenchkoia] at [2007-11-26 15:39:06]

# 2
It depends on what version of the compiler you are using.
With earlier versions, using sunmedia_intrin.h, you would also need to use an optimization switch and -xbuiltin, like "-xO1 -xbuiltin -xarch=sse2". And floating point intrinsics are not supported, so __m128d is not supported.
With the latest SSX3 update, the intrinsics functions and headers are compatible to that of gcc/icc. You can now use "mmintrin.h, xmmintrin.h, emmintrin.h and pmmintrin.h", or you can simply use "sunmedia_intrin.h".No -xbuiltin or optimization switch are needed. All integer and floating point intrinsics are now supported.
# 3
the version of my compiler is Sun C++ 5.8.
About "sunmedia_intrin.h" I included in .cpp about the file ""mmintrin.h, xmmintrin.h, emmintrin.h and pmmintrin.h" if I included inside my file, the compiler did not recognize them.
On sun documention I read the compiler will recognize SSE2 assembly line but no "intel" primitive like
" _mm_set1_pd " ...
# 4
Sun C++ 5.8 does not support the "intel" intrinsics nor the mmintrin.h, xmmintrin.h ..., it only supports sunmedia_intrin.h for fp intrinsics.As explained in my previous response, you need Studio Express 3 to access mmintrin.h, xmmintrin.h, ,,,, and both fp and integer intrinsics.You can download Studio Express 3 by going to
"http://developers.sun.com/sunstudio/downloads/express.jsp"
Hope this help!
Alfred Huang
# 5
> With the latest SSX3 update, the intrinsics functions
> and headers are compatible to that of gcc/icc. You
> can now use "mmintrin.h, xmmintrin.h, emmintrin.h and
> pmmintrin.h", or you can simply use
> "sunmedia_intrin.h".No -xbuiltin or optimization
> switch are needed. All integer and floating point
> intrinsics are now supported.
SSX3 may support all intrinsics functions, but gcc and msvc provide some additional macros or inline functions which are more convenient to use. In particular, our project includes xmmintrin.h and uses only: _MM_SET_ROUNDING_MODE, _MM_GET_ROUNDING_MODE, _MM_ROUND_NEAREST, _MM_ROUND_TOWARD_ZERO, _MM_ROUND_UP and _MM_ROUND_DOWN.
It would help with porting gcc/msvc code if SS supported those as well.