1 ; Test strict conversions of unsigned integers to floating-point values
4 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z196 | FileCheck %s
6 declare float @llvm.experimental.constrained.uitofp.f32.i32(i32, metadata, metadata)
7 declare double @llvm.experimental.constrained.uitofp.f64.i32(i32, metadata, metadata)
8 declare fp128 @llvm.experimental.constrained.uitofp.f128.i32(i32, metadata, metadata)
10 declare float @llvm.experimental.constrained.uitofp.f32.i64(i64, metadata, metadata)
11 declare double @llvm.experimental.constrained.uitofp.f64.i64(i64, metadata, metadata)
12 declare fp128 @llvm.experimental.constrained.uitofp.f128.i64(i64, metadata, metadata)
15 define float @f1(i32 %i) #0 {
17 ; CHECK: celfbr %f0, 0, %r2, 0
19 %conv = call float @llvm.experimental.constrained.uitofp.f32.i32(i32 %i,
20 metadata !"round.dynamic",
21 metadata !"fpexcept.strict") #0
26 define double @f2(i32 %i) #0 {
28 ; CHECK: cdlfbr %f0, 0, %r2, 0
30 %conv = call double @llvm.experimental.constrained.uitofp.f64.i32(i32 %i,
31 metadata !"round.dynamic",
32 metadata !"fpexcept.strict") #0
37 define void @f3(i32 %i, ptr %dst) #0 {
39 ; CHECK: cxlfbr %f0, 0, %r2, 0
40 ; CHECK-DAG: std %f0, 0(%r3)
41 ; CHECK-DAG: std %f2, 8(%r3)
43 %conv = call fp128 @llvm.experimental.constrained.uitofp.f128.i32(i32 %i,
44 metadata !"round.dynamic",
45 metadata !"fpexcept.strict") #0
46 store fp128 %conv, ptr %dst
51 define float @f4(i64 %i) #0 {
53 ; CHECK: celgbr %f0, 0, %r2, 0
55 %conv = call float @llvm.experimental.constrained.uitofp.f32.i64(i64 %i,
56 metadata !"round.dynamic",
57 metadata !"fpexcept.strict") #0
62 define double @f5(i64 %i) #0 {
64 ; CHECK: cdlgbr %f0, 0, %r2, 0
66 %conv = call double @llvm.experimental.constrained.uitofp.f64.i64(i64 %i,
67 metadata !"round.dynamic",
68 metadata !"fpexcept.strict") #0
73 define void @f6(i64 %i, ptr %dst) #0 {
75 ; CHECK: cxlgbr %f0, 0, %r2, 0
76 ; CHECK-DAG: std %f0, 0(%r3)
77 ; CHECK-DAG: std %f2, 8(%r3)
79 %conv = call fp128 @llvm.experimental.constrained.uitofp.f128.i64(i64 %i,
80 metadata !"round.dynamic",
81 metadata !"fpexcept.strict") #0
82 store fp128 %conv, ptr %dst
86 attributes #0 = { strictfp }