1 ; Test strict conversion of floating-point values to unsigned integers.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z196 | FileCheck %s
5 declare i32 @llvm.experimental.constrained.fptoui.i32.f32(float, metadata)
6 declare i32 @llvm.experimental.constrained.fptoui.i32.f64(double, metadata)
7 declare i32 @llvm.experimental.constrained.fptoui.i32.f128(fp128, metadata)
9 declare i64 @llvm.experimental.constrained.fptoui.i64.f32(float, metadata)
10 declare i64 @llvm.experimental.constrained.fptoui.i64.f64(double, metadata)
11 declare i64 @llvm.experimental.constrained.fptoui.i64.f128(fp128, metadata)
14 define i32 @f1(float %f) #0 {
16 ; CHECK: clfebr %r2, 5, %f0, 0
18 %conv = call i32 @llvm.experimental.constrained.fptoui.i32.f32(float %f,
19 metadata !"fpexcept.strict") #0
24 define i32 @f2(double %f) #0 {
26 ; CHECK: clfdbr %r2, 5, %f0, 0
28 %conv = call i32 @llvm.experimental.constrained.fptoui.i32.f64(double %f,
29 metadata !"fpexcept.strict") #0
34 define i32 @f3(ptr %src) #0 {
36 ; CHECK-DAG: ld %f0, 0(%r2)
37 ; CHECK-DAG: ld %f2, 8(%r2)
38 ; CHECK: clfxbr %r2, 5, %f0, 0
40 %f = load fp128, ptr %src
41 %conv = call i32 @llvm.experimental.constrained.fptoui.i32.f128(fp128 %f,
42 metadata !"fpexcept.strict") #0
47 define i64 @f4(float %f) #0 {
49 ; CHECK: clgebr %r2, 5, %f0, 0
51 %conv = call i64 @llvm.experimental.constrained.fptoui.i64.f32(float %f,
52 metadata !"fpexcept.strict") #0
57 define i64 @f5(double %f) #0 {
59 ; CHECK: clgdbr %r2, 5, %f0, 0
61 %conv = call i64 @llvm.experimental.constrained.fptoui.i64.f64(double %f,
62 metadata !"fpexcept.strict") #0
67 define i64 @f6(ptr %src) #0 {
69 ; CHECK-DAG: ld %f0, 0(%r2)
70 ; CHECK-DAG: ld %f2, 8(%r2)
71 ; CHECK: clgxbr %r2, 5, %f0, 0
73 %f = load fp128, ptr %src
74 %conv = call i64 @llvm.experimental.constrained.fptoui.i64.f128(fp128 %f,
75 metadata !"fpexcept.strict") #0
79 attributes #0 = { strictfp }