Expand description
Fixed point arithmetic helpers mirroring <lib/fixed_point.h>.
The central type is Fp3264, a 32.64 unsigned fixed point number (32
integer bits and 64 fractional bits) used by platform timer code to convert
between clock domains (e.g. TSC ticks to nanoseconds) without floating
point.
Structs§
- Fp3264
- A 32.64 unsigned fixed point number: 32 integer bits followed by 64 fractional bits, stored as three little-endian-by-significance limbs.
Functions§
- fp_
32_ ⚠64_ div_ 32_ 32 - Computes
dividend / divisoras a 32.64 fixed point value, truncating any fraction below the 64th fractional bit, and stores the result intoresult. - u32_
mul_ u64_ fp32_ 64 - Multiplies a 64-bit integer
aby the 32.64 fixed point valueb, returning the low 32 bits of the product rounded to the nearest integer. - u64_
mul_ u32_ fp32_ 64 - Multiplies a 32-bit integer
aby the 32.64 fixed point valueb, returning the product rounded to the nearest 64-bit integer. - u64_
mul_ u64_ fp32_ 64 - Multiplies a 64-bit integer
aby the 32.64 fixed point valueb, returning the low 64 bits of the product rounded to the nearest integer.