Does Intel C++ compiler and/or GCC support the following intrinsics, like MSVC does since 2012 / 2013?
int _rdrand16_step(uint16_t*);
int _rdrand32_step(uint32_t*);
int _rdrand64_step(uint64_t*);
int _rdseed16_step(uint16_t*);
int _rdseed32_step(uint32_t*);
int _rdseed64_step(uint64_t*);
And if these intrinsics are supported, since which version are they supported (with compile-time-constant please)?
Microsoft compiler does not have intrinsics support for RDSEED and RDRAND instruction.
But, you may implement these instruction using NASM or MASM. Assembly code is available at:
https://software.intel.com/en-us/articles/intel-digital-random-number-generator-drng-software-implementation-guide
For Intel Compiler, you can use header to determine the version. You can use following macros to determine the version and sub-version:
For instance if you use ICC15.0 Update 3 compiler, it will show that you have
For further details on pre-defined macros you can go to: https://software.intel.com/en-us/node/524490
Both GCC and Intel compiler support them. GCC support was introduced at the end of 2010. They require the header
<immintrin.h>
.GCC support has been present since at least version 4.6, but there doesn't seem to be any specific compile-time constant - you can just check
__GNUC_MAJOR__ > 4 || (__GNUC_MAJOR__ == 4 && __GNUC_MINOR__ >= 6)
.