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?
-
Intel "intrinsics manual" can be found [here](http://software.intel.com/sites/default/files/m/9/4/c/8/e/18072-347603.pdf). [This](http://stackoverflow.com/a/662250/24283) might also be of interest. – timday Oct 17 '12 at 20:36
-
1I want to discuss this on Meta https://meta.stackoverflow.com/q/416086/2945027 – Alex Guteniev Feb 17 '22 at 15:57
-
1We maintain [SSE tag wiki](https://stackoverflow.com/tags/sse/info), where official and other references are linked. – Alex Guteniev Feb 18 '22 at 11:59
5 Answers
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 sse tag for links to guides and a couple tutorials, as well as this official documentation.

- 30,738
- 21
- 105
- 131

- 208,748
- 37
- 389
- 560
-
1I 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). – Z boson Jun 15 '14 at 11:14
-
1@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. – Paul R Jun 15 '14 at 17:12
-
1FWIW I've uploaded a copy for offline use here: https://devpspctclr.s3.amazonaws.com/intrinsics/20160705-intrinsics-guide.zip - must serve from localhost, though, due to the DB being loaded via XHR... – toxi Jul 23 '16 at 21:36
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.

- 30,738
- 21
- 105
- 131

- 705
- 6
- 10
-
1With 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. – leetNightshade Jun 04 '13 at 20:06
-
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. – Peter Cordes Mar 09 '22 at 04:01
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.

- 7,320
- 6
- 50
- 63

- 233,326
- 40
- 323
- 462
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.

- 30,738
- 21
- 105
- 131

- 17,697
- 6
- 59
- 114