SSE intrinsic functions reference [closed]

2020-01-27 10:03发布

问题:


Want to improve this question? Update the question so it's on-topic for Stack Overflow.

Closed 7 years ago.

Does anyone know of a reference listing the operation of the SSE intrinsic functions for gcc, i.e. the functions in the <*mmintrin.h> header files?

Thanks.

回答1:

As well as all the online PDF documentation already mentioned, there is also a very useful utility which summarizes all the instructions and intrinsics and groups them by technology. It runs on Linux, Windows and Mac OS X. It's hidden away on Intel's AVX technology page but it's equally useful for SSE programming. Go to http://software.intel.com/en-us/articles/intel-intrinsics-guide and then select the Intel Intrinsics Guide for your platform of choice.

UPDATE

There is now an online version of the intrinsics guide, so you no longer need to install anything, and it's always up-to-date.



回答2:

I found these headers were needed for invoking the different versions of SSE from GCC:

  • For SSE2:
extern "C"
{
#include <emmintrin.h>
#include <mmintrin.h>
}
  • For SSE3:
extern "C" 
{
#include <pmmintrin.h>
#include <immintrin.h>   // (Meta-header)
}
  • For SSE4:
extern "C" 
{
#include <smmintrin.h>
}

In modern versions of the compilers, all the headers seem to be common to Visual Studio and GCC.



回答3:

SSEPlus table on intrinsics is very easy to use for most cases.



回答4:

The GCC intrinsics are implementations of the Intel compiler intrinsics. They are documented in Intel® 64 and IA-32 Architectures Developer's Manual: Vol. 2C - Appendix C.



回答5:

These originally come from Intel. Intel C++ compiler describes those in its manual. AMD probably has its own manual containing those for 3Dnow! You will have to compare the availability of those with the *mmintrin.h shipped with your version of GCC.