There are three intrinsics returning a hardware-generated random value. These intrinsics are declared in the immintrin.h header file.
All these intrinsics are mapped to a loop around RDRAND instruction:
loop:
RDRAND AX //return 16-bit random value
//RDRAND EAX //return 32-bit random value
//RDRAND RAX //return 64-bit random value
jnc loop
Copyright © 1996-2010, Intel Corporation. All rights reserved.