Skip to main content

Crate target_features

Crate target_features 

Source
Expand description

Types and constants for working with target features.

Target feature constants are provided in a module named for the target architecture, such as x86_64 or aarch64. Each constant includes the target feature it names and any implicitly enabled target features.

use target_features::{TargetFeatures, x86_64::{AVX, BMI2, FMA}};

const REQUIRED: TargetFeatures = AVX.with(FMA).with(BMI2);
assert!(REQUIRED.contains(AVX));

Generated with rustc 1.100.0-nightly (0ed41eb41 2026-09-04).

Modules§

aarch64
arm
arm64ec
bpf
hexagon
loongarch32
loongarch64
mips
mips64
nvptx64
powerpc
powerpc64
riscv32
riscv64
s390x
sparc
sparc64
wasm32
wasm64
x86
x86_64

Macros§

target_features
Constructs a TargetFeatures value from target feature names.

Structs§

TargetFeatures
A set of target features.

Traits§

SimdElement
Types that can be elements of SIMD vectors.