summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/intrinsic.rs
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2024-06-08 18:05:44 +0200
committerRalf Jung <post@ralfj.de>2024-06-08 21:38:32 +0200
commit2f2031d2b22d64d015625db2dd11e44e7ab37091 (patch)
tree60d35c6c73626aab991d5c7157b135cb987ee513 /compiler/rustc_codegen_llvm/src/intrinsic.rs
parent655600c5cba4d1e76fa0652c72258ec4996f48b8 (diff)
downloadrust-2f2031d2b22d64d015625db2dd11e44e7ab37091.tar.gz
rust-2f2031d2b22d64d015625db2dd11e44e7ab37091.zip
simd packed types: update outdated check, extend codegen test
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/intrinsic.rs')
-rw-r--r--compiler/rustc_codegen_llvm/src/intrinsic.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/compiler/rustc_codegen_llvm/src/intrinsic.rs b/compiler/rustc_codegen_llvm/src/intrinsic.rs
index 7b1038d5617..ad4e753fe9d 100644
--- a/compiler/rustc_codegen_llvm/src/intrinsic.rs
+++ b/compiler/rustc_codegen_llvm/src/intrinsic.rs
@@ -1109,10 +1109,12 @@ fn generic_simd_intrinsic<'ll, 'tcx>(
         tcx.normalize_erasing_late_bound_regions(ty::ParamEnv::reveal_all(), callee_ty.fn_sig(tcx));
     let arg_tys = sig.inputs();
 
-    // Vectors must be immediates (non-power-of-2 #[repr(packed)] are not)
-    for (ty, arg) in arg_tys.iter().zip(args) {
-        if ty.is_simd() && !matches!(arg.val, OperandValue::Immediate(_)) {
-            return_error!(InvalidMonomorphization::SimdArgument { span, name, ty: *ty });
+    // Sanity-check: all vector arguments must be immediates.
+    if cfg!(debug_assertions) {
+        for (ty, arg) in arg_tys.iter().zip(args) {
+            if ty.is_simd() {
+                assert!(matches!(arg.val, OperandValue::Immediate(_)));
+            }
         }
     }