1 ; Test conversions of unsigned integers to floating-point values 2 ; (z196 and above). 3 ; 4 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z196 | FileCheck %s 5 6 ; Check i32->f32. 7 define float @f1(i32 %i) { 8 ; CHECK-LABEL: f1: 9 ; CHECK: celfbr %f0, 0, %r2, 0 10 ; CHECK: br %r14 11 %conv = uitofp i32 %i to float 12 ret float %conv 13 } 14 15 ; Check i32->f64. 16 define double @f2(i32 %i) { 17 ; CHECK-LABEL: f2: 18 ; CHECK: cdlfbr %f0, 0, %r2, 0 19 ; CHECK: br %r14 20 %conv = uitofp i32 %i to double 21 ret double %conv 22 } 23 24 ; Check i32->f128. 25 define void @f3(i32 %i, fp128 *%dst) { 26 ; CHECK-LABEL: f3: 27 ; CHECK: cxlfbr %f0, 0, %r2, 0 28 ; CHECK-DAG: std %f0, 0(%r3) 29 ; CHECK-DAG: std %f2, 8(%r3) 30 ; CHECK: br %r14 31 %conv = uitofp i32 %i to fp128 32 store fp128 %conv, fp128 *%dst 33 ret void 34 } 35 36 ; Check i64->f32. 37 define float @f4(i64 %i) { 38 ; CHECK-LABEL: f4: 39 ; CHECK: celgbr %f0, 0, %r2, 0 40 ; CHECK: br %r14 41 %conv = uitofp i64 %i to float 42 ret float %conv 43 } 44 45 ; Check i64->f64. 46 define double @f5(i64 %i) { 47 ; CHECK-LABEL: f5: 48 ; CHECK: cdlgbr %f0, 0, %r2, 0 49 ; CHECK: br %r14 50 %conv = uitofp i64 %i to double 51 ret double %conv 52 } 53 54 ; Check i64->f128. 55 define void @f6(i64 %i, fp128 *%dst) { 56 ; CHECK-LABEL: f6: 57 ; CHECK: cxlgbr %f0, 0, %r2, 0 58 ; CHECK-DAG: std %f0, 0(%r3) 59 ; CHECK-DAG: std %f2, 8(%r3) 60 ; CHECK: br %r14 61 %conv = uitofp i64 %i to fp128 62 store fp128 %conv, fp128 *%dst 63 ret void 64 } 65