@@ -48,6 +48,9 @@ unsigned long check_ulong() { return 0; }
4848// CHECK-LABEL: define{{.*}} i64 @check_ulonglong()
4949unsigned long long check_ulonglong () { return 0 ; }
5050
51+ // CHECK-LABEL: define{{.*}} half @check_float16()
52+ _Float16 check_float16 () { return 0 ; }
53+
5154// CHECK-LABEL: define{{.*}} float @check_float()
5255float check_float () { return 0 ; }
5356
@@ -127,6 +130,14 @@ struct i16x4_s f_i16x4_s(struct i16x4_s x) {
127130/// available, the value is passed in a GAR; if no GAR is available, the value
128131/// is passed on the stack.
129132
133+ struct f16x1_s {
134+ __fp16 a ;
135+ };
136+
137+ struct float16x1_s {
138+ _Float16 a ;
139+ };
140+
130141struct f32x1_s {
131142 float a ;
132143};
@@ -135,6 +146,16 @@ struct f64x1_s {
135146 double a ;
136147};
137148
149+ // CHECK-LABEL: define{{.*}} half @f_f16x1_s(half %0)
150+ struct f16x1_s f_f16x1_s (struct f16x1_s x ) {
151+ return x ;
152+ }
153+
154+ // CHECK-LABEL: define{{.*}} half @f_float16x1_s(half %0)
155+ struct float16x1_s f_float16x1_s (struct float16x1_s x ) {
156+ return x ;
157+ }
158+
138159// CHECK-LABEL: define{{.*}} float @f_f32x1_s(float %0)
139160struct f32x1_s f_f32x1_s (struct f32x1_s x ) {
140161 return x ;
@@ -151,10 +172,20 @@ struct f64x1_s f_f64x1_s(struct f64x1_s x) {
151172/// number of available FAR is less than 2, it’s passed in a GAR, and passed on
152173/// the stack if no GAR is available.
153174
175+ struct f16x2_s {
176+ __fp16 a ;
177+ _Float16 b ;
178+ };
179+
154180struct f32x2_s {
155181 float a , b ;
156182};
157183
184+ // CHECK-LABEL: define{{.*}} { half, half } @f_f16x2_s(half %0, half %1)
185+ struct f16x2_s f_f16x2_s (struct f16x2_s x ) {
186+ return x ;
187+ }
188+
158189// CHECK-LABEL: define{{.*}} { float, float } @f_f32x2_s(float %0, float %1)
159190struct f32x2_s f_f32x2_s (struct f32x2_s x ) {
160191 return x ;
@@ -165,11 +196,21 @@ struct f32x2_s f_f32x2_s(struct f32x2_s x) {
165196/// i. Multiple fixed-point members. If there are available GAR, the structure
166197/// is passed in a GAR, and passed on the stack if no GAR is available.
167198
199+ struct f16x1_i16x2_s {
200+ _Float16 a ;
201+ int16_t b , c ;
202+ };
203+
168204struct f32x1_i16x2_s {
169205 float a ;
170206 int16_t b , c ;
171207};
172208
209+ // CHECK-LABEL: define{{.*}} i64 @f_f16x1_i16x2_s(i64 %x.coerce)
210+ struct f16x1_i16x2_s f_f16x1_i16x2_s (struct f16x1_i16x2_s x ) {
211+ return x ;
212+ }
213+
173214// CHECK-LABEL: define{{.*}} i64 @f_f32x1_i16x2_s(i64 %x.coerce)
174215struct f32x1_i16x2_s f_f32x1_i16x2_s (struct f32x1_i16x2_s x ) {
175216 return x ;
@@ -181,11 +222,21 @@ struct f32x1_i16x2_s f_f32x1_i16x2_s(struct f32x1_i16x2_s x) {
181222/// but one GAR is available, it’s passed in GAR; If no GAR is available, it’s
182223/// passed on the stack.
183224
225+ struct f16x1_i32x1_s {
226+ _Float16 a ;
227+ int32_t b ;
228+ };
229+
184230struct f32x1_i32x1_s {
185231 float a ;
186232 int32_t b ;
187233};
188234
235+ // CHECK-LABEL: define{{.*}} { half, i32 } @f_f16x1_i32x1_s(half %0, i32 %1)
236+ struct f16x1_i32x1_s f_f16x1_i32x1_s (struct f16x1_i32x1_s x ) {
237+ return x ;
238+ }
239+
189240// CHECK-LABEL: define{{.*}} { float, i32 } @f_f32x1_i32x1_s(float %0, i32 %1)
190241struct f32x1_i32x1_s f_f32x1_i32x1_s (struct f32x1_i32x1_s x ) {
191242 return x ;
@@ -253,6 +304,16 @@ struct f32x4_s f_f32x4_s(struct f32x4_s x) {
253304 return x ;
254305}
255306
307+ struct f16x5_s {
308+ _Float16 a , b , c , d ;
309+ __fp16 e ;
310+ };
311+
312+ // CHECK-LABEL: define{{.*}} [2 x i64] @f_f16x5_s([2 x i64] %x.coerce)
313+ struct f16x5_s f_f16x5_s (struct f16x5_s x ) {
314+ return x ;
315+ }
316+
256317/// ii. The structure with two double members is passed in a pair of available
257318/// FARs. If no a pair of available FARs, it’s passed in GARs. A structure with
258319/// one double member and one float member is same.
@@ -312,6 +373,16 @@ struct f32x2_i32x2_s f_f32x2_i32x2_s(struct f32x2_i32x2_s x) {
312373 return x ;
313374}
314375
376+ struct f16x4_i32x2_s {
377+ _Float16 a , b , c , d ;
378+ int32_t e , f ;
379+ };
380+
381+ // CHECK-LABEL: define{{.*}} [2 x i64] @f_f16x4_i32x2_s([2 x i64] %x.coerce)
382+ struct f16x4_i32x2_s f_f16x4_i32x2_s (struct f16x4_i32x2_s x ) {
383+ return x ;
384+ }
385+
315386/// 3. WOA > 2 × GRLEN
316387/// a. It’s passed by reference and are replaced in the argument list with the
317388/// address. If there is an available GAR, the reference is passed in the GAR,
0 commit comments