Expand description
CPU architecture utilities — port of ojph_arch.h/cpp.
Provides CPU feature detection, alignment constants, and bit-manipulation helpers that wrap Rust intrinsics for clarity and C++ API compatibility.
Enums§
- ArmCpu
ExtLevel - Supported ARM SIMD extension levels.
- CpuExt
Level - Supported x86-64 SIMD extension levels, ordered by capability.
Constants§
- BYTE_
ALIGNMENT - Required byte alignment for SIMD buffers (AVX-512 = 64 bytes).
- LOG_
BYTE_ ALIGNMENT - log₂(BYTE_ALIGNMENT).
- OBJECT_
ALIGNMENT - Required alignment for heap-allocated objects.
Functions§
- calc_
aligned_ size - Returns the smallest multiple of
alignment(in bytes) that can holdcountelements of typeT. - count_
leading_ zeros - Count leading zeros (32-bit).
- count_
leading_ zeros_ u64 - Count leading zeros (64-bit).
- count_
trailing_ zeros - Count trailing zeros (32-bit).
- get_
cpu_ ext_ level - Detects the highest supported x86-64 SIMD level at runtime.
- ojph_
round - Rounds a float to the nearest integer (ties away from zero), matching the
C++
ojph_roundbehaviour. - ojph_
trunc - Truncates a float toward zero, matching the C++
ojph_trunc. - population_
count - Population count (number of set bits).