16#ifndef __KOS_INTMATH_H
17#define __KOS_INTMATH_H
26 return (val & (val - 1)) == 0;
31 return 31 - __builtin_clz(val);
34static inline unsigned int log2_rup(
unsigned int val)
Various common macros used throughout the codebase.
static bool is_power_of_two(unsigned int val)
Definition intmath.h:24
static unsigned int log2_rup(unsigned int val)
Definition intmath.h:34
static unsigned int log2_rdown(unsigned int val)
Definition intmath.h:29