1 ; Test strict v4f32 rounding on z14.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z14 | FileCheck %s
5 declare float @llvm.experimental.constrained.rint.f32(float, metadata, metadata)
6 declare float @llvm.experimental.constrained.nearbyint.f32(float, metadata, metadata)
7 declare float @llvm.experimental.constrained.floor.f32(float, metadata, metadata)
8 declare float @llvm.experimental.constrained.ceil.f32(float, metadata, metadata)
9 declare float @llvm.experimental.constrained.trunc.f32(float, metadata, metadata)
10 declare float @llvm.experimental.constrained.round.f32(float, metadata, metadata)
11 declare <4 x float> @llvm.experimental.constrained.rint.v4f32(<4 x float>, metadata, metadata)
12 declare <4 x float> @llvm.experimental.constrained.nearbyint.v4f32(<4 x float>, metadata, metadata)
13 declare <4 x float> @llvm.experimental.constrained.floor.v4f32(<4 x float>, metadata, metadata)
14 declare <4 x float> @llvm.experimental.constrained.ceil.v4f32(<4 x float>, metadata, metadata)
15 declare <4 x float> @llvm.experimental.constrained.trunc.v4f32(<4 x float>, metadata, metadata)
16 declare <4 x float> @llvm.experimental.constrained.round.v4f32(<4 x float>, metadata, metadata)
18 define <4 x float> @f1(<4 x float> %val) {
20 ; CHECK: vfisb %v24, %v24, 0, 0
22 %res = call <4 x float> @llvm.experimental.constrained.rint.v4f32(
24 metadata !"round.dynamic",
25 metadata !"fpexcept.strict")
29 define <4 x float> @f2(<4 x float> %val) {
31 ; CHECK: vfisb %v24, %v24, 4, 0
33 %res = call <4 x float> @llvm.experimental.constrained.nearbyint.v4f32(
35 metadata !"round.dynamic",
36 metadata !"fpexcept.strict")
40 define <4 x float> @f3(<4 x float> %val) {
42 ; CHECK: vfisb %v24, %v24, 4, 7
44 %res = call <4 x float> @llvm.experimental.constrained.floor.v4f32(
46 metadata !"round.dynamic",
47 metadata !"fpexcept.strict")
51 define <4 x float> @f4(<4 x float> %val) {
53 ; CHECK: vfisb %v24, %v24, 4, 6
55 %res = call <4 x float> @llvm.experimental.constrained.ceil.v4f32(
57 metadata !"round.dynamic",
58 metadata !"fpexcept.strict")
62 define <4 x float> @f5(<4 x float> %val) {
64 ; CHECK: vfisb %v24, %v24, 4, 5
66 %res = call <4 x float> @llvm.experimental.constrained.trunc.v4f32(
68 metadata !"round.dynamic",
69 metadata !"fpexcept.strict")
73 define <4 x float> @f6(<4 x float> %val) {
75 ; CHECK: vfisb %v24, %v24, 4, 1
77 %res = call <4 x float> @llvm.experimental.constrained.round.v4f32(
79 metadata !"round.dynamic",
80 metadata !"fpexcept.strict")
84 define float @f7(<4 x float> %val) {
86 ; CHECK: wfisb %f0, %v24, 0, 0
88 %scalar = extractelement <4 x float> %val, i32 0
89 %res = call float @llvm.experimental.constrained.rint.f32(
91 metadata !"round.dynamic",
92 metadata !"fpexcept.strict")
96 define float @f8(<4 x float> %val) {
98 ; CHECK: wfisb %f0, %v24, 4, 0
100 %scalar = extractelement <4 x float> %val, i32 0
101 %res = call float @llvm.experimental.constrained.nearbyint.f32(
103 metadata !"round.dynamic",
104 metadata !"fpexcept.strict")
108 define float @f9(<4 x float> %val) {
110 ; CHECK: wfisb %f0, %v24, 4, 7
112 %scalar = extractelement <4 x float> %val, i32 0
113 %res = call float @llvm.experimental.constrained.floor.f32(
115 metadata !"round.dynamic",
116 metadata !"fpexcept.strict")
120 define float @f10(<4 x float> %val) {
122 ; CHECK: wfisb %f0, %v24, 4, 6
124 %scalar = extractelement <4 x float> %val, i32 0
125 %res = call float @llvm.experimental.constrained.ceil.f32(
127 metadata !"round.dynamic",
128 metadata !"fpexcept.strict")
132 define float @f11(<4 x float> %val) {
134 ; CHECK: wfisb %f0, %v24, 4, 5
136 %scalar = extractelement <4 x float> %val, i32 0
137 %res = call float @llvm.experimental.constrained.trunc.f32(
139 metadata !"round.dynamic",
140 metadata !"fpexcept.strict")
144 define float @f12(<4 x float> %val) {
146 ; CHECK: wfisb %f0, %v24, 4, 1
148 %scalar = extractelement <4 x float> %val, i32 0
149 %res = call float @llvm.experimental.constrained.round.f32(
151 metadata !"round.dynamic",
152 metadata !"fpexcept.strict")