mirror of
https://github.com/Tencent/rapidjson.git
synced 2025-03-04 19:13:40 +01:00
fix naive implementation for clzll()
This commit is contained in:
parent
58e2964856
commit
7f559ec80a
@ -53,10 +53,10 @@ inline uint32_t clzll(uint64_t x) {
|
||||
return static_cast<uint32_t>(__builtin_clzll(x));
|
||||
#else
|
||||
// naive version
|
||||
uint32_t r = 63;
|
||||
uint32_t r = 0;
|
||||
while (!(x & (static_cast<uint64_t>(1) << 63))) {
|
||||
x <<= 1;
|
||||
--r;
|
||||
++r;
|
||||
}
|
||||
|
||||
return r;
|
||||
|
Loading…
x
Reference in New Issue
Block a user