11use rustc_abi:: { BackendRepr , Float , Integer , Primitive , RegKind , Size } ;
22
33use crate :: callconv:: { ArgAbi , FnAbi , Reg } ;
4- use crate :: spec:: HasTargetSpec ;
4+ use crate :: spec:: { HasTargetSpec , RustcAbi } ;
55
66// Win64 ABI: https://docs.microsoft.com/en-us/cpp/build/parameter-passing
77
8- pub ( crate ) fn compute_abi_info < Ty > ( _cx : & impl HasTargetSpec , fn_abi : & mut FnAbi < ' _ , Ty > ) {
8+ pub ( crate ) fn compute_abi_info < Ty > ( cx : & impl HasTargetSpec , fn_abi : & mut FnAbi < ' _ , Ty > ) {
99 let fixup = |a : & mut ArgAbi < ' _ , Ty > , is_ret : bool | {
1010 match a. layout . backend_repr {
1111 BackendRepr :: Uninhabited | BackendRepr :: Memory { sized : false } => { }
@@ -23,7 +23,10 @@ pub(crate) fn compute_abi_info<Ty>(_cx: &impl HasTargetSpec, fn_abi: &mut FnAbi<
2323 // (probably what clang calls "illegal vectors").
2424 }
2525 BackendRepr :: Scalar ( scalar) => {
26- if is_ret && matches ! ( scalar. primitive( ) , Primitive :: Int ( Integer :: I128 , _) ) {
26+ if is_ret
27+ && cx. target_spec ( ) . rustc_abi != Some ( RustcAbi :: X86Softfloat )
28+ && matches ! ( scalar. primitive( ) , Primitive :: Int ( Integer :: I128 , _) )
29+ {
2730 // `i128` is returned in xmm0 by Clang and GCC
2831 // FIXME(#134288): This may change for the `-msvc` targets in the future.
2932 let reg = Reg { kind : RegKind :: Vector , size : Size :: from_bits ( 128 ) } ;
0 commit comments