Skip to main content

GfBackend

Enum GfBackend 

Source
#[repr(u8)]
pub enum GfBackend { Scalar = 0, Ssse3 = 1, Avx2 = 2, Avx512Pshufb = 3, Gfni256 = 4, Gfni512 = 5, AffineScalar = 6, Neon = 7, }
Expand description

GF(256) multiply-add backend, exposed so an A/B bench can compare every SIMD rung against the scalar baseline and so the GFNI / AVX-512 logic can be validated on a host without the silicon via the bit-exact software affine emulation. The production hot loop (gf_mul_add) auto-selects the fastest rung this host can run; the ladder always bottoms out at Scalar.

Variants§

§

Scalar = 0

Portable table-lookup multiply. Always available; the fallback floor.

§

Ssse3 = 1

SSSE3 PSHUFB nibble-table multiply, 16 bytes per op.

§

Avx2 = 2

AVX2 PSHUFB nibble-table multiply, 32 bytes per op.

§

Avx512Pshufb = 3

AVX-512BW PSHUFB nibble-table multiply, 64 bytes per op (no GFNI).

§

Gfni256 = 4

GFNI affine GF(2^8) multiply on 256-bit lanes: a hardware field multiply (no table), broad consumer reach (gfni + avx2, no AVX-512 needed).

§

Gfni512 = 5

GFNI affine GF(2^8) multiply on 512-bit lanes: 64 bytes per op in one hardware instruction.

§

AffineScalar = 6

Software emulation of the GFNI affine transform: bit-exact to the GFNI hardware path, runnable on any host. Validates the GFNI logic where the silicon is absent, the same emulate-to-verify approach the AVX-512 substrate uses.

§

Neon = 7

ARM NEON TBL nibble-table multiply, 16 bytes per vqtbl1q_u8. The aarch64 byte-shuffle rung: the same nibble-table technique as SSSE3, so bit-identical to it (and to scalar). NEON is baseline on every aarch64 CPU, so this rung is always available on Apple Silicon / Neoverse.

Implementations§

Source§

impl GfBackend

Source

pub fn available(self) -> bool

Whether this backend can execute on the current host.

Source

pub fn name(self) -> &'static str

Short identifier for diagnostics / bench output.

Trait Implementations§

Source§

impl Clone for GfBackend

Source§

fn clone(&self) -> GfBackend

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for GfBackend

Source§

impl Debug for GfBackend

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for GfBackend

Source§

impl PartialEq for GfBackend

Source§

fn eq(&self, other: &GfBackend) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for GfBackend

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.