1
1
use rustc_abi:: { BackendRepr , Float , Integer , Primitive , RegKind , Size } ;
2
2
3
3
use crate :: callconv:: { ArgAbi , FnAbi , Reg } ;
4
- use crate :: spec:: HasTargetSpec ;
4
+ use crate :: spec:: { HasTargetSpec , RustcAbi } ;
5
5
6
6
// Win64 ABI: https://docs.microsoft.com/en-us/cpp/build/parameter-passing
7
7
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 > ) {
9
9
let fixup = |a : & mut ArgAbi < ' _ , Ty > , is_ret : bool | {
10
10
match a. layout . backend_repr {
11
11
BackendRepr :: Uninhabited | BackendRepr :: Memory { sized : false } => { }
@@ -23,7 +23,10 @@ pub(crate) fn compute_abi_info<Ty>(_cx: &impl HasTargetSpec, fn_abi: &mut FnAbi<
23
23
// (probably what clang calls "illegal vectors").
24
24
}
25
25
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
+ {
27
30
// `i128` is returned in xmm0 by Clang and GCC
28
31
// FIXME(#134288): This may change for the `-msvc` targets in the future.
29
32
let reg = Reg { kind : RegKind :: Vector , size : Size :: from_bits ( 128 ) } ;
0 commit comments