28 #ifndef V8_MISC_INTRINSICS_H_
29 #define V8_MISC_INTRINSICS_H_
31 #include "../include/v8.h"
45 return 31 - __builtin_clz(value);
48 #elif defined(_MSC_VER)
50 #pragma intrinsic(_BitScanReverse)
54 _BitScanReverse(&result, value);
65 shift = (value > 0xFFFF) << 4;
69 shift = (value > 0xFF) << 3;
73 shift = (value > 0xF) << 2;
77 shift = (value > 0x3) << 1;
81 result |= (value >> 1);
89 #endif // V8_MISC_INTRINSICS_H_
int IntegerLog2(uint32_t value)