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. This might also be of interest.– timdayOct 17, 2012 at 20:36
-
1I want to discuss this on Meta meta.stackoverflow.com/q/416086/2945027– Alex GutenievFeb 17 at 15:57
-
1We maintain SSE tag wiki, where official and other references are linked.– Alex GutenievFeb 18 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.
-
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 bosonJun 15, 2014 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 RJun 15, 2014 at 17:12
-
1FWIW 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...– toxiJul 23, 2016 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.
-
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. Jun 4, 2013 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 ofextern "C"
was ever needed by any compiler, but it's not anymore. Mar 9 at 4: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.
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.