Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix singlepass Arm64 since #2775 #2795

Merged
merged 1 commit into from
Feb 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions lib/compiler-singlepass/src/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,19 @@ impl Compiler for SinglepassCompiler {
}
}

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 or SSE 4.2".to_string(),
));
let simd_arch = match target.triple().architecture {
Architecture::X86_64 => {
if target.cpu_features().contains(CpuFeature::AVX) {
Some(CpuFeature::AVX)
} else if target.cpu_features().contains(CpuFeature::SSE42) {
Some(CpuFeature::SSE42)
} else {
return Err(CompileError::UnsupportedTarget(
"x86_64 without AVX or SSE 4.2".to_string(),
));
}
}
_ => None,
};
if compile_info.features.multi_value {
return Err(CompileError::UnsupportedFeature("multivalue".to_string()));
Expand Down Expand Up @@ -134,7 +139,7 @@ impl Compiler for SinglepassCompiler {

match target.triple().architecture {
Architecture::X86_64 => {
let machine = MachineX86_64::new(Some(simd_arch));
let machine = MachineX86_64::new(simd_arch);
let mut generator = FuncGen::new(
module,
&self.config,
Expand Down