mirror of
https://github.com/mii443/wasmer.git
synced 2025-08-23 16:59:27 +00:00
[feat]: Adding the plumbing necessary for the singlepass to choose between different simd instruction sets. Partial work on supporting SSE4.2
This commit is contained in:
@ -68,11 +68,15 @@ impl Compiler for SinglepassCompiler {
|
||||
target.triple().architecture.to_string(),
|
||||
));
|
||||
}
|
||||
if !target.cpu_features().contains(CpuFeature::AVX) {
|
||||
let simd_arch = if target.cpu_features().contains(CpuFeature::AVX) {
|
||||
CpuFeature::AVX
|
||||
} else if target.cpu_features().contains(CpuFeature::SSE42) {
|
||||
CpuFeature::SSE42
|
||||
} else {
|
||||
return Err(CompileError::UnsupportedTarget(
|
||||
"x86_64 without AVX".to_string(),
|
||||
"x86_64 without AVX or SSE 4.2".to_string(),
|
||||
));
|
||||
}
|
||||
};
|
||||
if compile_info.features.multi_value {
|
||||
return Err(CompileError::UnsupportedFeature("multivalue".to_string()));
|
||||
}
|
||||
@ -127,7 +131,7 @@ impl Compiler for SinglepassCompiler {
|
||||
}
|
||||
|
||||
let machine = match target.triple().architecture {
|
||||
Architecture::X86_64 => MachineX86_64::new(),
|
||||
Architecture::X86_64 => MachineX86_64::new(Some(simd_arch)),
|
||||
_ => unimplemented!(),
|
||||
};
|
||||
let mut generator = FuncGen::new(
|
||||
|
Reference in New Issue
Block a user