+#endif
+ }
+
+ static FOLLY_ALWAYS_INLINE uint64_t bzhi(uint64_t value, uint32_t index) {
+#if defined(__GNUC__) || defined(__clang__)
+ // GCC and Clang won't inline the intrinsics.
+ const uint64_t index64 = index;
+ uint64_t result;
+ asm("bzhiq %2, %1, %0" : "=r"(result) : "r"(value), "r"(index64));
+ return result;
+#else
+ return _bzhi_u64(value, index);