blob: 295ce8bdbe2ce4265492864695e4d010bd2f9d9d [file] [log] [blame]
Richard Sandiforddc6c2c92014-03-21 10:56:30 +00001; Test conversions of unsigned i64s to floating-point values (z10 only).
Ulrich Weigand9e3577f2013-05-06 16:17:29 +00002;
Richard Sandiforddc6c2c92014-03-21 10:56:30 +00003; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z10 | FileCheck %s
Ulrich Weigand9e3577f2013-05-06 16:17:29 +00004
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.
7define float @f1(i64 %i) {
Stephen Lind24ab202013-07-14 06:24:09 +00008; CHECK-LABEL: f1:
Ulrich Weigand9e3577f2013-05-06 16:17:29 +00009; 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.
17define double @f2(i64 %i) {
Stephen Lind24ab202013-07-14 06:24:09 +000018; CHECK-LABEL: f2:
Ulrich Weigand9e3577f2013-05-06 16:17:29 +000019; CHECK: ldgr
Richard Sandifordec8693d2013-06-27 09:49:34 +000020; CHECK: adbr
Ulrich Weigand9e3577f2013-05-06 16:17:29 +000021; CHECK: br %r14
22 %conv = uitofp i64 %i to double
23 ret double %conv
24}
25
26; Test i64->f128.
27define void @f3(i64 %i, fp128 *%dst) {
Stephen Lind24ab202013-07-14 06:24:09 +000028; CHECK-LABEL: f3:
Ulrich Weigand9e3577f2013-05-06 16:17:29 +000029; 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}