@@ -23,20 +23,24 @@ 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+ && matches ! (
28+ scalar. primitive( ) ,
29+ Primitive :: Int ( Integer :: I128 , _) | Primitive :: Float ( Float :: F128 )
30+ )
31+ {
32+ // i128 and f128 have the same ABI on Windows.
2733 if cx. target_spec ( ) . rustc_abi == Some ( RustcAbi :: X86Softfloat ) {
28- // Use the native `i128` LLVM type for the softfloat ABI -- in other words, adjust nothing.
34+ // Use the native `i128`/`f128` LLVM type for the softfloat ABI -- in other
35+ // words, adjust nothing.
2936 } else {
30- // `i128` is returned in xmm0 by Clang and GCC
37+ // `i128` and `f128` are returned in xmm0 by Clang. `i128` is returned in
38+ // xmm0 by GCC but `f128` is indirect (Clang and GCC have a mismatch).
3139 // FIXME(#134288): This may change for the `-msvc` targets in the future.
3240 let reg = Reg { kind : RegKind :: Vector , size : Size :: from_bits ( 128 ) } ;
3341 a. cast_to ( reg) ;
3442 }
35- } else if a. layout . size . bytes ( ) > 8
36- && !matches ! ( scalar. primitive( ) , Primitive :: Float ( Float :: F128 ) )
37- {
38- // Match what LLVM does for `f128` so that `compiler-builtins` builtins match up
39- // with what LLVM expects.
43+ } else if a. layout . size . bytes ( ) > 8 {
4044 a. make_indirect ( ) ;
4145 } else {
4246 a. extend_integer_width_to ( 32 ) ;
0 commit comments