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

C++CGccSseSimd

C++ Problem Overview


Is there an official reference listing the operation of the SSE intrinsic functions for GCC, i.e. the functions in the <*mmintrin.h> header files?

C++ Solutions


Solution 1 - C++

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:sse] tag for links to guides and a couple tutorials, as well as this official documentation.

Solution 2 - C++

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 - C++

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

Solution 4 - C++

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 - C++

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionNGaffneyView Question on Stackoverflow
Solution 1 - C++Paul RView Answer on Stackoverflow
Solution 2 - C++Jose Luis BlancoView Answer on Stackoverflow
Solution 3 - C++aleccoView Answer on Stackoverflow
Solution 4 - C++cafView Answer on Stackoverflow
Solution 5 - C++wilxView Answer on Stackoverflow