Skip to content

Commit 4e3a8d5

Browse files
committed
Move validate_simd_type from intrinsics to intrinsics::simd
1 parent 9295b08 commit 4e3a8d5

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/intrinsics/mod.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,6 @@ macro validate_atomic_type($fx:ident, $intrinsic:ident, $span:ident, $ty:expr) {
9191
}
9292
}
9393

94-
fn validate_simd_type(fx: &mut FunctionCx<'_, '_, '_>, intrinsic: Symbol, span: Span, ty: Ty<'_>) {
95-
if !ty.is_simd() {
96-
fx.tcx.sess.span_err(span, &format!("invalid monomorphization of `{}` intrinsic: expected SIMD input type, found non-SIMD `{}`", intrinsic, ty));
97-
// Prevent verifier error
98-
crate::trap::trap_unreachable(fx, "compilation should not have succeeded");
99-
return;
100-
}
101-
}
102-
10394
pub(crate) fn clif_vector_type<'tcx>(tcx: TyCtxt<'tcx>, layout: TyAndLayout<'tcx>) -> Option<Type> {
10495
let (element, count) = match layout.abi {
10596
Abi::Vector { element, count } => (element, count),

src/intrinsics/simd.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ use rustc_span::Symbol;
66
use super::*;
77
use crate::prelude::*;
88

9+
fn validate_simd_type(fx: &mut FunctionCx<'_, '_, '_>, intrinsic: Symbol, span: Span, ty: Ty<'_>) {
10+
if !ty.is_simd() {
11+
fx.tcx.sess.span_err(span, &format!("invalid monomorphization of `{}` intrinsic: expected SIMD input type, found non-SIMD `{}`", intrinsic, ty));
12+
// Prevent verifier error
13+
crate::trap::trap_unreachable(fx, "compilation should not have succeeded");
14+
return;
15+
}
16+
}
17+
918
pub(super) fn codegen_simd_intrinsic_call<'tcx>(
1019
fx: &mut FunctionCx<'_, '_, 'tcx>,
1120
intrinsic: Symbol,

0 commit comments

Comments
 (0)