pub fn generate_dispatcher(
config: DispatcherConfig,
) -> Result<TokenStream, Error>Expand description
Generate a cached runtime ISA dispatcher TokenStream.
The emitted code:
- Declares ISA constants (only once per invocation; the caller is responsible for deduplication if multiple sizes share a module).
- Declares a
static DETECTED_ISA_{size}_{ty}: AtomicU8. - Emits a private
detect_isa_{size}_{ty}() -> u8probe function. - Emits a public
codelet_simd_{size}_cached_{ty}(data, sign)dispatcher.
The dispatcher delegates to the same arch-specific inner functions that the
basic (uncached) dispatcher in super uses, following the exact same
naming convention: codelet_simd_{size}_{isa}_{ty}.
ยงErrors
Returns syn::Error when config.size is not one of 2, 4, 8, or 16.