File tree Expand file tree Collapse file tree
compiler/rustc_target/src/callconv Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525
2626 let valid_unit = match unit. kind {
2727 RegKind :: Integer => false ,
28- RegKind :: Float => true ,
29- RegKind :: PpcF128 => unreachable ! ( ) ,
28+ RegKind :: Float => unit. size . bits ( ) == 32 || unit. size . bits ( ) == 64 ,
3029 RegKind :: Vector { .. } => unit. size . bits ( ) == 64 || unit. size . bits ( ) == 128 ,
30+ RegKind :: PpcF128 => unreachable ! ( ) ,
3131 } ;
3232
3333 valid_unit. then_some ( Uniform :: consecutive ( unit, size) )
Original file line number Diff line number Diff line change 1414// Test that homogeneous aggregates are passed and returned with the correct ABI on 32-bit arm.
1515
1616#![ feature( no_core, lang_items) ]
17- #![ feature( arm_target_feature) ]
17+ #![ feature( arm_target_feature, f16 , f128 ) ]
1818#![ crate_type = "lib" ]
1919#![ no_core]
2020
@@ -186,6 +186,20 @@ pub extern "C" fn test_floats_5(a: Floats5) {
186186 hint:: black_box ( a) ;
187187}
188188
189+ // Only f32 and f64 qualify as an HFA base.
190+
191+ // linux: define void @test_f16([2 x i32] %0)
192+ #[ unsafe( no_mangle) ]
193+ pub extern "C" fn test_f16 ( a : [ f16 ; 3 ] ) {
194+ hint:: black_box ( a) ;
195+ }
196+
197+ // linux: define void @test_f128([2 x i64] %0)
198+ #[ unsafe( no_mangle) ]
199+ pub extern "C" fn test_f128 ( a : [ f128 ; 1 ] ) {
200+ hint:: black_box ( a) ;
201+ }
202+
189203// Just a big struct, note how watchOS passes it indirectly.
190204#[ repr( C ) ]
191205pub struct Ints6 {
Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ pub extern "C" fn cplx_f16(x: Complex<f16>) -> Complex<f16> {
140140 // AARCH64_DARWIN: define{{.*}} [2 x half] @cplx_f16([2 x half] {{.*}})
141141 // AARCH64_MSVC: define{{.*}} [2 x half] @cplx_f16([2 x half] {{.*}})
142142 // ARM64EC: define{{.*}} [2 x half] @cplx_f16([2 x half] {{.*}})
143- // ARM: define{{.*}} [2 x half] @cplx_f16([2 x half ] {{.*}})
143+ // ARM: define{{.*}} i32 @cplx_f16([1 x i32 ] {{.*}})
144144 // I686: define{{.*}} <2 x half> @cplx_f16(ptr {{.*}} byval([4 x i8]) {{.*}})
145145 // LOONGARCH32: define{{.*}} { half, half } @cplx_f16({ half, half } {{.*}})
146146 // LOONGARCH64: define{{.*}} { half, half } @cplx_f16({ half, half } {{.*}})
@@ -466,7 +466,7 @@ pub extern "C" fn wrapper_cplx_f16(
466466 // AARCH64_DARWIN: define{{.*}} [2 x half] @wrapper_cplx_f16([2 x half] {{.*}})
467467 // AARCH64_MSVC: define{{.*}} [2 x half] @wrapper_cplx_f16([2 x half] {{.*}})
468468 // ARM64EC: define{{.*}} [2 x half] @wrapper_cplx_f16([2 x half] {{.*}})
469- // ARM: define{{.*}} [2 x half] @wrapper_cplx_f16([2 x half ] {{.*}})
469+ // ARM: define{{.*}} i32 @wrapper_cplx_f16([1 x i32 ] {{.*}})
470470 // I686: define{{.*}} <2 x half> @wrapper_cplx_f16(ptr {{.*}} byval([4 x i8]) {{.*}})
471471 // LOONGARCH32: define{{.*}} { half, half } @wrapper_cplx_f16({ half, half } {{.*}})
472472 // LOONGARCH64: define{{.*}} { half, half } @wrapper_cplx_f16({ half, half } {{.*}})
You can’t perform that action at this time.
0 commit comments