pub trait BitPacking: FastLanes {
// Required methods
unsafe fn unchecked_pack(width: usize, input: &[Self], output: &mut [Self]);
unsafe fn unchecked_unpack(
width: usize,
input: &[Self],
output: &mut [Self],
);
}
Expand description
BitPack
into a compile-time known bit-width.
Required Methods§
Sourceunsafe fn unchecked_pack(width: usize, input: &[Self], output: &mut [Self])
unsafe fn unchecked_pack(width: usize, input: &[Self], output: &mut [Self])
Packs 1024 elements into W
bits each, where W
is runtime-known instead of
compile-time known.
§Safety
The input slice must be of exactly length 1024. The output slice must be of length
1024 * W / T
, where T
is the bit-width of Self and W
is the packed width.
These lengths are checked only with debug_assert
(i.e., not checked on release builds).
Sourceunsafe fn unchecked_unpack(width: usize, input: &[Self], output: &mut [Self])
unsafe fn unchecked_unpack(width: usize, input: &[Self], output: &mut [Self])
Unpacks 1024 elements from W
bits each, where W
is runtime-known instead of
compile-time known.
§Safety
The input slice must be of length 1024 * W / T
, where T
is the bit-width of Self and W
is the packed width. The output slice must be of exactly length 1024.
These lengths are checked only with debug_assert
(i.e., not checked on release builds).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.