1 ; RUN: llc < %s -mtriple=ve -mattr=+vpu | FileCheck %s
3 ;;; Test vector floating compare and select maximum intrinsic instructions
6 ;;; We test VFMAX*vvl, VFMAX*vvl_v, VFMAX*rvl, VFMAX*rvl_v, VFMAX*vvml_v,
7 ;;; VFMAX*rvml_v, PVFMAX*vvl, PVFMAX*vvl_v, PVFMAX*rvl, PVFMAX*rvl_v,
8 ;;; PVFMAX*vvml_v, and PVFMAX*rvml_v instructions.
10 ; Function Attrs: nounwind readnone
11 define fastcc <256 x double> @vfmaxd_vvvl(<256 x double> %0, <256 x double> %1) {
12 ; CHECK-LABEL: vfmaxd_vvvl:
14 ; CHECK-NEXT: lea %s0, 256
16 ; CHECK-NEXT: vfmax.d %v0, %v0, %v1
17 ; CHECK-NEXT: b.l.t (, %s10)
18 %3 = tail call fast <256 x double> @llvm.ve.vl.vfmaxd.vvvl(<256 x double> %0, <256 x double> %1, i32 256)
22 ; Function Attrs: nounwind readnone
23 declare <256 x double> @llvm.ve.vl.vfmaxd.vvvl(<256 x double>, <256 x double>, i32)
25 ; Function Attrs: nounwind readnone
26 define fastcc <256 x double> @vfmaxd_vvvvl(<256 x double> %0, <256 x double> %1, <256 x double> %2) {
27 ; CHECK-LABEL: vfmaxd_vvvvl:
29 ; CHECK-NEXT: lea %s0, 128
31 ; CHECK-NEXT: vfmax.d %v2, %v0, %v1
32 ; CHECK-NEXT: lea %s16, 256
33 ; CHECK-NEXT: lvl %s16
34 ; CHECK-NEXT: vor %v0, (0)1, %v2
35 ; CHECK-NEXT: b.l.t (, %s10)
36 %4 = tail call fast <256 x double> @llvm.ve.vl.vfmaxd.vvvvl(<256 x double> %0, <256 x double> %1, <256 x double> %2, i32 128)
40 ; Function Attrs: nounwind readnone
41 declare <256 x double> @llvm.ve.vl.vfmaxd.vvvvl(<256 x double>, <256 x double>, <256 x double>, i32)
43 ; Function Attrs: nounwind readnone
44 define fastcc <256 x double> @vfmaxd_vsvl(double %0, <256 x double> %1) {
45 ; CHECK-LABEL: vfmaxd_vsvl:
47 ; CHECK-NEXT: lea %s1, 256
49 ; CHECK-NEXT: vfmax.d %v0, %s0, %v0
50 ; CHECK-NEXT: b.l.t (, %s10)
51 %3 = tail call fast <256 x double> @llvm.ve.vl.vfmaxd.vsvl(double %0, <256 x double> %1, i32 256)
55 ; Function Attrs: nounwind readnone
56 declare <256 x double> @llvm.ve.vl.vfmaxd.vsvl(double, <256 x double>, i32)
58 ; Function Attrs: nounwind readnone
59 define fastcc <256 x double> @vfmaxd_vsvvl(double %0, <256 x double> %1, <256 x double> %2) {
60 ; CHECK-LABEL: vfmaxd_vsvvl:
62 ; CHECK-NEXT: lea %s1, 128
64 ; CHECK-NEXT: vfmax.d %v1, %s0, %v0
65 ; CHECK-NEXT: lea %s16, 256
66 ; CHECK-NEXT: lvl %s16
67 ; CHECK-NEXT: vor %v0, (0)1, %v1
68 ; CHECK-NEXT: b.l.t (, %s10)
69 %4 = tail call fast <256 x double> @llvm.ve.vl.vfmaxd.vsvvl(double %0, <256 x double> %1, <256 x double> %2, i32 128)
73 ; Function Attrs: nounwind readnone
74 declare <256 x double> @llvm.ve.vl.vfmaxd.vsvvl(double, <256 x double>, <256 x double>, i32)
76 ; Function Attrs: nounwind readnone
77 define fastcc <256 x double> @vfmaxd_vvvmvl(<256 x double> %0, <256 x double> %1, <256 x i1> %2, <256 x double> %3) {
78 ; CHECK-LABEL: vfmaxd_vvvmvl:
80 ; CHECK-NEXT: lea %s0, 128
82 ; CHECK-NEXT: vfmax.d %v2, %v0, %v1, %vm1
83 ; CHECK-NEXT: lea %s16, 256
84 ; CHECK-NEXT: lvl %s16
85 ; CHECK-NEXT: vor %v0, (0)1, %v2
86 ; CHECK-NEXT: b.l.t (, %s10)
87 %5 = tail call fast <256 x double> @llvm.ve.vl.vfmaxd.vvvmvl(<256 x double> %0, <256 x double> %1, <256 x i1> %2, <256 x double> %3, i32 128)
91 ; Function Attrs: nounwind readnone
92 declare <256 x double> @llvm.ve.vl.vfmaxd.vvvmvl(<256 x double>, <256 x double>, <256 x i1>, <256 x double>, i32)
94 ; Function Attrs: nounwind readnone
95 define fastcc <256 x double> @vfmaxd_vsvmvl(double %0, <256 x double> %1, <256 x i1> %2, <256 x double> %3) {
96 ; CHECK-LABEL: vfmaxd_vsvmvl:
98 ; CHECK-NEXT: lea %s1, 128
100 ; CHECK-NEXT: vfmax.d %v1, %s0, %v0, %vm1
101 ; CHECK-NEXT: lea %s16, 256
102 ; CHECK-NEXT: lvl %s16
103 ; CHECK-NEXT: vor %v0, (0)1, %v1
104 ; CHECK-NEXT: b.l.t (, %s10)
105 %5 = tail call fast <256 x double> @llvm.ve.vl.vfmaxd.vsvmvl(double %0, <256 x double> %1, <256 x i1> %2, <256 x double> %3, i32 128)
106 ret <256 x double> %5
109 ; Function Attrs: nounwind readnone
110 declare <256 x double> @llvm.ve.vl.vfmaxd.vsvmvl(double, <256 x double>, <256 x i1>, <256 x double>, i32)
112 ; Function Attrs: nounwind readnone
113 define fastcc <256 x double> @vfmaxs_vvvl(<256 x double> %0, <256 x double> %1) {
114 ; CHECK-LABEL: vfmaxs_vvvl:
116 ; CHECK-NEXT: lea %s0, 256
117 ; CHECK-NEXT: lvl %s0
118 ; CHECK-NEXT: vfmax.s %v0, %v0, %v1
119 ; CHECK-NEXT: b.l.t (, %s10)
120 %3 = tail call fast <256 x double> @llvm.ve.vl.vfmaxs.vvvl(<256 x double> %0, <256 x double> %1, i32 256)
121 ret <256 x double> %3
124 ; Function Attrs: nounwind readnone
125 declare <256 x double> @llvm.ve.vl.vfmaxs.vvvl(<256 x double>, <256 x double>, i32)
127 ; Function Attrs: nounwind readnone
128 define fastcc <256 x double> @vfmaxs_vvvvl(<256 x double> %0, <256 x double> %1, <256 x double> %2) {
129 ; CHECK-LABEL: vfmaxs_vvvvl:
131 ; CHECK-NEXT: lea %s0, 128
132 ; CHECK-NEXT: lvl %s0
133 ; CHECK-NEXT: vfmax.s %v2, %v0, %v1
134 ; CHECK-NEXT: lea %s16, 256
135 ; CHECK-NEXT: lvl %s16
136 ; CHECK-NEXT: vor %v0, (0)1, %v2
137 ; CHECK-NEXT: b.l.t (, %s10)
138 %4 = tail call fast <256 x double> @llvm.ve.vl.vfmaxs.vvvvl(<256 x double> %0, <256 x double> %1, <256 x double> %2, i32 128)
139 ret <256 x double> %4
142 ; Function Attrs: nounwind readnone
143 declare <256 x double> @llvm.ve.vl.vfmaxs.vvvvl(<256 x double>, <256 x double>, <256 x double>, i32)
145 ; Function Attrs: nounwind readnone
146 define fastcc <256 x double> @vfmaxs_vsvl(float %0, <256 x double> %1) {
147 ; CHECK-LABEL: vfmaxs_vsvl:
149 ; CHECK-NEXT: lea %s1, 256
150 ; CHECK-NEXT: lvl %s1
151 ; CHECK-NEXT: vfmax.s %v0, %s0, %v0
152 ; CHECK-NEXT: b.l.t (, %s10)
153 %3 = tail call fast <256 x double> @llvm.ve.vl.vfmaxs.vsvl(float %0, <256 x double> %1, i32 256)
154 ret <256 x double> %3
157 ; Function Attrs: nounwind readnone
158 declare <256 x double> @llvm.ve.vl.vfmaxs.vsvl(float, <256 x double>, i32)
160 ; Function Attrs: nounwind readnone
161 define fastcc <256 x double> @vfmaxs_vsvvl(float %0, <256 x double> %1, <256 x double> %2) {
162 ; CHECK-LABEL: vfmaxs_vsvvl:
164 ; CHECK-NEXT: lea %s1, 128
165 ; CHECK-NEXT: lvl %s1
166 ; CHECK-NEXT: vfmax.s %v1, %s0, %v0
167 ; CHECK-NEXT: lea %s16, 256
168 ; CHECK-NEXT: lvl %s16
169 ; CHECK-NEXT: vor %v0, (0)1, %v1
170 ; CHECK-NEXT: b.l.t (, %s10)
171 %4 = tail call fast <256 x double> @llvm.ve.vl.vfmaxs.vsvvl(float %0, <256 x double> %1, <256 x double> %2, i32 128)
172 ret <256 x double> %4
175 ; Function Attrs: nounwind readnone
176 declare <256 x double> @llvm.ve.vl.vfmaxs.vsvvl(float, <256 x double>, <256 x double>, i32)
178 ; Function Attrs: nounwind readnone
179 define fastcc <256 x double> @vfmaxs_vvvmvl(<256 x double> %0, <256 x double> %1, <256 x i1> %2, <256 x double> %3) {
180 ; CHECK-LABEL: vfmaxs_vvvmvl:
182 ; CHECK-NEXT: lea %s0, 128
183 ; CHECK-NEXT: lvl %s0
184 ; CHECK-NEXT: vfmax.s %v2, %v0, %v1, %vm1
185 ; CHECK-NEXT: lea %s16, 256
186 ; CHECK-NEXT: lvl %s16
187 ; CHECK-NEXT: vor %v0, (0)1, %v2
188 ; CHECK-NEXT: b.l.t (, %s10)
189 %5 = tail call fast <256 x double> @llvm.ve.vl.vfmaxs.vvvmvl(<256 x double> %0, <256 x double> %1, <256 x i1> %2, <256 x double> %3, i32 128)
190 ret <256 x double> %5
193 ; Function Attrs: nounwind readnone
194 declare <256 x double> @llvm.ve.vl.vfmaxs.vvvmvl(<256 x double>, <256 x double>, <256 x i1>, <256 x double>, i32)
196 ; Function Attrs: nounwind readnone
197 define fastcc <256 x double> @vfmaxs_vsvmvl(float %0, <256 x double> %1, <256 x i1> %2, <256 x double> %3) {
198 ; CHECK-LABEL: vfmaxs_vsvmvl:
200 ; CHECK-NEXT: lea %s1, 128
201 ; CHECK-NEXT: lvl %s1
202 ; CHECK-NEXT: vfmax.s %v1, %s0, %v0, %vm1
203 ; CHECK-NEXT: lea %s16, 256
204 ; CHECK-NEXT: lvl %s16
205 ; CHECK-NEXT: vor %v0, (0)1, %v1
206 ; CHECK-NEXT: b.l.t (, %s10)
207 %5 = tail call fast <256 x double> @llvm.ve.vl.vfmaxs.vsvmvl(float %0, <256 x double> %1, <256 x i1> %2, <256 x double> %3, i32 128)
208 ret <256 x double> %5
211 ; Function Attrs: nounwind readnone
212 declare <256 x double> @llvm.ve.vl.vfmaxs.vsvmvl(float, <256 x double>, <256 x i1>, <256 x double>, i32)
214 ; Function Attrs: nounwind readnone
215 define fastcc <256 x double> @pvfmax_vvvl(<256 x double> %0, <256 x double> %1) {
216 ; CHECK-LABEL: pvfmax_vvvl:
218 ; CHECK-NEXT: lea %s0, 256
219 ; CHECK-NEXT: lvl %s0
220 ; CHECK-NEXT: pvfmax %v0, %v0, %v1
221 ; CHECK-NEXT: b.l.t (, %s10)
222 %3 = tail call fast <256 x double> @llvm.ve.vl.pvfmax.vvvl(<256 x double> %0, <256 x double> %1, i32 256)
223 ret <256 x double> %3
226 ; Function Attrs: nounwind readnone
227 declare <256 x double> @llvm.ve.vl.pvfmax.vvvl(<256 x double>, <256 x double>, i32)
229 ; Function Attrs: nounwind readnone
230 define fastcc <256 x double> @pvfmax_vvvvl(<256 x double> %0, <256 x double> %1, <256 x double> %2) {
231 ; CHECK-LABEL: pvfmax_vvvvl:
233 ; CHECK-NEXT: lea %s0, 128
234 ; CHECK-NEXT: lvl %s0
235 ; CHECK-NEXT: pvfmax %v2, %v0, %v1
236 ; CHECK-NEXT: lea %s16, 256
237 ; CHECK-NEXT: lvl %s16
238 ; CHECK-NEXT: vor %v0, (0)1, %v2
239 ; CHECK-NEXT: b.l.t (, %s10)
240 %4 = tail call fast <256 x double> @llvm.ve.vl.pvfmax.vvvvl(<256 x double> %0, <256 x double> %1, <256 x double> %2, i32 128)
241 ret <256 x double> %4
244 ; Function Attrs: nounwind readnone
245 declare <256 x double> @llvm.ve.vl.pvfmax.vvvvl(<256 x double>, <256 x double>, <256 x double>, i32)
247 ; Function Attrs: nounwind readnone
248 define fastcc <256 x double> @pvfmax_vsvl(i64 %0, <256 x double> %1) {
249 ; CHECK-LABEL: pvfmax_vsvl:
251 ; CHECK-NEXT: lea %s1, 256
252 ; CHECK-NEXT: lvl %s1
253 ; CHECK-NEXT: pvfmax %v0, %s0, %v0
254 ; CHECK-NEXT: b.l.t (, %s10)
255 %3 = tail call fast <256 x double> @llvm.ve.vl.pvfmax.vsvl(i64 %0, <256 x double> %1, i32 256)
256 ret <256 x double> %3
259 ; Function Attrs: nounwind readnone
260 declare <256 x double> @llvm.ve.vl.pvfmax.vsvl(i64, <256 x double>, i32)
262 ; Function Attrs: nounwind readnone
263 define fastcc <256 x double> @pvfmax_vsvvl(i64 %0, <256 x double> %1, <256 x double> %2) {
264 ; CHECK-LABEL: pvfmax_vsvvl:
266 ; CHECK-NEXT: lea %s1, 128
267 ; CHECK-NEXT: lvl %s1
268 ; CHECK-NEXT: pvfmax %v1, %s0, %v0
269 ; CHECK-NEXT: lea %s16, 256
270 ; CHECK-NEXT: lvl %s16
271 ; CHECK-NEXT: vor %v0, (0)1, %v1
272 ; CHECK-NEXT: b.l.t (, %s10)
273 %4 = tail call fast <256 x double> @llvm.ve.vl.pvfmax.vsvvl(i64 %0, <256 x double> %1, <256 x double> %2, i32 128)
274 ret <256 x double> %4
277 ; Function Attrs: nounwind readnone
278 declare <256 x double> @llvm.ve.vl.pvfmax.vsvvl(i64, <256 x double>, <256 x double>, i32)
280 ; Function Attrs: nounwind readnone
281 define fastcc <256 x double> @pvfmax_vvvMvl(<256 x double> %0, <256 x double> %1, <512 x i1> %2, <256 x double> %3) {
282 ; CHECK-LABEL: pvfmax_vvvMvl:
284 ; CHECK-NEXT: lea %s0, 128
285 ; CHECK-NEXT: lvl %s0
286 ; CHECK-NEXT: pvfmax %v2, %v0, %v1, %vm2
287 ; CHECK-NEXT: lea %s16, 256
288 ; CHECK-NEXT: lvl %s16
289 ; CHECK-NEXT: vor %v0, (0)1, %v2
290 ; CHECK-NEXT: b.l.t (, %s10)
291 %5 = tail call fast <256 x double> @llvm.ve.vl.pvfmax.vvvMvl(<256 x double> %0, <256 x double> %1, <512 x i1> %2, <256 x double> %3, i32 128)
292 ret <256 x double> %5
295 ; Function Attrs: nounwind readnone
296 declare <256 x double> @llvm.ve.vl.pvfmax.vvvMvl(<256 x double>, <256 x double>, <512 x i1>, <256 x double>, i32)
298 ; Function Attrs: nounwind readnone
299 define fastcc <256 x double> @pvfmax_vsvMvl(i64 %0, <256 x double> %1, <512 x i1> %2, <256 x double> %3) {
300 ; CHECK-LABEL: pvfmax_vsvMvl:
302 ; CHECK-NEXT: lea %s1, 128
303 ; CHECK-NEXT: lvl %s1
304 ; CHECK-NEXT: pvfmax %v1, %s0, %v0, %vm2
305 ; CHECK-NEXT: lea %s16, 256
306 ; CHECK-NEXT: lvl %s16
307 ; CHECK-NEXT: vor %v0, (0)1, %v1
308 ; CHECK-NEXT: b.l.t (, %s10)
309 %5 = tail call fast <256 x double> @llvm.ve.vl.pvfmax.vsvMvl(i64 %0, <256 x double> %1, <512 x i1> %2, <256 x double> %3, i32 128)
310 ret <256 x double> %5
313 ; Function Attrs: nounwind readnone
314 declare <256 x double> @llvm.ve.vl.pvfmax.vsvMvl(i64, <256 x double>, <512 x i1>, <256 x double>, i32)