Skip to content

Commit

Permalink
Rollup merge of rust-lang#137318 - bjorn3:cg_clif_abi_workaround, r=w…
Browse files Browse the repository at this point in the history
…orkingjubilee

Workaround Cranelift not yet properly supporting vectors smaller than 128bit

While it would technically be possible to workaround this in cg_clif, it quickly becomes very messy and would likely cause correctness issues. Working around it in rustc instead is much simper and won't have any negative impact for code running on stable as vectors smaller than 128bit can only be made on nightly using core::simd or #[repr(simd)].
  • Loading branch information
workingjubilee authored Feb 20, 2025
2 parents 9a0e823 + 18c210c commit 2b5570b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion compiler/rustc_target/src/callconv/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,9 @@ impl<'a, Ty> FnAbi<'a, Ty> {
// to 128-bit-sized vectors.
"x86" if spec.rustc_abi == Some(RustcAbi::X86Sse2) => arg.layout.size.bits() <= 128,
"x86_64" if spec.rustc_abi != Some(RustcAbi::X86Softfloat) => {
arg.layout.size.bits() <= 128
// FIXME once https://github.com/bytecodealliance/wasmtime/issues/10254 is fixed
// accept vectors up to 128bit rather than vectors of exactly 128bit.
arg.layout.size.bits() == 128
}
// So far, we haven't implemented this logic for any other target.
_ => false,
Expand Down

0 comments on commit 2b5570b

Please sign in to comment.