Gitiles
Code Review
Sign In
gerrit-public.fairphone.software
/
platform
/
external
/
cpuinfo
/
14a9d4c0188367ca4070e3f5df5f4a839bf8c1d0
/
.
/
src
/
utils.h
blob: 46ba9d93a5ebcc1a0d45ab5d38acda2cea635274 [
file
] [
log
] [
blame
]
#pragma
once
#include
<stdint.h>
inline
static
uint32_t
bit_length
(
uint32_t
n
)
{
const
uint32_t
n_minus_1
=
n
-
1
;
if
(
n_minus_1
==
0
)
{
return
0
;
}
else
{
return
32
-
__builtin_clz
(
n_minus_1
);
}
}