62 lines · plain
1; Test strict conversions of unsigned i64s to floating-point values (z10 only).2;3; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z10 | FileCheck %s4 5declare half @llvm.experimental.constrained.uitofp.f16.i64(i64, metadata, metadata)6declare float @llvm.experimental.constrained.uitofp.f32.i64(i64, metadata, metadata)7declare double @llvm.experimental.constrained.uitofp.f64.i64(i64, metadata, metadata)8declare fp128 @llvm.experimental.constrained.uitofp.f128.i64(i64, metadata, metadata)9 10; Test i64->f16. For z10, this results in just a single a libcall.11define half @f0(i64 %i) #0 {12; CHECK-LABEL: f0:13; CHECK: cegbr14; CHECK: aebr15; CHECK: brasl %r14, __truncsfhf2@PLT16; CHECK: br %r1417 %conv = call half @llvm.experimental.constrained.uitofp.f16.i64(i64 %i,18 metadata !"round.dynamic",19 metadata !"fpexcept.strict") #020 ret half %conv21}22 23; Test i64->f32. There's no native support for unsigned i64-to-fp conversions,24; but we should be able to implement them using signed i64-to-fp conversions.25define float @f1(i64 %i) #0 {26; CHECK-LABEL: f1:27; CHECK: cegbr28; CHECK: aebr29; CHECK: br %r1430 %conv = call float @llvm.experimental.constrained.uitofp.f32.i64(i64 %i,31 metadata !"round.dynamic",32 metadata !"fpexcept.strict") #033 ret float %conv34}35 36; Test i64->f64.37define double @f2(i64 %i) #0 {38; CHECK-LABEL: f2:39; CHECK: cdgbr40; CHECK: adbr41; CHECK: br %r1442 %conv = call double @llvm.experimental.constrained.uitofp.f64.i64(i64 %i,43 metadata !"round.dynamic",44 metadata !"fpexcept.strict") #045 ret double %conv46}47 48; Test i64->f128.49define void @f3(i64 %i, ptr %dst) #0 {50; CHECK-LABEL: f3:51; CHECK: cxgbr52; CHECK: axbr53; CHECK: br %r1454 %conv = call fp128 @llvm.experimental.constrained.uitofp.f128.i64(i64 %i,55 metadata !"round.dynamic",56 metadata !"fpexcept.strict") #057 store fp128 %conv, ptr %dst58 ret void59}60 61attributes #0 = { strictfp }62