This file contains common (or not) bitwise operations.
More...
|
|
#define | BIT(_n) (1 << (_n)) |
| | Generate the nth power of 2 (nth bit set)
|
| |
|
#define | BIT_CLEAR(_var, _n) (_var &= ~BIT((_n))) |
| | Clear the nth bit.
|
| |
|
#define | BIT_SET(_var, _n) (_var |= BIT((_n))) |
| | Set the nth bit.
|
| |
|
#define | BIT_READ(_x, _n) ((_x) & BIT((_n))) |
| | Read the nth bit.
|
| |
|
|
static ALWAYS_INLINE unsigned long | bit_first_one (unsigned long word) |
| | Find the index of the first set bit inside word.
|
| |
|
static ALWAYS_INLINE unsigned long | bit_last_one (unsigned long word) |
| | Find the index of the last set bit inside word.
|
| |
|
static ALWAYS_INLINE unsigned long | bit_first_zero (unsigned long word) |
| | Find the index of the first unset bit inside word.
|
| |
|
static ALWAYS_INLINE unsigned long | bit_last_zero (unsigned long word) |
| | Find the index of the last unset bit inside word.
|
| |
| static ALWAYS_INLINE uint32_t | bit_next_pow32 (uint32_t val) |
| | Compute the nex highest power of 2 for a 32bit integer. More...
|
| |
◆ bit_next_pow32()
| static ALWAYS_INLINE uint32_t bit_next_pow32 |
( |
uint32_t |
val | ) |
|
|
static |