1 ; Test f128 floating-point strict conversion to/from integers on z14.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z14 | FileCheck %s
5 ; FIXME: llvm.experimental.constrained.[su]itofp does not yet exist
7 declare i32 @llvm.experimental.constrained.fptosi.i32.f128(fp128, metadata)
8 declare i64 @llvm.experimental.constrained.fptosi.i64.f128(fp128, metadata)
10 declare i32 @llvm.experimental.constrained.fptoui.i32.f128(fp128, metadata)
11 declare i64 @llvm.experimental.constrained.fptoui.i64.f128(fp128, metadata)
13 ; Test signed f128->i32.
14 define i32 @f5(fp128 *%src) {
16 ; CHECK: vl %v0, 0(%r2)
17 ; CHECK: vrepg %v2, %v0, 1
18 ; CHECK: cfxbr %r2, 5, %f0
20 %f = load fp128, fp128 *%src
21 %conv = call i32 @llvm.experimental.constrained.fptosi.i32.f128(fp128 %f,
22 metadata !"fpexcept.strict")
26 ; Test signed f128->i64.
27 define i64 @f6(fp128 *%src) {
29 ; CHECK: vl %v0, 0(%r2)
30 ; CHECK: vrepg %v2, %v0, 1
31 ; CHECK: cgxbr %r2, 5, %f0
33 %f = load fp128, fp128 *%src
34 %conv = call i64 @llvm.experimental.constrained.fptosi.i64.f128(fp128 %f,
35 metadata !"fpexcept.strict")
39 ; Test unsigned f128->i32.
40 define i32 @f7(fp128 *%src) {
42 ; CHECK: vl %v0, 0(%r2)
43 ; CHECK: vrepg %v2, %v0, 1
44 ; CHECK: clfxbr %r2, 5, %f0, 0
46 %f = load fp128, fp128 *%src
47 %conv = call i32 @llvm.experimental.constrained.fptoui.i32.f128(fp128 %f,
48 metadata !"fpexcept.strict")
52 ; Test unsigned f128->i64.
53 define i64 @f8(fp128 *%src) {
55 ; CHECK: vl %v0, 0(%r2)
56 ; CHECK: vrepg %v2, %v0, 1
57 ; CHECK: clgxbr %r2, 5, %f0, 0
59 %f = load fp128, fp128 *%src
60 %conv = call i64 @llvm.experimental.constrained.fptoui.i64.f128(fp128 %f,
61 metadata !"fpexcept.strict")