Easy function multiversioning for Rust
multiversion
macro has been overhauled. Now uses a single attribute macro, rather than helper attributes.multiversion::target
module for querying the selected target features.x86-64-v2
or skylake
).targets = "simd"
option to automatically target all SIMD instruction sets.specialize
mode. All targets now specify clones. Specialization should be implemented by querying the selected targets.self
or Self
. Previous support was inconsistent and difficult to use correctly.impl Trait
support. Using impl Trait
in return position now results in an error.impl Trait
.#[safe_inner]
helper attribute for #[target]
.#[target_clones]
attribute (functionality is now included in #[multiversion]
attribute).#[multiversion]
interface now uses helper attributes, providing both target specialization and function cloning.compile_error!
instead of macro panics.#[target_cfg]
helper macromultiversion
macro now requires unsafe
to dispatch unsafe functions from safe functions