Go to the documentation of this file.
37 #define DIV_H_INV_15625_32 0x431bde83ul
42 #define DIV_H_INV_15625_64 0x431bde82d7b634dbull
47 #define DIV_H_INV_15625_SHIFT 12
62 uint64_t _div_mulhi64(
const uint64_t a,
const uint64_t b);
72 if (val > 16383999997ull) {
94 assert(val <= 536870911999LLU);
96 uint32_t hi = val >> 32;
98 uint32_t r = (lo >> 16) + (hi << 16);
99 uint32_t res = r / 125;
100 r = ((r % 125) << 16) + (lo & 0xFFFF);
101 res = (res << 16) + r / 125;
150 if (val > 16383999997ull) {
166 return ((uint64_t)val * 0xBC8F1391UL) >> (15 + 32);
#define DIV_H_INV_15625_64
Approximation of (2**l)/d for d=15625, l=12, 64 bits.
#define DIV_H_INV_15625_32
Approximation of (2**l)/d for d=15625, l=12, 32 bits.
#define assert(cond)
abort the program if assertion is false
static uint64_t div_u64_by_15625(uint64_t val)
Integer divide val by 15625, 64 bit version.
POSIX.1-2008 compliant version of the assert macro.
static uint64_t div_u64_by_15625div512(uint64_t val)
Divide val by (15625/512)
#define DIV_H_INV_15625_SHIFT
Required shifts for division by 15625, l above.
static uint64_t div_u64_by_1000000(uint64_t val)
Integer divide val by 1000000.
static uint32_t div_u32_mod_44488(uint32_t val)
Modulo 44488.
static uint32_t div_u32_by_44488(uint32_t val)
Integer divide val by 44488.
static uint32_t div_u32_by_15625div512(uint32_t val)
Divide val by (15625/512)
static uint32_t div_u64_by_125(uint64_t val)
Integer divide val by 125.