1 ; Test strict conversions of unsigned i32s to floating-point values (z10 only).
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z10 | FileCheck %s
5 declare float @llvm.experimental.constrained.uitofp.f32.i32(i32, metadata, metadata)
6 declare double @llvm.experimental.constrained.uitofp.f64.i32(i32, metadata, metadata)
7 declare fp128 @llvm.experimental.constrained.uitofp.f128.i32(i32, metadata, metadata)
9 ; Check i32->f32. There is no native instruction, so we must promote
11 define float @f1(i32 %i) #0 {
13 ; CHECK: llgfr [[REGISTER:%r[0-5]]], %r2
14 ; CHECK: cegbr %f0, [[REGISTER]]
16 %conv = call float @llvm.experimental.constrained.uitofp.f32.i32(i32 %i,
17 metadata !"round.dynamic",
18 metadata !"fpexcept.strict") #0
23 define double @f2(i32 %i) #0 {
25 ; CHECK: llgfr [[REGISTER:%r[0-5]]], %r2
26 ; CHECK: cdgbr %f0, [[REGISTER]]
28 %conv = call double @llvm.experimental.constrained.uitofp.f64.i32(i32 %i,
29 metadata !"round.dynamic",
30 metadata !"fpexcept.strict") #0
35 define void @f3(i32 %i, fp128 *%dst) #0 {
37 ; CHECK: llgfr [[REGISTER:%r[0-5]]], %r2
38 ; CHECK: cxgbr %f0, [[REGISTER]]
39 ; CHECK: std %f0, 0(%r3)
40 ; CHECK: std %f2, 8(%r3)
42 %conv = call fp128 @llvm.experimental.constrained.uitofp.f128.i32(i32 %i,
43 metadata !"round.dynamic",
44 metadata !"fpexcept.strict") #0
45 store fp128 %conv, fp128 *%dst
49 attributes #0 = { strictfp }