1 ; Test v4f32 rounding on z14.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z14 | FileCheck %s
5 declare float @llvm.rint.f32(float)
6 declare float @llvm.nearbyint.f32(float)
7 declare float @llvm.floor.f32(float)
8 declare float @llvm.ceil.f32(float)
9 declare float @llvm.trunc.f32(float)
10 declare float @llvm.round.f32(float)
11 declare <4 x float> @llvm.rint.v4f32(<4 x float>)
12 declare <4 x float> @llvm.nearbyint.v4f32(<4 x float>)
13 declare <4 x float> @llvm.floor.v4f32(<4 x float>)
14 declare <4 x float> @llvm.ceil.v4f32(<4 x float>)
15 declare <4 x float> @llvm.trunc.v4f32(<4 x float>)
16 declare <4 x float> @llvm.round.v4f32(<4 x float>)
18 define <4 x float> @f1(<4 x float> %val) {
20 ; CHECK: vfisb %v24, %v24, 0, 0
22 %res = call <4 x float> @llvm.rint.v4f32(<4 x float> %val)
26 define <4 x float> @f2(<4 x float> %val) {
28 ; CHECK: vfisb %v24, %v24, 4, 0
30 %res = call <4 x float> @llvm.nearbyint.v4f32(<4 x float> %val)
34 define <4 x float> @f3(<4 x float> %val) {
36 ; CHECK: vfisb %v24, %v24, 4, 7
38 %res = call <4 x float> @llvm.floor.v4f32(<4 x float> %val)
42 define <4 x float> @f4(<4 x float> %val) {
44 ; CHECK: vfisb %v24, %v24, 4, 6
46 %res = call <4 x float> @llvm.ceil.v4f32(<4 x float> %val)
50 define <4 x float> @f5(<4 x float> %val) {
52 ; CHECK: vfisb %v24, %v24, 4, 5
54 %res = call <4 x float> @llvm.trunc.v4f32(<4 x float> %val)
58 define <4 x float> @f6(<4 x float> %val) {
60 ; CHECK: vfisb %v24, %v24, 4, 1
62 %res = call <4 x float> @llvm.round.v4f32(<4 x float> %val)
66 define float @f7(<4 x float> %val) {
68 ; CHECK: wfisb %f0, %v24, 0, 0
70 %scalar = extractelement <4 x float> %val, i32 0
71 %res = call float @llvm.rint.f32(float %scalar)
75 define float @f8(<4 x float> %val) {
77 ; CHECK: wfisb %f0, %v24, 4, 0
79 %scalar = extractelement <4 x float> %val, i32 0
80 %res = call float @llvm.nearbyint.f32(float %scalar)
84 define float @f9(<4 x float> %val) {
86 ; CHECK: wfisb %f0, %v24, 4, 7
88 %scalar = extractelement <4 x float> %val, i32 0
89 %res = call float @llvm.floor.f32(float %scalar)
93 define float @f10(<4 x float> %val) {
95 ; CHECK: wfisb %f0, %v24, 4, 6
97 %scalar = extractelement <4 x float> %val, i32 0
98 %res = call float @llvm.ceil.f32(float %scalar)
102 define float @f11(<4 x float> %val) {
104 ; CHECK: wfisb %f0, %v24, 4, 5
106 %scalar = extractelement <4 x float> %val, i32 0
107 %res = call float @llvm.trunc.f32(float %scalar)
111 define float @f12(<4 x float> %val) {
113 ; CHECK: wfisb %f0, %v24, 4, 1
115 %scalar = extractelement <4 x float> %val, i32 0
116 %res = call float @llvm.round.f32(float %scalar)