Gitiles
Code Review
Sign In
gerrit-public.fairphone.software
/
platform
/
external
/
cpuinfo
/
c068a8100a369dd773627a0898bc405c0891fef0
/
.
/
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
);
}
}