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