about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbjorn3 <17426603+bjorn3@users.noreply.github.com>2025-02-20 15:06:53 +0000
committerbjorn3 <17426603+bjorn3@users.noreply.github.com>2025-02-20 15:06:56 +0000
commit18c210c7869b5786acde4d343a47df99113dba9b (patch)
tree2decba67ab9174a3f50fe7c525b3918cbee80216
parentc62239aeb3ba7781a6d7f7055523c1e8c22b409c (diff)
downloadrust-18c210c7869b5786acde4d343a47df99113dba9b.tar.gz
rust-18c210c7869b5786acde4d343a47df99113dba9b.zip
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)].
-rw-r--r--compiler/rustc_target/src/callconv/mod.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/rustc_target/src/callconv/mod.rs b/compiler/rustc_target/src/callconv/mod.rs
index c2a176facdf..b90a006ac51 100644
--- a/compiler/rustc_target/src/callconv/mod.rs
+++ b/compiler/rustc_target/src/callconv/mod.rs
@@ -737,7 +737,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,