Skip to content

Commit

Permalink
Merge #2795
Browse files Browse the repository at this point in the history
2795: Fix singlepass Arm64 since #2775 r=Amanieu a=ptitSeb

# Description
PR #2775 broke Singlepass on Aarm64, since the test to check if the CPU have AVX or SSE 4.2 was done for all Architecture instead of being limited to x86_64.

Co-authored-by: ptitSeb <[email protected]>
  • Loading branch information
bors[bot] and ptitSeb authored Feb 18, 2022
2 parents 4c1bf5c + b6b07ba commit 50605d4
Showing 1 changed file with 14 additions and 9 deletions.
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

0 comments on commit 50605d4

Please sign in to comment.