1; Test strict conversions of signed i32s to floating-point values. 2; 3; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s 4 5declare float @llvm.experimental.constrained.sitofp.f32.i32(i32, metadata, metadata) 6declare double @llvm.experimental.constrained.sitofp.f64.i32(i32, metadata, metadata) 7declare fp128 @llvm.experimental.constrained.sitofp.f128.i32(i32, metadata, metadata) 8 9; Check i32->f32. 10define float @f1(i32 %i) #0 { 11; CHECK-LABEL: f1: 12; CHECK: cefbr %f0, %r2 13; CHECK: br %r14 14 %conv = call float @llvm.experimental.constrained.sitofp.f32.i32(i32 %i, 15 metadata !"round.dynamic", 16 metadata !"fpexcept.strict") #0 17 ret float %conv 18} 19 20; Check i32->f64. 21define double @f2(i32 %i) #0 { 22; CHECK-LABEL: f2: 23; CHECK: cdfbr %f0, %r2 24; CHECK: br %r14 25 %conv = call double @llvm.experimental.constrained.sitofp.f64.i32(i32 %i, 26 metadata !"round.dynamic", 27 metadata !"fpexcept.strict") #0 28 ret double %conv 29} 30 31; Check i32->f128. 32define void @f3(i32 %i, fp128 *%dst) #0 { 33; CHECK-LABEL: f3: 34; CHECK: cxfbr %f0, %r2 35; CHECK: std %f0, 0(%r3) 36; CHECK: std %f2, 8(%r3) 37; CHECK: br %r14 38 %conv = call fp128 @llvm.experimental.constrained.sitofp.f128.i32(i32 %i, 39 metadata !"round.dynamic", 40 metadata !"fpexcept.strict") #0 41 store fp128 %conv, fp128 *%dst 42 ret void 43} 44 45attributes #0 = { strictfp } 46