Richard Sandiford | dc6c2c9 | 2014-03-21 10:56:30 +0000 | [diff] [blame] | 1 | ; Test conversions of unsigned i64s to floating-point values (z10 only). |
Ulrich Weigand | 9e3577f | 2013-05-06 16:17:29 +0000 | [diff] [blame] | 2 | ; |
Richard Sandiford | dc6c2c9 | 2014-03-21 10:56:30 +0000 | [diff] [blame] | 3 | ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z10 | FileCheck %s |
Ulrich Weigand | 9e3577f | 2013-05-06 16:17:29 +0000 | [diff] [blame] | 4 | |
| 5 | ; Test i64->f32. There's no native support for unsigned i64-to-fp conversions, |
| 6 | ; but we should be able to implement them using signed i64-to-fp conversions. |
| 7 | define float @f1(i64 %i) { |
Stephen Lin | d24ab20 | 2013-07-14 06:24:09 +0000 | [diff] [blame] | 8 | ; CHECK-LABEL: f1: |
Ulrich Weigand | 9e3577f | 2013-05-06 16:17:29 +0000 | [diff] [blame] | 9 | ; CHECK: cegbr |
| 10 | ; CHECK: aebr |
| 11 | ; CHECK: br %r14 |
| 12 | %conv = uitofp i64 %i to float |
| 13 | ret float %conv |
| 14 | } |
| 15 | |
| 16 | ; Test i64->f64. |
| 17 | define double @f2(i64 %i) { |
Stephen Lin | d24ab20 | 2013-07-14 06:24:09 +0000 | [diff] [blame] | 18 | ; CHECK-LABEL: f2: |
Ulrich Weigand | 9e3577f | 2013-05-06 16:17:29 +0000 | [diff] [blame] | 19 | ; CHECK: ldgr |
Richard Sandiford | ec8693d | 2013-06-27 09:49:34 +0000 | [diff] [blame] | 20 | ; CHECK: adbr |
Ulrich Weigand | 9e3577f | 2013-05-06 16:17:29 +0000 | [diff] [blame] | 21 | ; CHECK: br %r14 |
| 22 | %conv = uitofp i64 %i to double |
| 23 | ret double %conv |
| 24 | } |
| 25 | |
| 26 | ; Test i64->f128. |
| 27 | define void @f3(i64 %i, fp128 *%dst) { |
Stephen Lin | d24ab20 | 2013-07-14 06:24:09 +0000 | [diff] [blame] | 28 | ; CHECK-LABEL: f3: |
Ulrich Weigand | 9e3577f | 2013-05-06 16:17:29 +0000 | [diff] [blame] | 29 | ; CHECK: cxgbr |
| 30 | ; CHECK: axbr |
| 31 | ; CHECK: br %r14 |
| 32 | %conv = uitofp i64 %i to fp128 |
| 33 | store fp128 %conv, fp128 *%dst |
| 34 | ret void |
| 35 | } |