Ulrich Weigand | 9e3577f | 2013-05-06 16:17:29 +0000 | [diff] [blame] | 1 | ; Test conversions of signed i64s to floating-point values. |
| 2 | ; |
| 3 | ; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s |
| 4 | |
| 5 | ; Test i64->f32. |
| 6 | define float @f1(i64 %i) { |
Stephen Lin | d24ab20 | 2013-07-14 06:24:09 +0000 | [diff] [blame^] | 7 | ; CHECK-LABEL: f1: |
Ulrich Weigand | 9e3577f | 2013-05-06 16:17:29 +0000 | [diff] [blame] | 8 | ; CHECK: cegbr %f0, %r2 |
| 9 | ; CHECK: br %r14 |
| 10 | %conv = sitofp i64 %i to float |
| 11 | ret float %conv |
| 12 | } |
| 13 | |
| 14 | ; Test i64->f64. |
| 15 | define double @f2(i64 %i) { |
Stephen Lin | d24ab20 | 2013-07-14 06:24:09 +0000 | [diff] [blame^] | 16 | ; CHECK-LABEL: f2: |
Ulrich Weigand | 9e3577f | 2013-05-06 16:17:29 +0000 | [diff] [blame] | 17 | ; CHECK: cdgbr %f0, %r2 |
| 18 | ; CHECK: br %r14 |
| 19 | %conv = sitofp i64 %i to double |
| 20 | ret double %conv |
| 21 | } |
| 22 | |
| 23 | ; Test i64->f128. |
| 24 | define void @f3(i64 %i, fp128 *%dst) { |
Stephen Lin | d24ab20 | 2013-07-14 06:24:09 +0000 | [diff] [blame^] | 25 | ; CHECK-LABEL: f3: |
Ulrich Weigand | 9e3577f | 2013-05-06 16:17:29 +0000 | [diff] [blame] | 26 | ; CHECK: cxgbr %f0, %r2 |
| 27 | ; CHECK: std %f0, 0(%r3) |
| 28 | ; CHECK: std %f2, 8(%r3) |
| 29 | ; CHECK: br %r14 |
| 30 | %conv = sitofp i64 %i to fp128 |
| 31 | store fp128 %conv, fp128 *%dst |
| 32 | ret void |
| 33 | } |