RDRAND and RDSEED intrinsics GCC and Intel C++

后端 未结 2 1181
甜味超标
甜味超标 2020-12-18 11:40

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(         


        
2条回答
  •  南方客
    南方客 (楼主)
    2020-12-18 12:23

    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:

    __INTEL_COMPILER //Major Version
    __INTEL_COMPILER_UPDATE // Minor Update.
    

    For instance if you use ICC15.0 Update 3 compiler, it will show that you have

    __INTEL_COMPILER  = 1500
    __INTEL_COMPILER_UPDATE = 3
    

    For further details on pre-defined macros you can go to: https://software.intel.com/en-us/node/524490

提交回复
热议问题