Skip to main content

Module bits

Module bits 

Source
Expand description

Codec kernels with CPU features picked at run time: BMI2 (owned by the simoom-compress work). Codec kernels with CPU features picked at run time (owned by the simoom-compress work).

bmi2 says whether the CPU has BMI1, BMI2 and LZCNT (x86-64); the loops in crate::codec then run a copy compiled with them (shlx/shrx/tzcnt: no shift-count moves), as libzstd’s DYNAMIC_BMI2 builds do. set_scalar_only forces the base-target copy on a thread, so tests can compare the two.

Functions§

bmi2
The CPU has BMI1, BMI2 and LZCNT (checked once), and set_scalar_only is off.
set_scalar_only
Makes the codec loops on this thread use the base-target code from now on (true) or pick by CPU again (false): for tests and fuzzing that check both paths give the same results.