#[non_exhaustive]pub enum Backend {
V3GfniCrypto,
V3,
V2,
V1,
NeonAes,
Neon,
Wasm128,
Scalar,
}Expand description
The SIMD capability ladder, one variant per archmage tier the ecosystem
has kernels for.
Variants are named after the archmage
tier they prove and declared in that tier’s dispatch-priority order
(strongest first), mirroring archmage-macros/src/tiers.rs at the pinned
rev. The declaration order therefore is the ladder: it carries
capability, and it cannot drift from archmage’s source of truth without
the ordering test failing.
Ord follows declaration order with weaker sorting greater, matching
fff’s convention so the downgrade-only override check ports unchanged:
requested >= detected reads “requested is at most as strong as
detected”. min() over a summoning set is therefore the strongest tier.
Cross-arch variants never share a host: a wrong-arch token summons None,
so detection over the full ladder is unambiguous.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
V3GfniCrypto
x86 AVX2 + GFNI + crypto, 32-byte GFNI field multiply
(X64V3GfniCryptoToken, tiers.rs priority 37).
V3
x86 AVX2, 32-byte split-nibble shuffle (X64V3Token, priority 30).
V2
x86 SSE4.2, 16-byte split-nibble shuffle (X64V2Token, priority 20).
V1
x86 SSE2 baseline (X64V1Token, priority 10). Always summons on
x86_64; the x86 floor below which only Scalar remains.
NeonAes
AArch64 NEON + AES, 16-byte NEON (NeonAesToken, priority 30). The
aes feature proves PMULL, so this is the PMULL tier (R4).
Neon
AArch64 NEON baseline (NeonToken, priority 20).
Wasm128
WebAssembly simd128 (Wasm128Token, priority 20).
Scalar
Portable fallback, always present (ScalarToken, priority 0).
Implementations§
Source§impl Backend
impl Backend
Sourcepub const ALL: &'static [Backend]
pub const ALL: &'static [Backend]
Every backend in detection-preference order — the shipped ladder. A
&'static slice (not an array) so adding a tier is not a breaking
change to the type.
Sourcepub const fn name(self) -> &'static str
pub const fn name(self) -> &'static str
Short stable identifier, also the value accepted by the SIMD_BACKEND
override and the Backend::from_name / FromStr parse set.
Sourcepub fn from_name(name: &str) -> Option<Backend>
pub fn from_name(name: &str) -> Option<Backend>
Parse a backend name, as accepted by the SIMD_BACKEND override.
Sourcepub const fn lane_bytes(self) -> usize
pub const fn lane_bytes(self) -> usize
Architectural vector width in bytes per tier. Consumers that derive buffer geometry from the resolved backend import this; they never re-derive it.