172 lines · plain
1; Test strict v4f32 rounding on z14.2;3; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z14 | FileCheck %s4 5declare float @llvm.experimental.constrained.rint.f32(float, metadata, metadata)6declare float @llvm.experimental.constrained.nearbyint.f32(float, metadata, metadata)7declare float @llvm.experimental.constrained.floor.f32(float, metadata)8declare float @llvm.experimental.constrained.ceil.f32(float, metadata)9declare float @llvm.experimental.constrained.trunc.f32(float, metadata)10declare float @llvm.experimental.constrained.round.f32(float, metadata)11declare float @llvm.experimental.constrained.roundeven.f32(float, metadata)12declare <4 x float> @llvm.experimental.constrained.rint.v4f32(<4 x float>, metadata, metadata)13declare <4 x float> @llvm.experimental.constrained.nearbyint.v4f32(<4 x float>, metadata, metadata)14declare <4 x float> @llvm.experimental.constrained.floor.v4f32(<4 x float>, metadata)15declare <4 x float> @llvm.experimental.constrained.ceil.v4f32(<4 x float>, metadata)16declare <4 x float> @llvm.experimental.constrained.trunc.v4f32(<4 x float>, metadata)17declare <4 x float> @llvm.experimental.constrained.round.v4f32(<4 x float>, metadata)18declare <4 x float> @llvm.experimental.constrained.roundeven.v4f32(<4 x float>, metadata)19 20define <4 x float> @f1(<4 x float> %val) #0 {21; CHECK-LABEL: f1:22; CHECK: vfisb %v24, %v24, 0, 023; CHECK: br %r1424 %res = call <4 x float> @llvm.experimental.constrained.rint.v4f32(25 <4 x float> %val,26 metadata !"round.dynamic",27 metadata !"fpexcept.strict") #028 ret <4 x float> %res29}30 31define <4 x float> @f2(<4 x float> %val) #0 {32; CHECK-LABEL: f2:33; CHECK: vfisb %v24, %v24, 4, 034; CHECK: br %r1435 %res = call <4 x float> @llvm.experimental.constrained.nearbyint.v4f32(36 <4 x float> %val,37 metadata !"round.dynamic",38 metadata !"fpexcept.strict") #039 ret <4 x float> %res40}41 42define <4 x float> @f3(<4 x float> %val) #0 {43; CHECK-LABEL: f3:44; CHECK: vfisb %v24, %v24, 4, 745; CHECK: br %r1446 %res = call <4 x float> @llvm.experimental.constrained.floor.v4f32(47 <4 x float> %val,48 metadata !"fpexcept.strict") #049 ret <4 x float> %res50}51 52define <4 x float> @f4(<4 x float> %val) #0 {53; CHECK-LABEL: f4:54; CHECK: vfisb %v24, %v24, 4, 655; CHECK: br %r1456 %res = call <4 x float> @llvm.experimental.constrained.ceil.v4f32(57 <4 x float> %val,58 metadata !"fpexcept.strict") #059 ret <4 x float> %res60}61 62define <4 x float> @f5(<4 x float> %val) #0 {63; CHECK-LABEL: f5:64; CHECK: vfisb %v24, %v24, 4, 565; CHECK: br %r1466 %res = call <4 x float> @llvm.experimental.constrained.trunc.v4f32(67 <4 x float> %val,68 metadata !"fpexcept.strict") #069 ret <4 x float> %res70}71 72define <4 x float> @f6(<4 x float> %val) #0 {73; CHECK-LABEL: f6:74; CHECK: vfisb %v24, %v24, 4, 175; CHECK: br %r1476 %res = call <4 x float> @llvm.experimental.constrained.round.v4f32(77 <4 x float> %val,78 metadata !"fpexcept.strict") #079 ret <4 x float> %res80}81 82define <4 x float> @f7(<4 x float> %val) #0 {83; CHECK-LABEL: f7:84; CHECK: vfisb %v24, %v24, 4, 485; CHECK: br %r1486 %res = call <4 x float> @llvm.experimental.constrained.roundeven.v4f32(87 <4 x float> %val,88 metadata !"fpexcept.strict") #089 ret <4 x float> %res90}91 92define float @f8(<4 x float> %val) #0 {93; CHECK-LABEL: f8:94; CHECK: wfisb %f0, %v24, 0, 095; CHECK: br %r1496 %scalar = extractelement <4 x float> %val, i32 097 %res = call float @llvm.experimental.constrained.rint.f32(98 float %scalar,99 metadata !"round.dynamic",100 metadata !"fpexcept.strict") #0101 ret float %res102}103 104define float @f9(<4 x float> %val) #0 {105; CHECK-LABEL: f9:106; CHECK: wfisb %f0, %v24, 4, 0107; CHECK: br %r14108 %scalar = extractelement <4 x float> %val, i32 0109 %res = call float @llvm.experimental.constrained.nearbyint.f32(110 float %scalar,111 metadata !"round.dynamic",112 metadata !"fpexcept.strict") #0113 ret float %res114}115 116define float @f10(<4 x float> %val) #0 {117; CHECK-LABEL: f10:118; CHECK: wfisb %f0, %v24, 4, 7119; CHECK: br %r14120 %scalar = extractelement <4 x float> %val, i32 0121 %res = call float @llvm.experimental.constrained.floor.f32(122 float %scalar,123 metadata !"fpexcept.strict") #0124 ret float %res125}126 127define float @f11(<4 x float> %val) #0 {128; CHECK-LABEL: f11:129; CHECK: wfisb %f0, %v24, 4, 6130; CHECK: br %r14131 %scalar = extractelement <4 x float> %val, i32 0132 %res = call float @llvm.experimental.constrained.ceil.f32(133 float %scalar,134 metadata !"fpexcept.strict") #0135 ret float %res136}137 138define float @f12(<4 x float> %val) #0 {139; CHECK-LABEL: f12:140; CHECK: wfisb %f0, %v24, 4, 5141; CHECK: br %r14142 %scalar = extractelement <4 x float> %val, i32 0143 %res = call float @llvm.experimental.constrained.trunc.f32(144 float %scalar,145 metadata !"fpexcept.strict") #0146 ret float %res147}148 149define float @f13(<4 x float> %val) #0 {150; CHECK-LABEL: f13:151; CHECK: wfisb %f0, %v24, 4, 1152; CHECK: br %r14153 %scalar = extractelement <4 x float> %val, i32 0154 %res = call float @llvm.experimental.constrained.round.f32(155 float %scalar,156 metadata !"fpexcept.strict") #0157 ret float %res158}159 160define float @f14(<4 x float> %val) #0 {161; CHECK-LABEL: f14:162; CHECK: wfisb %f0, %v24, 4, 4163; CHECK: br %r14164 %scalar = extractelement <4 x float> %val, i32 0165 %res = call float @llvm.experimental.constrained.roundeven.f32(166 float %scalar,167 metadata !"fpexcept.strict") #0168 ret float %res169}170 171attributes #0 = { strictfp }172