File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -55,6 +55,9 @@ pub(crate) fn conv_to_call_conv(
5555 match c {
5656 CanonAbi :: Rust | CanonAbi :: RustCold | CanonAbi :: C => default_call_conv,
5757
58+ // Cranelift doesn't currently have anything for this.
59+ CanonAbi :: RustPreserveNone => default_call_conv,
60+
5861 // Functions with this calling convention can only be called from assembly, but it is
5962 // possible to declare an `extern "custom"` block, so the backend still needs a calling
6063 // convention for declaring foreign functions.
Original file line number Diff line number Diff line change @@ -242,7 +242,7 @@ impl DebugContext {
242242 let generics = tcx. generics_of ( enclosing_fn_def_id) ;
243243 let args = instance. args . truncate_to ( tcx, generics) ;
244244
245- type_names:: push_generic_params (
245+ type_names:: push_generic_args (
246246 tcx,
247247 tcx. normalize_erasing_regions ( ty:: TypingEnv :: fully_monomorphized ( ) , args) ,
248248 & mut name,
Original file line number Diff line number Diff line change @@ -1506,7 +1506,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
15061506 }
15071507
15081508 // FIXME implement variadics in cranelift
1509- sym:: va_copy | sym :: va_arg | sym:: va_end => {
1509+ sym:: va_arg | sym:: va_end => {
15101510 fx. tcx . dcx ( ) . span_fatal (
15111511 source_info. span ,
15121512 "Defining variadic functions is not yet supported by Cranelift" ,
Original file line number Diff line number Diff line change @@ -348,6 +348,31 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
348348 ret. write_cvalue ( fx, ret_lane) ;
349349 }
350350
351+ sym:: simd_splat => {
352+ intrinsic_args ! ( fx, args => ( value) ; intrinsic) ;
353+
354+ if !ret. layout ( ) . ty . is_simd ( ) {
355+ report_simd_type_validation_error ( fx, intrinsic, span, ret. layout ( ) . ty ) ;
356+ return ;
357+ }
358+ let ( lane_count, lane_ty) = ret. layout ( ) . ty . simd_size_and_type ( fx. tcx ) ;
359+
360+ if value. layout ( ) . ty != lane_ty {
361+ fx. tcx . dcx ( ) . span_fatal (
362+ span,
363+ format ! (
364+ "[simd_splat] expected element type {lane_ty:?}, got {got:?}" ,
365+ got = value. layout( ) . ty
366+ ) ,
367+ ) ;
368+ }
369+
370+ for i in 0 ..lane_count {
371+ let ret_lane = ret. place_lane ( fx, i. into ( ) ) ;
372+ ret_lane. write_cvalue ( fx, value) ;
373+ }
374+ }
375+
351376 sym:: simd_neg
352377 | sym:: simd_bswap
353378 | sym:: simd_bitreverse
You can’t perform that action at this time.
0 commit comments