|
Veritable Lasagna
An Allocator & Data Structure Library for C.
|
Include dependency graph for vl_algo.c:Functions | |
| vl_uint_t | vlAlgoPopCount8 (vl_uint8_t value) |
| Counts the number of set bits (population count) in an 8-bit value. | |
| vl_uint_t | vlAlgoPopCount16 (vl_uint16_t value) |
| Counts the number of set bits (population count) in a 16-bit value. | |
| vl_uint_t | vlAlgoPopCount32 (vl_uint32_t value) |
| Counts the number of set bits (population count) in a 32-bit value. | |
| vl_uint_t | vlAlgoPopCount64 (vl_uint64_t value) |
| Counts the number of set bits (population count) in a 64-bit value. | |
| vl_uint_t | vlAlgoCLZ8 (vl_uint8_t value) |
| Counts the number of leading zero bits in an 8-bit value. | |
| vl_uint_t | vlAlgoCLZ16 (vl_uint16_t value) |
| Counts the number of leading zero bits in a 16-bit value. | |
| vl_uint_t | vlAlgoCLZ32 (vl_uint32_t value) |
| Counts the number of leading zero bits in a 32-bit value. | |
| vl_uint_t | vlAlgoCLZ64 (vl_uint64_t value) |
| Counts the number of leading zero bits in a 64-bit value. | |
| vl_uint_t | vlAlgoCTZ8 (vl_uint8_t value) |
| Counts the number of trailing zero bits in an 8-bit value. | |
| vl_uint_t | vlAlgoCTZ16 (vl_uint16_t value) |
| Counts the number of trailing zero bits in a 16-bit value. | |
| vl_uint_t | vlAlgoCTZ32 (vl_uint32_t value) |
| Counts the number of trailing zero bits in a 32-bit value. | |
| vl_uint_t | vlAlgoCTZ64 (vl_uint64_t value) |
| Counts the number of trailing zero bits in a 64-bit value. | |
| vl_uint_t | vlAlgoNextPO2 (vl_ularge_t value) |
| Computes the next power of 2 greater than or equal to the given value. | |
| vl_bool_t | vlAlgoIsPO2 (vl_ularge_t value) |
| Tests whether a value is a power of 2. | |
| vl_bool_t | vlAlgoAddOverflow (vl_ularge_t a, vl_ularge_t b) |
| Tests whether adding two unsigned integers would cause overflow. | |
| vl_ularge_t | vlAlgoGCD (vl_ularge_t a, vl_ularge_t b) |
| Computes the Greatest Common Divisor (GCD) of two unsigned integers. | |
| vl_ilarge_t | vlAlgoGCDSigned (vl_ilarge_t a, vl_ilarge_t b) |
| Computes the Greatest Common Divisor (GCD) of two signed integers. | |
| vl_ilarge_t | vlAlgoLCMSigned (vl_ilarge_t a, vl_ilarge_t b) |
| Computes the Least Common Multiple (LCM) of two signed integers. | |
| vl_ularge_t | vlAlgoLCM (vl_ularge_t a, vl_ularge_t b) |
| Computes the Least Common Multiple (LCM) of two unsigned integers. | |
| vl_bool_t | vlAlgoSubUnderflow (vl_ularge_t a, vl_ularge_t b) |
| Tests whether subtracting two unsigned integers would cause underflow. | |
| vl_bool_t | vlAlgoMulOverflow (vl_ularge_t a, vl_ularge_t b) |
| Tests whether multiplying two unsigned integers would cause overflow. | |
| vl_bool_t vlAlgoAddOverflow | ( | vl_ularge_t | a, |
| vl_ularge_t | b | ||
| ) |
Tests whether adding two unsigned integers would cause overflow.
Uses compiler intrinsics when available for optimal performance and accuracy. Falls back to portable overflow detection otherwise.
| a | first unsigned integer |
| b | second unsigned integer |
| vl_uint_t vlAlgoCLZ16 | ( | vl_uint16_t | value | ) |
Counts the number of leading zero bits in a 16-bit value.
Returns 16 if the input value is 0. Uses compiler intrinsics when available for optimal performance, with portable fallback implementations.
| value | 16-bit unsigned integer |
Here is the call graph for this function:| vl_uint_t vlAlgoCLZ32 | ( | vl_uint32_t | value | ) |
Counts the number of leading zero bits in a 32-bit value.
Returns 32 if the input value is 0. Uses compiler intrinsics when available for optimal performance, with portable fallback implementations.
| value | 32-bit unsigned integer |
Here is the caller graph for this function:| vl_uint_t vlAlgoCLZ64 | ( | vl_uint64_t | value | ) |
Counts the number of leading zero bits in a 64-bit value.
Returns 64 if the input value is 0. Uses compiler intrinsics when available for optimal performance, with portable fallback implementations.
| value | 64-bit unsigned integer |
Here is the call graph for this function:| vl_uint_t vlAlgoCLZ8 | ( | vl_uint8_t | value | ) |
Counts the number of leading zero bits in an 8-bit value.
Returns 8 if the input value is 0. Uses compiler intrinsics when available for optimal performance, with portable fallback implementations.
| value | 8-bit unsigned integer |
Here is the caller graph for this function:| vl_uint_t vlAlgoCTZ16 | ( | vl_uint16_t | value | ) |
Counts the number of trailing zero bits in a 16-bit value.
Returns 16 if the input value is 0. Uses compiler intrinsics when available for optimal performance, with portable fallback implementations.
| value | 16-bit unsigned integer |
Here is the call graph for this function:| vl_uint_t vlAlgoCTZ32 | ( | vl_uint32_t | value | ) |
Counts the number of trailing zero bits in a 32-bit value.
Returns 32 if the input value is 0. Uses compiler intrinsics when available for optimal performance, with portable fallback implementations.
| value | 32-bit unsigned integer |
Here is the caller graph for this function:| vl_uint_t vlAlgoCTZ64 | ( | vl_uint64_t | value | ) |
Counts the number of trailing zero bits in a 64-bit value.
Returns 64 if the input value is 0. Uses compiler intrinsics when available for optimal performance, with portable fallback implementations.
| value | 64-bit unsigned integer |
Here is the call graph for this function:| vl_uint_t vlAlgoCTZ8 | ( | vl_uint8_t | value | ) |
Counts the number of trailing zero bits in an 8-bit value.
Returns 8 if the input value is 0. Uses compiler intrinsics when available for optimal performance, with portable fallback implementations.
| value | 8-bit unsigned integer |
Here is the caller graph for this function:| vl_ularge_t vlAlgoGCD | ( | vl_ularge_t | a, |
| vl_ularge_t | b | ||
| ) |
Computes the Greatest Common Divisor (GCD) of two unsigned integers.
Uses the Euclidean algorithm for efficient computation. Handles edge cases where one or both inputs are zero appropriately.
| a | first unsigned integer |
| b | second unsigned integer |
Here is the caller graph for this function:| vl_ilarge_t vlAlgoGCDSigned | ( | vl_ilarge_t | a, |
| vl_ilarge_t | b | ||
| ) |
Computes the Greatest Common Divisor (GCD) of two signed integers.
Converts inputs to absolute values and delegates to the unsigned version. Handles the edge case of the most negative integer value safely.
| a | first signed integer |
| b | second signed integer |
Here is the call graph for this function:| vl_bool_t vlAlgoIsPO2 | ( | vl_ularge_t | value | ) |
Tests whether a value is a power of 2.
Returns VL_FALSE for input value 0, as 0 is not considered a power of 2. Uses efficient bit manipulation to perform the test.
VL_TRUE if the value is a power of 2, VL_FALSE otherwise.| value | input unsigned integer |
| vl_ularge_t vlAlgoLCM | ( | vl_ularge_t | a, |
| vl_ularge_t | b | ||
| ) |
Computes the Least Common Multiple (LCM) of two unsigned integers.
Uses the relationship LCM(a,b) = |a*b| / GCD(a,b) with overflow protection. Returns 0 if either input is 0 or if the result would overflow.
| a | first unsigned integer |
| b | second unsigned integer |
Here is the call graph for this function:
Here is the caller graph for this function:| vl_ilarge_t vlAlgoLCMSigned | ( | vl_ilarge_t | a, |
| vl_ilarge_t | b | ||
| ) |
Computes the Least Common Multiple (LCM) of two signed integers.
The result is always positive by mathematical definition. Converts inputs to absolute values and delegates to the unsigned version with overflow checking. Returns 0 if either input is 0 or if the result would overflow.
| a | first signed integer |
| b | second signed integer |
Here is the call graph for this function:| vl_bool_t vlAlgoMulOverflow | ( | vl_ularge_t | a, |
| vl_ularge_t | b | ||
| ) |
Tests whether multiplying two unsigned integers would cause overflow.
Uses compiler intrinsics when available for optimal performance and accuracy. Falls back to portable overflow detection otherwise.
| a | first unsigned integer |
| b | second unsigned integer |
| vl_uint_t vlAlgoNextPO2 | ( | vl_ularge_t | value | ) |
Computes the next power of 2 greater than or equal to the given value.
If the input value is already a power of 2, it returns the same value. Returns 1 for input value 0. Returns 0 if the result would overflow.
vl_uint_t.| value | input unsigned integer |
| vl_uint_t vlAlgoPopCount16 | ( | vl_uint16_t | value | ) |
Counts the number of set bits (population count) in a 16-bit value.
Uses compiler intrinsics when available for optimal performance. Falls back to portable bit manipulation algorithms otherwise.
| value | 16-bit unsigned integer |
| vl_uint_t vlAlgoPopCount32 | ( | vl_uint32_t | value | ) |
Counts the number of set bits (population count) in a 32-bit value.
Uses compiler intrinsics when available for optimal performance. Falls back to portable bit manipulation algorithms otherwise.
| value | 32-bit unsigned integer |
Here is the caller graph for this function:| vl_uint_t vlAlgoPopCount64 | ( | vl_uint64_t | value | ) |
Counts the number of set bits (population count) in a 64-bit value.
Uses compiler intrinsics when available for optimal performance. Falls back to portable bit manipulation algorithms otherwise.
| value | 64-bit unsigned integer |
Here is the call graph for this function:| vl_uint_t vlAlgoPopCount8 | ( | vl_uint8_t | value | ) |
Counts the number of set bits (population count) in an 8-bit value.
Uses compiler intrinsics when available for optimal performance. Falls back to portable bit manipulation algorithms otherwise.
| value | 8-bit unsigned integer |
| vl_bool_t vlAlgoSubUnderflow | ( | vl_ularge_t | a, |
| vl_ularge_t | b | ||
| ) |
Tests whether subtracting two unsigned integers would cause underflow.
For unsigned integers, underflow occurs when the first operand is smaller than the second operand. Uses efficient comparison for detection.
| a | first unsigned integer |
| b | second unsigned integer |