1 ; Test strict vector minimum on z14.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z14 | FileCheck %s
5 declare double @llvm.experimental.constrained.minnum.f64(double, double, metadata)
6 declare <2 x double> @llvm.experimental.constrained.minnum.v2f64(<2 x double>, <2 x double>, metadata)
7 declare double @llvm.experimental.constrained.minimum.f64(double, double, metadata)
8 declare <2 x double> @llvm.experimental.constrained.minimum.v2f64(<2 x double>, <2 x double>, metadata)
10 declare float @llvm.experimental.constrained.minnum.f32(float, float, metadata)
11 declare <4 x float> @llvm.experimental.constrained.minnum.v4f32(<4 x float>, <4 x float>, metadata)
12 declare float @llvm.experimental.constrained.minimum.f32(float, float, metadata)
13 declare <4 x float> @llvm.experimental.constrained.minimum.v4f32(<4 x float>, <4 x float>, metadata)
15 declare fp128 @llvm.experimental.constrained.minnum.f128(fp128, fp128, metadata)
16 declare fp128 @llvm.experimental.constrained.minimum.f128(fp128, fp128, metadata)
18 ; Test the f64 minnum intrinsic.
19 define double @f1(double %dummy, double %val1, double %val2) #0 {
21 ; CHECK: wfmindb %f0, %f2, %f4, 4
23 %ret = call double @llvm.experimental.constrained.minnum.f64(
24 double %val1, double %val2,
25 metadata !"fpexcept.strict") #0
29 ; Test the v2f64 minnum intrinsic.
30 define <2 x double> @f2(<2 x double> %dummy, <2 x double> %val1,
31 <2 x double> %val2) #0 {
33 ; CHECK: vfmindb %v24, %v26, %v28, 4
35 %ret = call <2 x double> @llvm.experimental.constrained.minnum.v2f64(
36 <2 x double> %val1, <2 x double> %val2,
37 metadata !"fpexcept.strict") #0
41 ; Test the f32 minnum intrinsic.
42 define float @f3(float %dummy, float %val1, float %val2) #0 {
44 ; CHECK: wfminsb %f0, %f2, %f4, 4
46 %ret = call float @llvm.experimental.constrained.minnum.f32(
47 float %val1, float %val2,
48 metadata !"fpexcept.strict") #0
52 ; Test the v4f32 minnum intrinsic.
53 define <4 x float> @f4(<4 x float> %dummy, <4 x float> %val1,
54 <4 x float> %val2) #0 {
56 ; CHECK: vfminsb %v24, %v26, %v28, 4
58 %ret = call <4 x float> @llvm.experimental.constrained.minnum.v4f32(
59 <4 x float> %val1, <4 x float> %val2,
60 metadata !"fpexcept.strict") #0
64 ; Test the f128 minnum intrinsic.
65 define void @f5(ptr %ptr1, ptr %ptr2, ptr %dst) #0 {
67 ; CHECK-DAG: vl [[REG1:%v[0-9]+]], 0(%r2)
68 ; CHECK-DAG: vl [[REG2:%v[0-9]+]], 0(%r3)
69 ; CHECK: wfminxb [[RES:%v[0-9]+]], [[REG1]], [[REG2]], 4
70 ; CHECK: vst [[RES]], 0(%r4)
72 %val1 = load fp128, ptr %ptr1
73 %val2 = load fp128, ptr %ptr2
74 %res = call fp128 @llvm.experimental.constrained.minnum.f128(
75 fp128 %val1, fp128 %val2,
76 metadata !"fpexcept.strict") #0
77 store fp128 %res, ptr %dst
81 ; Test the f64 minimum intrinsic.
82 define double @f11(double %dummy, double %val1, double %val2) #0 {
84 ; CHECK: wfmindb %f0, %f2, %f4, 1
86 %ret = call double @llvm.experimental.constrained.minimum.f64(
87 double %val1, double %val2,
88 metadata !"fpexcept.strict") #0
92 ; Test the v2f64 minimum intrinsic.
93 define <2 x double> @f12(<2 x double> %dummy, <2 x double> %val1,
94 <2 x double> %val2) #0 {
96 ; CHECK: vfmindb %v24, %v26, %v28, 1
98 %ret = call <2 x double> @llvm.experimental.constrained.minimum.v2f64(
99 <2 x double> %val1, <2 x double> %val2,
100 metadata !"fpexcept.strict") #0
101 ret <2 x double> %ret
104 ; Test the f32 minimum intrinsic.
105 define float @f13(float %dummy, float %val1, float %val2) #0 {
107 ; CHECK: wfminsb %f0, %f2, %f4, 1
109 %ret = call float @llvm.experimental.constrained.minimum.f32(
110 float %val1, float %val2,
111 metadata !"fpexcept.strict") #0
115 ; Test the v4f32 minimum intrinsic.
116 define <4 x float> @f14(<4 x float> %dummy, <4 x float> %val1,
117 <4 x float> %val2) #0 {
119 ; CHECK: vfminsb %v24, %v26, %v28, 1
121 %ret = call <4 x float> @llvm.experimental.constrained.minimum.v4f32(
122 <4 x float> %val1, <4 x float> %val2,
123 metadata !"fpexcept.strict") #0
127 ; Test the f128 minimum intrinsic.
128 define void @f15(ptr %ptr1, ptr %ptr2, ptr %dst) #0 {
130 ; CHECK-DAG: vl [[REG1:%v[0-9]+]], 0(%r2)
131 ; CHECK-DAG: vl [[REG2:%v[0-9]+]], 0(%r3)
132 ; CHECK: wfminxb [[RES:%v[0-9]+]], [[REG1]], [[REG2]], 1
133 ; CHECK: vst [[RES]], 0(%r4)
135 %val1 = load fp128, ptr %ptr1
136 %val2 = load fp128, ptr %ptr2
137 %res = call fp128 @llvm.experimental.constrained.minimum.f128(
138 fp128 %val1, fp128 %val2,
139 metadata !"fpexcept.strict") #0
140 store fp128 %res, ptr %dst
144 attributes #0 = { strictfp }