#[non_exhaustive]pub enum Backend {
Portable,
Sse42,
Avx2,
Avx512,
Neon,
}Expand description
An instruction set that packs and unpacks groups. Every backend writes and reads the same bytes; they differ only in speed.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Portable
Plain Rust, any processor.
Sse42
x86-64 SSE4.2: a row as two 128-bit vectors.
Avx2
x86-64 AVX2: a row as one 256-bit vector.
Avx512
x86-64 AVX-512: two rows of a group in one 512-bit vector.
Neon
AArch64 NEON: a row as two 128-bit vectors.
Implementations§
Source§impl Backend
impl Backend
Sourcepub fn active() -> Self
pub fn active() -> Self
The backend this processor runs: the best of Backend::available,
found once.
Sourcepub fn available() -> impl Iterator<Item = Self>
pub fn available() -> impl Iterator<Item = Self>
The backends this processor can run, best first.
Sourcepub fn is_available(self) -> bool
pub fn is_available(self) -> bool
Whether this processor has the instructions of the backend.
Sourcepub fn pack_groups(self, src: &[[u32; 256]], width: u32, out: &mut [u8])
pub fn pack_groups(self, src: &[[u32; 256]], width: u32, out: &mut [u8])
Groups’ numbers packed onto out (group_bytes of them each): src
holds GROUP numbers per group, each fitting width bits (1..=32).
§Panics
If the backend is not available, width is out
of range, or out is shorter than the groups’ bytes.
Trait Implementations§
impl Copy for Backend
impl Eq for Backend
impl StructuralPartialEq for Backend
Auto Trait Implementations§
impl Freeze for Backend
impl RefUnwindSafe for Backend
impl Send for Backend
impl Sync for Backend
impl Unpin for Backend
impl UnsafeUnpin for Backend
impl UnwindSafe for Backend
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more