Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
bytecodealliance
GitHub Repository: bytecodealliance/wasmtime
Path: blob/main/cranelift/fuzzgen/src/target_isa_extras.rs
1692 views
1
use cranelift::prelude::isa::TargetIsa;
2
use target_lexicon::Architecture;
3
4
pub trait TargetIsaExtras {
5
fn supports_simd(&self) -> bool;
6
}
7
8
impl TargetIsaExtras for &dyn TargetIsa {
9
fn supports_simd(&self) -> bool {
10
match self.triple().architecture {
11
// RISC-V only supports SIMD with the V extension.
12
Architecture::Riscv64(_) => self
13
.isa_flags()
14
.iter()
15
.find(|f| f.name == "has_v")
16
.and_then(|f| f.as_bool())
17
.unwrap_or(false),
18
_ => true,
19
}
20
}
21
}
22
23