CAEN Utility  2.0.2
Utilities for CAEN projects
Bit manipulation functions

Platform independent bit manipulation functions. More...

Functions

uint32_t c_ctz (uint32_t value)
 
uint32_t c_clz (uint32_t value)
 
uint32_t c_popcount (uint32_t value)
 
uint32_t c_ctz64 (uint64_t value)
 
uint32_t c_clz64 (uint64_t value)
 
uint32_t c_popcount64 (uint64_t value)
 

Detailed Description

Platform independent bit manipulation functions.

Function Documentation

◆ c_ctz()

uint32_t c_ctz ( uint32_t  value)

Count trailing zeros.

Parameters
[in]valuea 32 bit unsigned integer
Returns
the number of trailing zeros. If value is 0, returns 32.

Definition at line 1411 of file CAENMultiplatform.c.

Here is the caller graph for this function:

◆ c_clz()

uint32_t c_clz ( uint32_t  value)

Count leading zeros.

Parameters
[in]valuea 32 bit unsigned integer
Returns
the number of leading zeros. If value is 0, returns 32.

Definition at line 1423 of file CAENMultiplatform.c.

Here is the caller graph for this function:

◆ c_popcount()

uint32_t c_popcount ( uint32_t  value)

Count bits set.

Parameters
[in]valuea 32 bit unsigned integer
Returns
the number of bits set.

Definition at line 1434 of file CAENMultiplatform.c.

Here is the caller graph for this function:

◆ c_ctz64()

uint32_t c_ctz64 ( uint64_t  value)

Count trailing zeros.

Parameters
[in]valuea 64 bit unsigned integer
Returns
the number of trailing zeros. If value is 0, returns 64.

Definition at line 1448 of file CAENMultiplatform.c.

Here is the caller graph for this function:

◆ c_clz64()

uint32_t c_clz64 ( uint64_t  value)

Count leading zeros.

Parameters
[in]valuea 64 bit unsigned integer
Returns
the number of leading zeros. If value is 0, returns 64.

Definition at line 1459 of file CAENMultiplatform.c.

Here is the caller graph for this function:

◆ c_popcount64()

uint32_t c_popcount64 ( uint64_t  value)

Count bits set.

Parameters
[in]valuea 64 bit unsigned integer
Returns
the number of bits set.

Definition at line 1470 of file CAENMultiplatform.c.

Here is the caller graph for this function: