Where can I find an official reference listing the operation of SSE intrinsic functions?

36,765

Solution 1

As well as Intel's vol.2 PDF manual, there is also an online intrinsics guide.

The Intel® Intrinsics Guide contains reference information for Intel intrinsics, which provide access to Intel instructions such as Intel® Streaming SIMD Extensions (Intel® SSE), Intel® Advanced Vector Extensions (Intel® AVX), and Intel® Advanced Vector Extensions 2 (Intel® AVX2).

It has a full-text search, so an intrinsic can be found by its name, or by CPU instruction, CPU feature, etc. It also has a control on which ISA extension to show. This allows, for example, not searching KNC that you wouldn't likely be able to use, or MMX that is far less useful these days.

See also the tag wiki for the tag for links to guides and a couple tutorials, as well as this official documentation.

Solution 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 SSE2

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.

Solution 3

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

Solution 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.

Solution 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.

Share:
36,765
NGaffney
Author by

NGaffney

Updated on February 19, 2022

Comments

  • NGaffney
    NGaffney about 2 years

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

  • leetNightshade
    leetNightshade almost 11 years
    With VS2012 (VC++ 11.0), all of the above headers include just fine (so immintrin.h isn't just GCC only anymore ), and smmintrin.h can be included in extern "C" without issue.
  • Z boson
    Z boson almost 10 years
    I did not know about the online version. Thaanks! This is much better than installing locally to several machines and then having a Java update break some of them (which happended recently).
  • Paul R
    Paul R almost 10 years
    @Zboson: the only down-side of the local version being phased out is that I used to be able to extract the database from it, which was a useful resource. I haven't tried to see if the web version is scrapable yet.
  • toxi
    toxi almost 8 years
    FWIW I've uploaded a copy for offline use here: devpspctclr.s3.amazonaws.com/intrinsics/… - must serve from localhost, though, due to the DB being loaded via XHR...
  • Peter Cordes
    Peter Cordes about 2 years
    You don't need extern "C" around these header includes. All modern compilers support them in fully C++ mode for years. IDK if that use of extern "C" was ever needed by any compiler, but it's not anymore.