Move validate_simd_type from intrinsics to intrinsics::simd
This commit is contained in:
parent
9295b086f6
commit
4e3a8d5fb9
@ -91,15 +91,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
fn validate_simd_type(fx: &mut FunctionCx<'_, '_, '_>, intrinsic: Symbol, span: Span, ty: Ty<'_>) {
|
||||
if !ty.is_simd() {
|
||||
fx.tcx.sess.span_err(span, &format!("invalid monomorphization of `{}` intrinsic: expected SIMD input type, found non-SIMD `{}`", intrinsic, ty));
|
||||
// Prevent verifier error
|
||||
crate::trap::trap_unreachable(fx, "compilation should not have succeeded");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn clif_vector_type<'tcx>(tcx: TyCtxt<'tcx>, layout: TyAndLayout<'tcx>) -> Option<Type> {
|
||||
let (element, count) = match layout.abi {
|
||||
Abi::Vector { element, count } => (element, count),
|
||||
|
@ -6,6 +6,15 @@
|
||||
use super::*;
|
||||
use crate::prelude::*;
|
||||
|
||||
fn validate_simd_type(fx: &mut FunctionCx<'_, '_, '_>, intrinsic: Symbol, span: Span, ty: Ty<'_>) {
|
||||
if !ty.is_simd() {
|
||||
fx.tcx.sess.span_err(span, &format!("invalid monomorphization of `{}` intrinsic: expected SIMD input type, found non-SIMD `{}`", intrinsic, ty));
|
||||
// Prevent verifier error
|
||||
crate::trap::trap_unreachable(fx, "compilation should not have succeeded");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
pub(super) fn codegen_simd_intrinsic_call<'tcx>(
|
||||
fx: &mut FunctionCx<'_, '_, 'tcx>,
|
||||
intrinsic: Symbol,
|
||||
|
Loading…
Reference in New Issue
Block a user