Sync from rust 873d4682c7
This commit is contained in:
commit
3a3e5f5fa5
4 changed files with 30 additions and 2 deletions
|
|
@ -55,6 +55,9 @@ pub(crate) fn conv_to_call_conv(
|
|||
match c {
|
||||
CanonAbi::Rust | CanonAbi::RustCold | CanonAbi::C => default_call_conv,
|
||||
|
||||
// Cranelift doesn't currently have anything for this.
|
||||
CanonAbi::RustPreserveNone => default_call_conv,
|
||||
|
||||
// Functions with this calling convention can only be called from assembly, but it is
|
||||
// possible to declare an `extern "custom"` block, so the backend still needs a calling
|
||||
// convention for declaring foreign functions.
|
||||
|
|
|
|||
|
|
@ -242,7 +242,7 @@ impl DebugContext {
|
|||
let generics = tcx.generics_of(enclosing_fn_def_id);
|
||||
let args = instance.args.truncate_to(tcx, generics);
|
||||
|
||||
type_names::push_generic_params(
|
||||
type_names::push_generic_args(
|
||||
tcx,
|
||||
tcx.normalize_erasing_regions(ty::TypingEnv::fully_monomorphized(), args),
|
||||
&mut name,
|
||||
|
|
|
|||
|
|
@ -1506,7 +1506,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
|
|||
}
|
||||
|
||||
// FIXME implement variadics in cranelift
|
||||
sym::va_copy | sym::va_arg | sym::va_end => {
|
||||
sym::va_arg | sym::va_end => {
|
||||
fx.tcx.dcx().span_fatal(
|
||||
source_info.span,
|
||||
"Defining variadic functions is not yet supported by Cranelift",
|
||||
|
|
|
|||
|
|
@ -348,6 +348,31 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
|
|||
ret.write_cvalue(fx, ret_lane);
|
||||
}
|
||||
|
||||
sym::simd_splat => {
|
||||
intrinsic_args!(fx, args => (value); intrinsic);
|
||||
|
||||
if !ret.layout().ty.is_simd() {
|
||||
report_simd_type_validation_error(fx, intrinsic, span, ret.layout().ty);
|
||||
return;
|
||||
}
|
||||
let (lane_count, lane_ty) = ret.layout().ty.simd_size_and_type(fx.tcx);
|
||||
|
||||
if value.layout().ty != lane_ty {
|
||||
fx.tcx.dcx().span_fatal(
|
||||
span,
|
||||
format!(
|
||||
"[simd_splat] expected element type {lane_ty:?}, got {got:?}",
|
||||
got = value.layout().ty
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
for i in 0..lane_count {
|
||||
let ret_lane = ret.place_lane(fx, i.into());
|
||||
ret_lane.write_cvalue(fx, value);
|
||||
}
|
||||
}
|
||||
|
||||
sym::simd_neg
|
||||
| sym::simd_bswap
|
||||
| sym::simd_bitreverse
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue