|
1 |
| -// 32-bit x86 returns `f32` and `f64` differently to avoid the x87 stack. |
| 1 | +// 32-bit x86 returns float types differently to avoid the x87 stack. |
2 | 2 | // 32-bit systems will return 128bit values using a return area pointer.
|
3 | 3 | //@ revisions: x86 bit32 bit64
|
4 | 4 | //@[x86] only-x86
|
@@ -58,42 +58,44 @@ pub fn f16_le(a: f16, b: f16) -> bool {
|
58 | 58 | a <= b
|
59 | 59 | }
|
60 | 60 |
|
61 |
| -// CHECK-LABEL: half @f16_neg( |
| 61 | +// This is where we check the argument and return ABI for f16. |
| 62 | +// other-LABEL: half @f16_neg(half |
| 63 | +// x86-LABEL: i16 @f16_neg(half |
62 | 64 | #[no_mangle]
|
63 | 65 | pub fn f16_neg(a: f16) -> f16 {
|
64 | 66 | // CHECK: fneg half %{{.+}}
|
65 | 67 | -a
|
66 | 68 | }
|
67 | 69 |
|
68 |
| -// CHECK-LABEL: half @f16_add( |
| 70 | +// CHECK-LABEL: @f16_add |
69 | 71 | #[no_mangle]
|
70 | 72 | pub fn f16_add(a: f16, b: f16) -> f16 {
|
71 | 73 | // CHECK: fadd half %{{.+}}, %{{.+}}
|
72 | 74 | a + b
|
73 | 75 | }
|
74 | 76 |
|
75 |
| -// CHECK-LABEL: half @f16_sub( |
| 77 | +// CHECK-LABEL: @f16_sub |
76 | 78 | #[no_mangle]
|
77 | 79 | pub fn f16_sub(a: f16, b: f16) -> f16 {
|
78 | 80 | // CHECK: fsub half %{{.+}}, %{{.+}}
|
79 | 81 | a - b
|
80 | 82 | }
|
81 | 83 |
|
82 |
| -// CHECK-LABEL: half @f16_mul( |
| 84 | +// CHECK-LABEL: @f16_mul |
83 | 85 | #[no_mangle]
|
84 | 86 | pub fn f16_mul(a: f16, b: f16) -> f16 {
|
85 | 87 | // CHECK: fmul half %{{.+}}, %{{.+}}
|
86 | 88 | a * b
|
87 | 89 | }
|
88 | 90 |
|
89 |
| -// CHECK-LABEL: half @f16_div( |
| 91 | +// CHECK-LABEL: @f16_div |
90 | 92 | #[no_mangle]
|
91 | 93 | pub fn f16_div(a: f16, b: f16) -> f16 {
|
92 | 94 | // CHECK: fdiv half %{{.+}}, %{{.+}}
|
93 | 95 | a / b
|
94 | 96 | }
|
95 | 97 |
|
96 |
| -// CHECK-LABEL: half @f16_rem( |
| 98 | +// CHECK-LABEL: @f16_rem |
97 | 99 | #[no_mangle]
|
98 | 100 | pub fn f16_rem(a: f16, b: f16) -> f16 {
|
99 | 101 | // CHECK: frem half %{{.+}}, %{{.+}}
|
@@ -142,10 +144,13 @@ pub fn f16_rem_assign(a: &mut f16, b: f16) {
|
142 | 144 |
|
143 | 145 | /* float to float conversions */
|
144 | 146 |
|
145 |
| -// CHECK-LABEL: half @f16_as_self( |
| 147 | +// other-LABEL: half @f16_as_self( |
| 148 | +// x86-LABEL: i16 @f16_as_self( |
146 | 149 | #[no_mangle]
|
147 | 150 | pub fn f16_as_self(a: f16) -> f16 {
|
148 |
| - // CHECK: ret half %{{.+}} |
| 151 | + // other-CHECK: ret half %{{.+}} |
| 152 | + // x86-CHECK: bitcast half |
| 153 | + // x86-CHECK: ret i16 |
149 | 154 | a as f16
|
150 | 155 | }
|
151 | 156 |
|
@@ -176,21 +181,21 @@ pub fn f16_as_f128(a: f16) -> f128 {
|
176 | 181 | a as f128
|
177 | 182 | }
|
178 | 183 |
|
179 |
| -// CHECK-LABEL: half @f32_as_f16( |
| 184 | +// CHECK-LABEL: @f32_as_f16 |
180 | 185 | #[no_mangle]
|
181 | 186 | pub fn f32_as_f16(a: f32) -> f16 {
|
182 | 187 | // CHECK: fptrunc float %{{.+}} to half
|
183 | 188 | a as f16
|
184 | 189 | }
|
185 | 190 |
|
186 |
| -// CHECK-LABEL: half @f64_as_f16( |
| 191 | +// CHECK-LABEL: @f64_as_f16 |
187 | 192 | #[no_mangle]
|
188 | 193 | pub fn f64_as_f16(a: f64) -> f16 {
|
189 | 194 | // CHECK: fptrunc double %{{.+}} to half
|
190 | 195 | a as f16
|
191 | 196 | }
|
192 | 197 |
|
193 |
| -// CHECK-LABEL: half @f128_as_f16( |
| 198 | +// CHECK-LABEL: @f128_as_f16 |
194 | 199 | #[no_mangle]
|
195 | 200 | pub fn f128_as_f16(a: f128) -> f16 {
|
196 | 201 | // CHECK: fptrunc fp128 %{{.+}} to half
|
@@ -273,70 +278,70 @@ pub fn f16_as_i128(a: f16) -> i128 {
|
273 | 278 |
|
274 | 279 | /* int to float conversions */
|
275 | 280 |
|
276 |
| -// CHECK-LABEL: half @u8_as_f16( |
| 281 | +// CHECK-LABEL: @u8_as_f16 |
277 | 282 | #[no_mangle]
|
278 | 283 | pub fn u8_as_f16(a: u8) -> f16 {
|
279 | 284 | // CHECK: uitofp i8 %{{.+}} to half
|
280 | 285 | a as f16
|
281 | 286 | }
|
282 | 287 |
|
283 |
| -// CHECK-LABEL: half @u16_as_f16( |
| 288 | +// CHECK-LABEL: @u16_as_f16 |
284 | 289 | #[no_mangle]
|
285 | 290 | pub fn u16_as_f16(a: u16) -> f16 {
|
286 | 291 | // CHECK: uitofp i16 %{{.+}} to half
|
287 | 292 | a as f16
|
288 | 293 | }
|
289 | 294 |
|
290 |
| -// CHECK-LABEL: half @u32_as_f16( |
| 295 | +// CHECK-LABEL: @u32_as_f16 |
291 | 296 | #[no_mangle]
|
292 | 297 | pub fn u32_as_f16(a: u32) -> f16 {
|
293 | 298 | // CHECK: uitofp i32 %{{.+}} to half
|
294 | 299 | a as f16
|
295 | 300 | }
|
296 | 301 |
|
297 |
| -// CHECK-LABEL: half @u64_as_f16( |
| 302 | +// CHECK-LABEL: @u64_as_f16 |
298 | 303 | #[no_mangle]
|
299 | 304 | pub fn u64_as_f16(a: u64) -> f16 {
|
300 | 305 | // CHECK: uitofp i64 %{{.+}} to half
|
301 | 306 | a as f16
|
302 | 307 | }
|
303 | 308 |
|
304 |
| -// CHECK-LABEL: half @u128_as_f16( |
| 309 | +// CHECK-LABEL: @u128_as_f16 |
305 | 310 | #[no_mangle]
|
306 | 311 | pub fn u128_as_f16(a: u128) -> f16 {
|
307 | 312 | // CHECK: uitofp i128 %{{.+}} to half
|
308 | 313 | a as f16
|
309 | 314 | }
|
310 | 315 |
|
311 |
| -// CHECK-LABEL: half @i8_as_f16( |
| 316 | +// CHECK-LABEL: @i8_as_f16 |
312 | 317 | #[no_mangle]
|
313 | 318 | pub fn i8_as_f16(a: i8) -> f16 {
|
314 | 319 | // CHECK: sitofp i8 %{{.+}} to half
|
315 | 320 | a as f16
|
316 | 321 | }
|
317 | 322 |
|
318 |
| -// CHECK-LABEL: half @i16_as_f16( |
| 323 | +// CHECK-LABEL: @i16_as_f16 |
319 | 324 | #[no_mangle]
|
320 | 325 | pub fn i16_as_f16(a: i16) -> f16 {
|
321 | 326 | // CHECK: sitofp i16 %{{.+}} to half
|
322 | 327 | a as f16
|
323 | 328 | }
|
324 | 329 |
|
325 |
| -// CHECK-LABEL: half @i32_as_f16( |
| 330 | +// CHECK-LABEL: @i32_as_f16 |
326 | 331 | #[no_mangle]
|
327 | 332 | pub fn i32_as_f16(a: i32) -> f16 {
|
328 | 333 | // CHECK: sitofp i32 %{{.+}} to half
|
329 | 334 | a as f16
|
330 | 335 | }
|
331 | 336 |
|
332 |
| -// CHECK-LABEL: half @i64_as_f16( |
| 337 | +// CHECK-LABEL: @i64_as_f16 |
333 | 338 | #[no_mangle]
|
334 | 339 | pub fn i64_as_f16(a: i64) -> f16 {
|
335 | 340 | // CHECK: sitofp i64 %{{.+}} to half
|
336 | 341 | a as f16
|
337 | 342 | }
|
338 | 343 |
|
339 |
| -// CHECK-LABEL: half @i128_as_f16( |
| 344 | +// CHECK-LABEL: @i128_as_f16 |
340 | 345 | #[no_mangle]
|
341 | 346 | pub fn i128_as_f16(a: i128) -> f16 {
|
342 | 347 | // CHECK: sitofp i128 %{{.+}} to half
|
|
0 commit comments