annotate test/CodeGen/SystemZ/vec-max-05.ll @ 128:c347d3398279 default tip

fix
author mir3636
date Wed, 06 Dec 2017 14:37:17 +0900
parents 803732b1fca8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1 ; Test vector maximum on z14.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
2 ;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z14 | FileCheck %s
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
5 declare double @fmax(double, double)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
6 declare double @llvm.maxnum.f64(double, double)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
7 declare <2 x double> @llvm.maxnum.v2f64(<2 x double>, <2 x double>)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
8
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
9 declare float @fmaxf(float, float)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
10 declare float @llvm.maxnum.f32(float, float)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
11 declare <4 x float> @llvm.maxnum.v4f32(<4 x float>, <4 x float>)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
12
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
13 declare fp128 @fmaxl(fp128, fp128)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
14 declare fp128 @llvm.maxnum.f128(fp128, fp128)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
15
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
16 ; Test the fmax library function.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
17 define double @f1(double %dummy, double %val1, double %val2) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
18 ; CHECK-LABEL: f1:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
19 ; CHECK: wfmaxdb %f0, %f2, %f4, 4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
20 ; CHECK: br %r14
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
21 %ret = call double @fmax(double %val1, double %val2) readnone
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
22 ret double %ret
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
23 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
24
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
25 ; Test the f64 maxnum intrinsic.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
26 define double @f2(double %dummy, double %val1, double %val2) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
27 ; CHECK-LABEL: f2:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
28 ; CHECK: wfmaxdb %f0, %f2, %f4, 4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
29 ; CHECK: br %r14
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
30 %ret = call double @llvm.maxnum.f64(double %val1, double %val2)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
31 ret double %ret
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
32 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
33
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
34 ; Test a f64 constant compare/select resulting in maxnum.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
35 define double @f3(double %dummy, double %val) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
36 ; CHECK-LABEL: f3:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
37 ; CHECK: lzdr [[REG:%f[0-9]+]]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
38 ; CHECK: wfmaxdb %f0, %f2, [[REG]], 4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
39 ; CHECK: br %r14
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
40 %cmp = fcmp ogt double %val, 0.0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
41 %ret = select i1 %cmp, double %val, double 0.0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
42 ret double %ret
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
43 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
44
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
45 ; Test a f64 constant compare/select resulting in maxnan.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
46 define double @f4(double %dummy, double %val) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
47 ; CHECK-LABEL: f4:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
48 ; CHECK: lzdr [[REG:%f[0-9]+]]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
49 ; CHECK: wfmaxdb %f0, %f2, [[REG]], 1
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
50 ; CHECK: br %r14
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
51 %cmp = fcmp ugt double %val, 0.0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
52 %ret = select i1 %cmp, double %val, double 0.0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
53 ret double %ret
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
54 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
55
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
56 ; Test the v2f64 maxnum intrinsic.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
57 define <2 x double> @f5(<2 x double> %dummy, <2 x double> %val1,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
58 <2 x double> %val2) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
59 ; CHECK-LABEL: f5:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
60 ; CHECK: vfmaxdb %v24, %v26, %v28, 4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
61 ; CHECK: br %r14
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
62 %ret = call <2 x double> @llvm.maxnum.v2f64(<2 x double> %val1, <2 x double> %val2)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
63 ret <2 x double> %ret
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
64 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
65
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
66 ; Test the fmaxf library function.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
67 define float @f11(float %dummy, float %val1, float %val2) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
68 ; CHECK-LABEL: f11:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
69 ; CHECK: wfmaxsb %f0, %f2, %f4, 4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
70 ; CHECK: br %r14
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
71 %ret = call float @fmaxf(float %val1, float %val2) readnone
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
72 ret float %ret
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
73 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
74
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
75 ; Test the f32 maxnum intrinsic.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
76 define float @f12(float %dummy, float %val1, float %val2) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
77 ; CHECK-LABEL: f12:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
78 ; CHECK: wfmaxsb %f0, %f2, %f4, 4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
79 ; CHECK: br %r14
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
80 %ret = call float @llvm.maxnum.f32(float %val1, float %val2)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
81 ret float %ret
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
82 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
83
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
84 ; Test a f32 constant compare/select resulting in maxnum.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
85 define float @f13(float %dummy, float %val) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
86 ; CHECK-LABEL: f13:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
87 ; CHECK: lzer [[REG:%f[0-9]+]]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
88 ; CHECK: wfmaxsb %f0, %f2, [[REG]], 4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
89 ; CHECK: br %r14
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
90 %cmp = fcmp ogt float %val, 0.0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
91 %ret = select i1 %cmp, float %val, float 0.0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
92 ret float %ret
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
93 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
94
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
95 ; Test a f32 constant compare/select resulting in maxnan.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
96 define float @f14(float %dummy, float %val) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
97 ; CHECK-LABEL: f14:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
98 ; CHECK: lzer [[REG:%f[0-9]+]]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
99 ; CHECK: wfmaxsb %f0, %f2, [[REG]], 1
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
100 ; CHECK: br %r14
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
101 %cmp = fcmp ugt float %val, 0.0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
102 %ret = select i1 %cmp, float %val, float 0.0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
103 ret float %ret
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
104 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
105
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
106 ; Test the v4f32 maxnum intrinsic.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
107 define <4 x float> @f15(<4 x float> %dummy, <4 x float> %val1,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
108 <4 x float> %val2) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
109 ; CHECK-LABEL: f15:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
110 ; CHECK: vfmaxsb %v24, %v26, %v28, 4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
111 ; CHECK: br %r14
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
112 %ret = call <4 x float> @llvm.maxnum.v4f32(<4 x float> %val1, <4 x float> %val2)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
113 ret <4 x float> %ret
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
114 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
115
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
116 ; Test the fmaxl library function.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
117 define void @f21(fp128 *%ptr1, fp128 *%ptr2, fp128 *%dst) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
118 ; CHECK-LABEL: f21:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
119 ; CHECK-DAG: vl [[REG1:%v[0-9]+]], 0(%r2)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
120 ; CHECK-DAG: vl [[REG2:%v[0-9]+]], 0(%r3)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
121 ; CHECK: wfmaxxb [[RES:%v[0-9]+]], [[REG1]], [[REG2]], 4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
122 ; CHECK: vst [[RES]], 0(%r4)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
123 ; CHECK: br %r14
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
124 %val1 = load fp128, fp128* %ptr1
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
125 %val2 = load fp128, fp128* %ptr2
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
126 %res = call fp128 @fmaxl(fp128 %val1, fp128 %val2) readnone
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
127 store fp128 %res, fp128* %dst
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
128 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
129 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
130
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
131 ; Test the f128 maxnum intrinsic.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
132 define void @f22(fp128 *%ptr1, fp128 *%ptr2, fp128 *%dst) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
133 ; CHECK-LABEL: f22:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
134 ; CHECK-DAG: vl [[REG1:%v[0-9]+]], 0(%r2)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
135 ; CHECK-DAG: vl [[REG2:%v[0-9]+]], 0(%r3)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
136 ; CHECK: wfmaxxb [[RES:%v[0-9]+]], [[REG1]], [[REG2]], 4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
137 ; CHECK: vst [[RES]], 0(%r4)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
138 ; CHECK: br %r14
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
139 %val1 = load fp128, fp128* %ptr1
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
140 %val2 = load fp128, fp128* %ptr2
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
141 %res = call fp128 @llvm.maxnum.f128(fp128 %val1, fp128 %val2)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
142 store fp128 %res, fp128* %dst
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
143 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
144 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
145
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
146 ; Test a f128 constant compare/select resulting in maxnum.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
147 define void @f23(fp128 *%ptr, fp128 *%dst) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
148 ; CHECK-LABEL: f23:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
149 ; CHECK-DAG: vl [[REG1:%v[0-9]+]], 0(%r2)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
150 ; CHECK-DAG: vzero [[REG2:%v[0-9]+]]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
151 ; CHECK: wfmaxxb [[RES:%v[0-9]+]], [[REG1]], [[REG2]], 4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
152 ; CHECK: vst [[RES]], 0(%r3)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
153 ; CHECK: br %r14
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
154 %val = load fp128, fp128* %ptr
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
155 %cmp = fcmp ogt fp128 %val, 0xL00000000000000000000000000000000
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
156 %res = select i1 %cmp, fp128 %val, fp128 0xL00000000000000000000000000000000
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
157 store fp128 %res, fp128* %dst
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
158 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
159 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
160
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
161 ; Test a f128 constant compare/select resulting in maxnan.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
162 define void @f24(fp128 *%ptr, fp128 *%dst) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
163 ; CHECK-LABEL: f24:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
164 ; CHECK-DAG: vl [[REG1:%v[0-9]+]], 0(%r2)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
165 ; CHECK-DAG: vzero [[REG2:%v[0-9]+]]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
166 ; CHECK: wfmaxxb [[RES:%v[0-9]+]], [[REG1]], [[REG2]], 1
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
167 ; CHECK: vst [[RES]], 0(%r3)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
168 ; CHECK: br %r14
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
169 %val = load fp128, fp128* %ptr
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
170 %cmp = fcmp ugt fp128 %val, 0xL00000000000000000000000000000000
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
171 %res = select i1 %cmp, fp128 %val, fp128 0xL00000000000000000000000000000000
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
172 store fp128 %res, fp128* %dst
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
173 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
174 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
175