1 ; Test f128 floating-point strict truncations/extensions on z14.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z14 | FileCheck %s
5 declare float @llvm.experimental.constrained.fptrunc.f32.f128(fp128, metadata, metadata)
6 declare double @llvm.experimental.constrained.fptrunc.f64.f128(fp128, metadata, metadata)
8 declare fp128 @llvm.experimental.constrained.fpext.f128.f32(float, metadata)
9 declare fp128 @llvm.experimental.constrained.fpext.f128.f64(double, metadata)
12 define double @f1(fp128 *%ptr) {
14 ; CHECK: vl [[REG:%v[0-9]+]], 0(%r2)
15 ; CHECK: wflrx %f0, [[REG]], 0, 0
17 %val = load fp128, fp128 *%ptr
18 %res = call double @llvm.experimental.constrained.fptrunc.f64.f128(
20 metadata !"round.dynamic",
21 metadata !"fpexcept.strict")
26 define float @f2(fp128 *%ptr) {
28 ; CHECK: vl [[REG:%v[0-9]+]], 0(%r2)
29 ; CHECK: wflrx %f0, [[REG]], 0, 3
30 ; CHECK: ledbra %f0, 0, %f0, 0
32 %val = load fp128, fp128 *%ptr
33 %res = call float @llvm.experimental.constrained.fptrunc.f32.f128(
35 metadata !"round.dynamic",
36 metadata !"fpexcept.strict")
41 define void @f3(fp128 *%dst, double %val) {
43 ; CHECK: wflld [[RES:%v[0-9]+]], %f0
44 ; CHECK: vst [[RES]], 0(%r2)
46 %res = call fp128 @llvm.experimental.constrained.fpext.f128.f64(double %val,
47 metadata !"fpexcept.strict")
48 store fp128 %res, fp128 *%dst
53 define void @f4(fp128 *%dst, float %val) {
55 ; CHECK: ldebr %f0, %f0
56 ; CHECK: wflld [[RES:%v[0-9]+]], %f0
57 ; CHECK: vst [[RES]], 0(%r2)
59 %res = call fp128 @llvm.experimental.constrained.fpext.f128.f32(float %val,
60 metadata !"fpexcept.strict")
61 store fp128 %res, fp128 *%dst