diff --git a/clang/lib/Headers/immintrin.h b/clang/lib/Headers/immintrin.h index dff4da2465d27c..c5f84ae0286b73 100644 --- a/clang/lib/Headers/immintrin.h +++ b/clang/lib/Headers/immintrin.h @@ -323,18 +323,14 @@ _rdrand32_step(unsigned int *__p) /// \param __p /// A pointer to a 64-bit memory location to place the random value. /// \returns 1 if the value was successfully generated, 0 otherwise. -#ifdef __x86_64__ static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("rdrnd"))) _rdrand64_step(unsigned long long *__p) { +#ifdef __x86_64__ return (int)__builtin_ia32_rdrand64_step(__p); -} #else -// We need to emulate the functionality of 64-bit rdrand with 2 32-bit -// rdrand instructions. -static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("rdrnd"))) -_rdrand64_step(unsigned long long *__p) -{ + // We need to emulate the functionality of 64-bit rdrand with 2 32-bit + // rdrand instructions. unsigned int __lo, __hi; unsigned int __res_lo = __builtin_ia32_rdrand32_step(&__lo); unsigned int __res_hi = __builtin_ia32_rdrand32_step(&__hi); @@ -345,8 +341,8 @@ _rdrand64_step(unsigned long long *__p) *__p = 0; return 0; } -} #endif +} #endif /* __RDRND__ */ #if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \