1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2 ; Test vector intrinsics.
4 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s
6 declare i32 @llvm.s390.lcbb(ptr, i32)
7 declare <16 x i8> @llvm.s390.vlbb(ptr, i32)
8 declare <16 x i8> @llvm.s390.vll(i32, ptr)
9 declare <2 x i64> @llvm.s390.vpdi(<2 x i64>, <2 x i64>, i32)
10 declare <16 x i8> @llvm.s390.vperm(<16 x i8>, <16 x i8>, <16 x i8>)
11 declare <16 x i8> @llvm.s390.vpksh(<8 x i16>, <8 x i16>)
12 declare <8 x i16> @llvm.s390.vpksf(<4 x i32>, <4 x i32>)
13 declare <4 x i32> @llvm.s390.vpksg(<2 x i64>, <2 x i64>)
14 declare {<16 x i8>, i32} @llvm.s390.vpkshs(<8 x i16>, <8 x i16>)
15 declare {<8 x i16>, i32} @llvm.s390.vpksfs(<4 x i32>, <4 x i32>)
16 declare {<4 x i32>, i32} @llvm.s390.vpksgs(<2 x i64>, <2 x i64>)
17 declare <16 x i8> @llvm.s390.vpklsh(<8 x i16>, <8 x i16>)
18 declare <8 x i16> @llvm.s390.vpklsf(<4 x i32>, <4 x i32>)
19 declare <4 x i32> @llvm.s390.vpklsg(<2 x i64>, <2 x i64>)
20 declare {<16 x i8>, i32} @llvm.s390.vpklshs(<8 x i16>, <8 x i16>)
21 declare {<8 x i16>, i32} @llvm.s390.vpklsfs(<4 x i32>, <4 x i32>)
22 declare {<4 x i32>, i32} @llvm.s390.vpklsgs(<2 x i64>, <2 x i64>)
23 declare void @llvm.s390.vstl(<16 x i8>, i32, ptr)
24 declare <8 x i16> @llvm.s390.vuphb(<16 x i8>)
25 declare <4 x i32> @llvm.s390.vuphh(<8 x i16>)
26 declare <2 x i64> @llvm.s390.vuphf(<4 x i32>)
27 declare <8 x i16> @llvm.s390.vuplhb(<16 x i8>)
28 declare <4 x i32> @llvm.s390.vuplhh(<8 x i16>)
29 declare <2 x i64> @llvm.s390.vuplhf(<4 x i32>)
30 declare <8 x i16> @llvm.s390.vuplb(<16 x i8>)
31 declare <4 x i32> @llvm.s390.vuplhw(<8 x i16>)
32 declare <2 x i64> @llvm.s390.vuplf(<4 x i32>)
33 declare <8 x i16> @llvm.s390.vupllb(<16 x i8>)
34 declare <4 x i32> @llvm.s390.vupllh(<8 x i16>)
35 declare <2 x i64> @llvm.s390.vupllf(<4 x i32>)
36 declare <16 x i8> @llvm.s390.vaccb(<16 x i8>, <16 x i8>)
37 declare <8 x i16> @llvm.s390.vacch(<8 x i16>, <8 x i16>)
38 declare <4 x i32> @llvm.s390.vaccf(<4 x i32>, <4 x i32>)
39 declare <2 x i64> @llvm.s390.vaccg(<2 x i64>, <2 x i64>)
40 declare i128 @llvm.s390.vaq(i128, i128)
41 declare i128 @llvm.s390.vacq(i128, i128, i128)
42 declare i128 @llvm.s390.vaccq(i128, i128)
43 declare i128 @llvm.s390.vacccq(i128, i128, i128)
44 declare <16 x i8> @llvm.s390.vavgb(<16 x i8>, <16 x i8>)
45 declare <8 x i16> @llvm.s390.vavgh(<8 x i16>, <8 x i16>)
46 declare <4 x i32> @llvm.s390.vavgf(<4 x i32>, <4 x i32>)
47 declare <2 x i64> @llvm.s390.vavgg(<2 x i64>, <2 x i64>)
48 declare <16 x i8> @llvm.s390.vavglb(<16 x i8>, <16 x i8>)
49 declare <8 x i16> @llvm.s390.vavglh(<8 x i16>, <8 x i16>)
50 declare <4 x i32> @llvm.s390.vavglf(<4 x i32>, <4 x i32>)
51 declare <2 x i64> @llvm.s390.vavglg(<2 x i64>, <2 x i64>)
52 declare <4 x i32> @llvm.s390.vcksm(<4 x i32>, <4 x i32>)
53 declare <8 x i16> @llvm.s390.vgfmb(<16 x i8>, <16 x i8>)
54 declare <4 x i32> @llvm.s390.vgfmh(<8 x i16>, <8 x i16>)
55 declare <2 x i64> @llvm.s390.vgfmf(<4 x i32>, <4 x i32>)
56 declare i128 @llvm.s390.vgfmg(<2 x i64>, <2 x i64>)
57 declare <8 x i16> @llvm.s390.vgfmab(<16 x i8>, <16 x i8>, <8 x i16>)
58 declare <4 x i32> @llvm.s390.vgfmah(<8 x i16>, <8 x i16>, <4 x i32>)
59 declare <2 x i64> @llvm.s390.vgfmaf(<4 x i32>, <4 x i32>, <2 x i64>)
60 declare i128 @llvm.s390.vgfmag(<2 x i64>, <2 x i64>, i128)
61 declare <16 x i8> @llvm.s390.vmahb(<16 x i8>, <16 x i8>, <16 x i8>)
62 declare <8 x i16> @llvm.s390.vmahh(<8 x i16>, <8 x i16>, <8 x i16>)
63 declare <4 x i32> @llvm.s390.vmahf(<4 x i32>, <4 x i32>, <4 x i32>)
64 declare <16 x i8> @llvm.s390.vmalhb(<16 x i8>, <16 x i8>, <16 x i8>)
65 declare <8 x i16> @llvm.s390.vmalhh(<8 x i16>, <8 x i16>, <8 x i16>)
66 declare <4 x i32> @llvm.s390.vmalhf(<4 x i32>, <4 x i32>, <4 x i32>)
67 declare <8 x i16> @llvm.s390.vmaeb(<16 x i8>, <16 x i8>, <8 x i16>)
68 declare <4 x i32> @llvm.s390.vmaeh(<8 x i16>, <8 x i16>, <4 x i32>)
69 declare <2 x i64> @llvm.s390.vmaef(<4 x i32>, <4 x i32>, <2 x i64>)
70 declare <8 x i16> @llvm.s390.vmaleb(<16 x i8>, <16 x i8>, <8 x i16>)
71 declare <4 x i32> @llvm.s390.vmaleh(<8 x i16>, <8 x i16>, <4 x i32>)
72 declare <2 x i64> @llvm.s390.vmalef(<4 x i32>, <4 x i32>, <2 x i64>)
73 declare <8 x i16> @llvm.s390.vmaob(<16 x i8>, <16 x i8>, <8 x i16>)
74 declare <4 x i32> @llvm.s390.vmaoh(<8 x i16>, <8 x i16>, <4 x i32>)
75 declare <2 x i64> @llvm.s390.vmaof(<4 x i32>, <4 x i32>, <2 x i64>)
76 declare <8 x i16> @llvm.s390.vmalob(<16 x i8>, <16 x i8>, <8 x i16>)
77 declare <4 x i32> @llvm.s390.vmaloh(<8 x i16>, <8 x i16>, <4 x i32>)
78 declare <2 x i64> @llvm.s390.vmalof(<4 x i32>, <4 x i32>, <2 x i64>)
79 declare <16 x i8> @llvm.s390.vmhb(<16 x i8>, <16 x i8>)
80 declare <8 x i16> @llvm.s390.vmhh(<8 x i16>, <8 x i16>)
81 declare <4 x i32> @llvm.s390.vmhf(<4 x i32>, <4 x i32>)
82 declare <16 x i8> @llvm.s390.vmlhb(<16 x i8>, <16 x i8>)
83 declare <8 x i16> @llvm.s390.vmlhh(<8 x i16>, <8 x i16>)
84 declare <4 x i32> @llvm.s390.vmlhf(<4 x i32>, <4 x i32>)
85 declare <8 x i16> @llvm.s390.vmeb(<16 x i8>, <16 x i8>)
86 declare <4 x i32> @llvm.s390.vmeh(<8 x i16>, <8 x i16>)
87 declare <2 x i64> @llvm.s390.vmef(<4 x i32>, <4 x i32>)
88 declare <8 x i16> @llvm.s390.vmleb(<16 x i8>, <16 x i8>)
89 declare <4 x i32> @llvm.s390.vmleh(<8 x i16>, <8 x i16>)
90 declare <2 x i64> @llvm.s390.vmlef(<4 x i32>, <4 x i32>)
91 declare <8 x i16> @llvm.s390.vmob(<16 x i8>, <16 x i8>)
92 declare <4 x i32> @llvm.s390.vmoh(<8 x i16>, <8 x i16>)
93 declare <2 x i64> @llvm.s390.vmof(<4 x i32>, <4 x i32>)
94 declare <8 x i16> @llvm.s390.vmlob(<16 x i8>, <16 x i8>)
95 declare <4 x i32> @llvm.s390.vmloh(<8 x i16>, <8 x i16>)
96 declare <2 x i64> @llvm.s390.vmlof(<4 x i32>, <4 x i32>)
97 declare <16 x i8> @llvm.s390.verimb(<16 x i8>, <16 x i8>, <16 x i8>, i32)
98 declare <8 x i16> @llvm.s390.verimh(<8 x i16>, <8 x i16>, <8 x i16>, i32)
99 declare <4 x i32> @llvm.s390.verimf(<4 x i32>, <4 x i32>, <4 x i32>, i32)
100 declare <2 x i64> @llvm.s390.verimg(<2 x i64>, <2 x i64>, <2 x i64>, i32)
101 declare <16 x i8> @llvm.s390.vsl(<16 x i8>, <16 x i8>)
102 declare <16 x i8> @llvm.s390.vslb(<16 x i8>, <16 x i8>)
103 declare <16 x i8> @llvm.s390.vsra(<16 x i8>, <16 x i8>)
104 declare <16 x i8> @llvm.s390.vsrab(<16 x i8>, <16 x i8>)
105 declare <16 x i8> @llvm.s390.vsrl(<16 x i8>, <16 x i8>)
106 declare <16 x i8> @llvm.s390.vsrlb(<16 x i8>, <16 x i8>)
107 declare <16 x i8> @llvm.s390.vsldb(<16 x i8>, <16 x i8>, i32)
108 declare <16 x i8> @llvm.s390.vscbib(<16 x i8>, <16 x i8>)
109 declare <8 x i16> @llvm.s390.vscbih(<8 x i16>, <8 x i16>)
110 declare <4 x i32> @llvm.s390.vscbif(<4 x i32>, <4 x i32>)
111 declare <2 x i64> @llvm.s390.vscbig(<2 x i64>, <2 x i64>)
112 declare i128 @llvm.s390.vsq(i128, i128)
113 declare i128 @llvm.s390.vsbiq(i128, i128, i128)
114 declare i128 @llvm.s390.vscbiq(i128, i128)
115 declare i128 @llvm.s390.vsbcbiq(i128, i128, i128)
116 declare <4 x i32> @llvm.s390.vsumb(<16 x i8>, <16 x i8>)
117 declare <4 x i32> @llvm.s390.vsumh(<8 x i16>, <8 x i16>)
118 declare <2 x i64> @llvm.s390.vsumgh(<8 x i16>, <8 x i16>)
119 declare <2 x i64> @llvm.s390.vsumgf(<4 x i32>, <4 x i32>)
120 declare i128 @llvm.s390.vsumqf(<4 x i32>, <4 x i32>)
121 declare i128 @llvm.s390.vsumqg(<2 x i64>, <2 x i64>)
122 declare i32 @llvm.s390.vtm(<16 x i8>, <16 x i8>)
123 declare {<16 x i8>, i32} @llvm.s390.vceqbs(<16 x i8>, <16 x i8>)
124 declare {<8 x i16>, i32} @llvm.s390.vceqhs(<8 x i16>, <8 x i16>)
125 declare {<4 x i32>, i32} @llvm.s390.vceqfs(<4 x i32>, <4 x i32>)
126 declare {<2 x i64>, i32} @llvm.s390.vceqgs(<2 x i64>, <2 x i64>)
127 declare {<16 x i8>, i32} @llvm.s390.vchbs(<16 x i8>, <16 x i8>)
128 declare {<8 x i16>, i32} @llvm.s390.vchhs(<8 x i16>, <8 x i16>)
129 declare {<4 x i32>, i32} @llvm.s390.vchfs(<4 x i32>, <4 x i32>)
130 declare {<2 x i64>, i32} @llvm.s390.vchgs(<2 x i64>, <2 x i64>)
131 declare {<16 x i8>, i32} @llvm.s390.vchlbs(<16 x i8>, <16 x i8>)
132 declare {<8 x i16>, i32} @llvm.s390.vchlhs(<8 x i16>, <8 x i16>)
133 declare {<4 x i32>, i32} @llvm.s390.vchlfs(<4 x i32>, <4 x i32>)
134 declare {<2 x i64>, i32} @llvm.s390.vchlgs(<2 x i64>, <2 x i64>)
135 declare <16 x i8> @llvm.s390.vfaeb(<16 x i8>, <16 x i8>, i32)
136 declare <8 x i16> @llvm.s390.vfaeh(<8 x i16>, <8 x i16>, i32)
137 declare <4 x i32> @llvm.s390.vfaef(<4 x i32>, <4 x i32>, i32)
138 declare {<16 x i8>, i32} @llvm.s390.vfaebs(<16 x i8>, <16 x i8>, i32)
139 declare {<8 x i16>, i32} @llvm.s390.vfaehs(<8 x i16>, <8 x i16>, i32)
140 declare {<4 x i32>, i32} @llvm.s390.vfaefs(<4 x i32>, <4 x i32>, i32)
141 declare <16 x i8> @llvm.s390.vfaezb(<16 x i8>, <16 x i8>, i32)
142 declare <8 x i16> @llvm.s390.vfaezh(<8 x i16>, <8 x i16>, i32)
143 declare <4 x i32> @llvm.s390.vfaezf(<4 x i32>, <4 x i32>, i32)
144 declare {<16 x i8>, i32} @llvm.s390.vfaezbs(<16 x i8>, <16 x i8>, i32)
145 declare {<8 x i16>, i32} @llvm.s390.vfaezhs(<8 x i16>, <8 x i16>, i32)
146 declare {<4 x i32>, i32} @llvm.s390.vfaezfs(<4 x i32>, <4 x i32>, i32)
147 declare <16 x i8> @llvm.s390.vfeeb(<16 x i8>, <16 x i8>)
148 declare <8 x i16> @llvm.s390.vfeeh(<8 x i16>, <8 x i16>)
149 declare <4 x i32> @llvm.s390.vfeef(<4 x i32>, <4 x i32>)
150 declare {<16 x i8>, i32} @llvm.s390.vfeebs(<16 x i8>, <16 x i8>)
151 declare {<8 x i16>, i32} @llvm.s390.vfeehs(<8 x i16>, <8 x i16>)
152 declare {<4 x i32>, i32} @llvm.s390.vfeefs(<4 x i32>, <4 x i32>)
153 declare <16 x i8> @llvm.s390.vfeezb(<16 x i8>, <16 x i8>)
154 declare <8 x i16> @llvm.s390.vfeezh(<8 x i16>, <8 x i16>)
155 declare <4 x i32> @llvm.s390.vfeezf(<4 x i32>, <4 x i32>)
156 declare {<16 x i8>, i32} @llvm.s390.vfeezbs(<16 x i8>, <16 x i8>)
157 declare {<8 x i16>, i32} @llvm.s390.vfeezhs(<8 x i16>, <8 x i16>)
158 declare {<4 x i32>, i32} @llvm.s390.vfeezfs(<4 x i32>, <4 x i32>)
159 declare <16 x i8> @llvm.s390.vfeneb(<16 x i8>, <16 x i8>)
160 declare <8 x i16> @llvm.s390.vfeneh(<8 x i16>, <8 x i16>)
161 declare <4 x i32> @llvm.s390.vfenef(<4 x i32>, <4 x i32>)
162 declare {<16 x i8>, i32} @llvm.s390.vfenebs(<16 x i8>, <16 x i8>)
163 declare {<8 x i16>, i32} @llvm.s390.vfenehs(<8 x i16>, <8 x i16>)
164 declare {<4 x i32>, i32} @llvm.s390.vfenefs(<4 x i32>, <4 x i32>)
165 declare <16 x i8> @llvm.s390.vfenezb(<16 x i8>, <16 x i8>)
166 declare <8 x i16> @llvm.s390.vfenezh(<8 x i16>, <8 x i16>)
167 declare <4 x i32> @llvm.s390.vfenezf(<4 x i32>, <4 x i32>)
168 declare {<16 x i8>, i32} @llvm.s390.vfenezbs(<16 x i8>, <16 x i8>)
169 declare {<8 x i16>, i32} @llvm.s390.vfenezhs(<8 x i16>, <8 x i16>)
170 declare {<4 x i32>, i32} @llvm.s390.vfenezfs(<4 x i32>, <4 x i32>)
171 declare <16 x i8> @llvm.s390.vistrb(<16 x i8>)
172 declare <8 x i16> @llvm.s390.vistrh(<8 x i16>)
173 declare <4 x i32> @llvm.s390.vistrf(<4 x i32>)
174 declare {<16 x i8>, i32} @llvm.s390.vistrbs(<16 x i8>)
175 declare {<8 x i16>, i32} @llvm.s390.vistrhs(<8 x i16>)
176 declare {<4 x i32>, i32} @llvm.s390.vistrfs(<4 x i32>)
177 declare <16 x i8> @llvm.s390.vstrcb(<16 x i8>, <16 x i8>, <16 x i8>, i32)
178 declare <8 x i16> @llvm.s390.vstrch(<8 x i16>, <8 x i16>, <8 x i16>, i32)
179 declare <4 x i32> @llvm.s390.vstrcf(<4 x i32>, <4 x i32>, <4 x i32>, i32)
180 declare {<16 x i8>, i32} @llvm.s390.vstrcbs(<16 x i8>, <16 x i8>, <16 x i8>,
182 declare {<8 x i16>, i32} @llvm.s390.vstrchs(<8 x i16>, <8 x i16>, <8 x i16>,
184 declare {<4 x i32>, i32} @llvm.s390.vstrcfs(<4 x i32>, <4 x i32>, <4 x i32>,
186 declare <16 x i8> @llvm.s390.vstrczb(<16 x i8>, <16 x i8>, <16 x i8>, i32)
187 declare <8 x i16> @llvm.s390.vstrczh(<8 x i16>, <8 x i16>, <8 x i16>, i32)
188 declare <4 x i32> @llvm.s390.vstrczf(<4 x i32>, <4 x i32>, <4 x i32>, i32)
189 declare {<16 x i8>, i32} @llvm.s390.vstrczbs(<16 x i8>, <16 x i8>, <16 x i8>,
191 declare {<8 x i16>, i32} @llvm.s390.vstrczhs(<8 x i16>, <8 x i16>, <8 x i16>,
193 declare {<4 x i32>, i32} @llvm.s390.vstrczfs(<4 x i32>, <4 x i32>, <4 x i32>,
195 declare {<2 x i64>, i32} @llvm.s390.vfcedbs(<2 x double>, <2 x double>)
196 declare {<2 x i64>, i32} @llvm.s390.vfchdbs(<2 x double>, <2 x double>)
197 declare {<2 x i64>, i32} @llvm.s390.vfchedbs(<2 x double>, <2 x double>)
198 declare {<2 x i64>, i32} @llvm.s390.vftcidb(<2 x double>, i32)
199 declare <2 x double> @llvm.s390.vfidb(<2 x double>, i32, i32)
201 ; LCBB with the lowest M3 operand.
202 define i32 @test_lcbb1(ptr %ptr) {
203 ; CHECK-LABEL: test_lcbb1:
205 ; CHECK-NEXT: lcbb %r2, 0(%r2), 0
206 ; CHECK-NEXT: br %r14
207 %res = call i32 @llvm.s390.lcbb(ptr %ptr, i32 0)
211 ; LCBB with the highest M3 operand.
212 define i32 @test_lcbb2(ptr %ptr) {
213 ; CHECK-LABEL: test_lcbb2:
215 ; CHECK-NEXT: lcbb %r2, 0(%r2), 15
216 ; CHECK-NEXT: br %r14
217 %res = call i32 @llvm.s390.lcbb(ptr %ptr, i32 15)
221 ; LCBB with a displacement and index.
222 define i32 @test_lcbb3(ptr %base, i64 %index) {
223 ; CHECK-LABEL: test_lcbb3:
225 ; CHECK-NEXT: lcbb %r2, 4095(%r2,%r3), 4
226 ; CHECK-NEXT: br %r14
227 %add = add i64 %index, 4095
228 %ptr = getelementptr i8, ptr %base, i64 %add
229 %res = call i32 @llvm.s390.lcbb(ptr %ptr, i32 4)
233 ; LCBB with an out-of-range displacement.
234 define i32 @test_lcbb4(ptr %base) {
235 ; CHECK-LABEL: test_lcbb4:
237 ; CHECK-NEXT: aghi %r2, 4096
238 ; CHECK-NEXT: lcbb %r2, 0(%r2), 5
239 ; CHECK-NEXT: br %r14
240 %ptr = getelementptr i8, ptr %base, i64 4096
241 %res = call i32 @llvm.s390.lcbb(ptr %ptr, i32 5)
245 ; VLBB with the lowest M3 operand.
246 define <16 x i8> @test_vlbb1(ptr %ptr) {
247 ; CHECK-LABEL: test_vlbb1:
249 ; CHECK-NEXT: vlbb %v24, 0(%r2), 0
250 ; CHECK-NEXT: br %r14
251 %res = call <16 x i8> @llvm.s390.vlbb(ptr %ptr, i32 0)
255 ; VLBB with the highest M3 operand.
256 define <16 x i8> @test_vlbb2(ptr %ptr) {
257 ; CHECK-LABEL: test_vlbb2:
259 ; CHECK-NEXT: vlbb %v24, 0(%r2), 15
260 ; CHECK-NEXT: br %r14
261 %res = call <16 x i8> @llvm.s390.vlbb(ptr %ptr, i32 15)
265 ; VLBB with a displacement and index.
266 define <16 x i8> @test_vlbb3(ptr %base, i64 %index) {
267 ; CHECK-LABEL: test_vlbb3:
269 ; CHECK-NEXT: vlbb %v24, 4095(%r2,%r3), 4
270 ; CHECK-NEXT: br %r14
271 %add = add i64 %index, 4095
272 %ptr = getelementptr i8, ptr %base, i64 %add
273 %res = call <16 x i8> @llvm.s390.vlbb(ptr %ptr, i32 4)
277 ; VLBB with an out-of-range displacement.
278 define <16 x i8> @test_vlbb4(ptr %base) {
279 ; CHECK-LABEL: test_vlbb4:
281 ; CHECK-NEXT: aghi %r2, 4096
282 ; CHECK-NEXT: vlbb %v24, 0(%r2), 5
283 ; CHECK-NEXT: br %r14
284 %ptr = getelementptr i8, ptr %base, i64 4096
285 %res = call <16 x i8> @llvm.s390.vlbb(ptr %ptr, i32 5)
289 ; VLL with the lowest in-range displacement.
290 define <16 x i8> @test_vll1(ptr %ptr, i32 %length) {
291 ; CHECK-LABEL: test_vll1:
293 ; CHECK-NEXT: vll %v24, %r3, 0(%r2)
294 ; CHECK-NEXT: br %r14
295 %res = call <16 x i8> @llvm.s390.vll(i32 %length, ptr %ptr)
299 ; VLL with the highest in-range displacement.
300 define <16 x i8> @test_vll2(ptr %base, i32 %length) {
301 ; CHECK-LABEL: test_vll2:
303 ; CHECK-NEXT: vll %v24, %r3, 4095(%r2)
304 ; CHECK-NEXT: br %r14
305 %ptr = getelementptr i8, ptr %base, i64 4095
306 %res = call <16 x i8> @llvm.s390.vll(i32 %length, ptr %ptr)
310 ; VLL with an out-of-range displacementa.
311 define <16 x i8> @test_vll3(ptr %base, i32 %length) {
312 ; CHECK-LABEL: test_vll3:
314 ; CHECK-NEXT: aghi %r2, 4096
315 ; CHECK-NEXT: vll %v24, %r3, 0(%r2)
316 ; CHECK-NEXT: br %r14
317 %ptr = getelementptr i8, ptr %base, i64 4096
318 %res = call <16 x i8> @llvm.s390.vll(i32 %length, ptr %ptr)
322 ; Check that VLL doesn't allow an index.
323 define <16 x i8> @test_vll4(ptr %base, i64 %index, i32 %length) {
324 ; CHECK-LABEL: test_vll4:
326 ; CHECK-NEXT: agr %r2, %r3
327 ; CHECK-NEXT: vll %v24, %r4, 0(%r2)
328 ; CHECK-NEXT: br %r14
329 %ptr = getelementptr i8, ptr %base, i64 %index
330 %res = call <16 x i8> @llvm.s390.vll(i32 %length, ptr %ptr)
334 ; VLL with length >= 15 should become VL.
335 define <16 x i8> @test_vll5(ptr %ptr) {
336 ; CHECK-LABEL: test_vll5:
338 ; CHECK-NEXT: vl %v24, 0(%r2), 3
339 ; CHECK-NEXT: br %r14
340 %res = call <16 x i8> @llvm.s390.vll(i32 15, ptr %ptr)
344 ; VPDI taking element 0 from each half.
345 define <2 x i64> @test_vpdi1(<2 x i64> %a, <2 x i64> %b) {
346 ; CHECK-LABEL: test_vpdi1:
348 ; CHECK-NEXT: vpdi %v24, %v24, %v26, 0
349 ; CHECK-NEXT: br %r14
350 %res = call <2 x i64> @llvm.s390.vpdi(<2 x i64> %a, <2 x i64> %b, i32 0)
354 ; VPDI taking element 1 from each half.
355 define <2 x i64> @test_vpdi2(<2 x i64> %a, <2 x i64> %b) {
356 ; CHECK-LABEL: test_vpdi2:
358 ; CHECK-NEXT: vpdi %v24, %v24, %v26, 5
359 ; CHECK-NEXT: br %r14
360 %res = call <2 x i64> @llvm.s390.vpdi(<2 x i64> %a, <2 x i64> %b, i32 5)
365 define <16 x i8> @test_vperm(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {
366 ; CHECK-LABEL: test_vperm:
368 ; CHECK-NEXT: vperm %v24, %v24, %v26, %v28
369 ; CHECK-NEXT: br %r14
370 %res = call <16 x i8> @llvm.s390.vperm(<16 x i8> %a, <16 x i8> %b,
376 define <16 x i8> @test_vpksh(<8 x i16> %a, <8 x i16> %b) {
377 ; CHECK-LABEL: test_vpksh:
379 ; CHECK-NEXT: vpksh %v24, %v24, %v26
380 ; CHECK-NEXT: br %r14
381 %res = call <16 x i8> @llvm.s390.vpksh(<8 x i16> %a, <8 x i16> %b)
386 define <8 x i16> @test_vpksf(<4 x i32> %a, <4 x i32> %b) {
387 ; CHECK-LABEL: test_vpksf:
389 ; CHECK-NEXT: vpksf %v24, %v24, %v26
390 ; CHECK-NEXT: br %r14
391 %res = call <8 x i16> @llvm.s390.vpksf(<4 x i32> %a, <4 x i32> %b)
396 define <4 x i32> @test_vpksg(<2 x i64> %a, <2 x i64> %b) {
397 ; CHECK-LABEL: test_vpksg:
399 ; CHECK-NEXT: vpksg %v24, %v24, %v26
400 ; CHECK-NEXT: br %r14
401 %res = call <4 x i32> @llvm.s390.vpksg(<2 x i64> %a, <2 x i64> %b)
405 ; VPKSHS with no processing of the result.
406 define <16 x i8> @test_vpkshs(<8 x i16> %a, <8 x i16> %b, ptr %ccptr) {
407 ; CHECK-LABEL: test_vpkshs:
409 ; CHECK-NEXT: vpkshs %v24, %v24, %v26
410 ; CHECK-NEXT: ipm %r0
411 ; CHECK-NEXT: srl %r0, 28
412 ; CHECK-NEXT: st %r0, 0(%r2)
413 ; CHECK-NEXT: br %r14
414 %call = call {<16 x i8>, i32} @llvm.s390.vpkshs(<8 x i16> %a, <8 x i16> %b)
415 %res = extractvalue {<16 x i8>, i32} %call, 0
416 %cc = extractvalue {<16 x i8>, i32} %call, 1
417 store i32 %cc, ptr %ccptr
421 ; VPKSHS, storing to %ptr if all values were saturated.
422 define <16 x i8> @test_vpkshs_all_store(<8 x i16> %a, <8 x i16> %b, ptr %ptr) {
423 ; CHECK-LABEL: test_vpkshs_all_store:
425 ; CHECK-NEXT: vpkshs %v24, %v24, %v26
426 ; CHECK-NEXT: bler %r14
427 ; CHECK-NEXT: .LBB20_1: # %store
428 ; CHECK-NEXT: mvhi 0(%r2), 0
429 ; CHECK-NEXT: br %r14
430 %call = call {<16 x i8>, i32} @llvm.s390.vpkshs(<8 x i16> %a, <8 x i16> %b)
431 %res = extractvalue {<16 x i8>, i32} %call, 0
432 %cc = extractvalue {<16 x i8>, i32} %call, 1
433 %cmp = icmp uge i32 %cc, 3
434 br i1 %cmp, label %store, label %exit
437 store i32 0, ptr %ptr
444 ; VPKSFS with no processing of the result.
445 define <8 x i16> @test_vpksfs(<4 x i32> %a, <4 x i32> %b, ptr %ccptr) {
446 ; CHECK-LABEL: test_vpksfs:
448 ; CHECK-NEXT: vpksfs %v24, %v24, %v26
449 ; CHECK-NEXT: ipm %r0
450 ; CHECK-NEXT: srl %r0, 28
451 ; CHECK-NEXT: st %r0, 0(%r2)
452 ; CHECK-NEXT: br %r14
453 %call = call {<8 x i16>, i32} @llvm.s390.vpksfs(<4 x i32> %a, <4 x i32> %b)
454 %res = extractvalue {<8 x i16>, i32} %call, 0
455 %cc = extractvalue {<8 x i16>, i32} %call, 1
456 store i32 %cc, ptr %ccptr
460 ; VPKSFS, storing to %ptr if any values were saturated.
461 define <8 x i16> @test_vpksfs_any_store(<4 x i32> %a, <4 x i32> %b, ptr %ptr) {
462 ; CHECK-LABEL: test_vpksfs_any_store:
464 ; CHECK-NEXT: vpksfs %v24, %v24, %v26
465 ; CHECK-NEXT: ber %r14
466 ; CHECK-NEXT: .LBB22_1: # %store
467 ; CHECK-NEXT: mvhi 0(%r2), 0
468 ; CHECK-NEXT: br %r14
469 %call = call {<8 x i16>, i32} @llvm.s390.vpksfs(<4 x i32> %a, <4 x i32> %b)
470 %res = extractvalue {<8 x i16>, i32} %call, 0
471 %cc = extractvalue {<8 x i16>, i32} %call, 1
472 %cmp = icmp ugt i32 %cc, 0
473 br i1 %cmp, label %store, label %exit
476 store i32 0, ptr %ptr
483 ; VPKSGS with no processing of the result.
484 define <4 x i32> @test_vpksgs(<2 x i64> %a, <2 x i64> %b, ptr %ccptr) {
485 ; CHECK-LABEL: test_vpksgs:
487 ; CHECK-NEXT: vpksgs %v24, %v24, %v26
488 ; CHECK-NEXT: ipm %r0
489 ; CHECK-NEXT: srl %r0, 28
490 ; CHECK-NEXT: st %r0, 0(%r2)
491 ; CHECK-NEXT: br %r14
492 %call = call {<4 x i32>, i32} @llvm.s390.vpksgs(<2 x i64> %a, <2 x i64> %b)
493 %res = extractvalue {<4 x i32>, i32} %call, 0
494 %cc = extractvalue {<4 x i32>, i32} %call, 1
495 store i32 %cc, ptr %ccptr
499 ; VPKSGS, storing to %ptr if no elements were saturated
500 define <4 x i32> @test_vpksgs_none_store(<2 x i64> %a, <2 x i64> %b,
501 ; CHECK-LABEL: test_vpksgs_none_store:
503 ; CHECK-NEXT: vpksgs %v24, %v24, %v26
504 ; CHECK-NEXT: bnher %r14
505 ; CHECK-NEXT: .LBB24_1: # %store
506 ; CHECK-NEXT: mvhi 0(%r2), 0
507 ; CHECK-NEXT: br %r14
509 %call = call {<4 x i32>, i32} @llvm.s390.vpksgs(<2 x i64> %a, <2 x i64> %b)
510 %res = extractvalue {<4 x i32>, i32} %call, 0
511 %cc = extractvalue {<4 x i32>, i32} %call, 1
512 %cmp = icmp sle i32 %cc, 0
513 br i1 %cmp, label %store, label %exit
516 store i32 0, ptr %ptr
524 define <16 x i8> @test_vpklsh(<8 x i16> %a, <8 x i16> %b) {
525 ; CHECK-LABEL: test_vpklsh:
527 ; CHECK-NEXT: vpklsh %v24, %v24, %v26
528 ; CHECK-NEXT: br %r14
529 %res = call <16 x i8> @llvm.s390.vpklsh(<8 x i16> %a, <8 x i16> %b)
534 define <8 x i16> @test_vpklsf(<4 x i32> %a, <4 x i32> %b) {
535 ; CHECK-LABEL: test_vpklsf:
537 ; CHECK-NEXT: vpklsf %v24, %v24, %v26
538 ; CHECK-NEXT: br %r14
539 %res = call <8 x i16> @llvm.s390.vpklsf(<4 x i32> %a, <4 x i32> %b)
544 define <4 x i32> @test_vpklsg(<2 x i64> %a, <2 x i64> %b) {
545 ; CHECK-LABEL: test_vpklsg:
547 ; CHECK-NEXT: vpklsg %v24, %v24, %v26
548 ; CHECK-NEXT: br %r14
549 %res = call <4 x i32> @llvm.s390.vpklsg(<2 x i64> %a, <2 x i64> %b)
553 ; VPKLSHS with no processing of the result.
554 define <16 x i8> @test_vpklshs(<8 x i16> %a, <8 x i16> %b, ptr %ccptr) {
555 ; CHECK-LABEL: test_vpklshs:
557 ; CHECK-NEXT: vpklshs %v24, %v24, %v26
558 ; CHECK-NEXT: ipm %r0
559 ; CHECK-NEXT: srl %r0, 28
560 ; CHECK-NEXT: st %r0, 0(%r2)
561 ; CHECK-NEXT: br %r14
562 %call = call {<16 x i8>, i32} @llvm.s390.vpklshs(<8 x i16> %a, <8 x i16> %b)
563 %res = extractvalue {<16 x i8>, i32} %call, 0
564 %cc = extractvalue {<16 x i8>, i32} %call, 1
565 store i32 %cc, ptr %ccptr
569 ; VPKLSHS, storing to %ptr if all values were saturated.
570 define <16 x i8> @test_vpklshs_all_store(<8 x i16> %a, <8 x i16> %b,
571 ; CHECK-LABEL: test_vpklshs_all_store:
573 ; CHECK-NEXT: vpklshs %v24, %v24, %v26
574 ; CHECK-NEXT: bler %r14
575 ; CHECK-NEXT: .LBB29_1: # %store
576 ; CHECK-NEXT: mvhi 0(%r2), 0
577 ; CHECK-NEXT: br %r14
579 %call = call {<16 x i8>, i32} @llvm.s390.vpklshs(<8 x i16> %a, <8 x i16> %b)
580 %res = extractvalue {<16 x i8>, i32} %call, 0
581 %cc = extractvalue {<16 x i8>, i32} %call, 1
582 %cmp = icmp eq i32 %cc, 3
583 br i1 %cmp, label %store, label %exit
586 store i32 0, ptr %ptr
593 ; VPKLSFS with no processing of the result.
594 define <8 x i16> @test_vpklsfs(<4 x i32> %a, <4 x i32> %b, ptr %ccptr) {
595 ; CHECK-LABEL: test_vpklsfs:
597 ; CHECK-NEXT: vpklsfs %v24, %v24, %v26
598 ; CHECK-NEXT: ipm %r0
599 ; CHECK-NEXT: srl %r0, 28
600 ; CHECK-NEXT: st %r0, 0(%r2)
601 ; CHECK-NEXT: br %r14
602 %call = call {<8 x i16>, i32} @llvm.s390.vpklsfs(<4 x i32> %a, <4 x i32> %b)
603 %res = extractvalue {<8 x i16>, i32} %call, 0
604 %cc = extractvalue {<8 x i16>, i32} %call, 1
605 store i32 %cc, ptr %ccptr
609 ; VPKLSFS, storing to %ptr if any values were saturated.
610 define <8 x i16> @test_vpklsfs_any_store(<4 x i32> %a, <4 x i32> %b,
611 ; CHECK-LABEL: test_vpklsfs_any_store:
613 ; CHECK-NEXT: vpklsfs %v24, %v24, %v26
614 ; CHECK-NEXT: ber %r14
615 ; CHECK-NEXT: .LBB31_1: # %store
616 ; CHECK-NEXT: mvhi 0(%r2), 0
617 ; CHECK-NEXT: br %r14
619 %call = call {<8 x i16>, i32} @llvm.s390.vpklsfs(<4 x i32> %a, <4 x i32> %b)
620 %res = extractvalue {<8 x i16>, i32} %call, 0
621 %cc = extractvalue {<8 x i16>, i32} %call, 1
622 %cmp = icmp ne i32 %cc, 0
623 br i1 %cmp, label %store, label %exit
626 store i32 0, ptr %ptr
633 ; VPKLSGS with no processing of the result.
634 define <4 x i32> @test_vpklsgs(<2 x i64> %a, <2 x i64> %b, ptr %ccptr) {
635 ; CHECK-LABEL: test_vpklsgs:
637 ; CHECK-NEXT: vpklsgs %v24, %v24, %v26
638 ; CHECK-NEXT: ipm %r0
639 ; CHECK-NEXT: srl %r0, 28
640 ; CHECK-NEXT: st %r0, 0(%r2)
641 ; CHECK-NEXT: br %r14
642 %call = call {<4 x i32>, i32} @llvm.s390.vpklsgs(<2 x i64> %a, <2 x i64> %b)
643 %res = extractvalue {<4 x i32>, i32} %call, 0
644 %cc = extractvalue {<4 x i32>, i32} %call, 1
645 store i32 %cc, ptr %ccptr
649 ; VPKLSGS, storing to %ptr if no elements were saturated
650 define <4 x i32> @test_vpklsgs_none_store(<2 x i64> %a, <2 x i64> %b,
651 ; CHECK-LABEL: test_vpklsgs_none_store:
653 ; CHECK-NEXT: vpklsgs %v24, %v24, %v26
654 ; CHECK-NEXT: bnher %r14
655 ; CHECK-NEXT: .LBB33_1: # %store
656 ; CHECK-NEXT: mvhi 0(%r2), 0
657 ; CHECK-NEXT: br %r14
659 %call = call {<4 x i32>, i32} @llvm.s390.vpklsgs(<2 x i64> %a, <2 x i64> %b)
660 %res = extractvalue {<4 x i32>, i32} %call, 0
661 %cc = extractvalue {<4 x i32>, i32} %call, 1
662 %cmp = icmp eq i32 %cc, 0
663 br i1 %cmp, label %store, label %exit
666 store i32 0, ptr %ptr
673 ; VSTL with the lowest in-range displacement.
674 define void @test_vstl1(<16 x i8> %vec, ptr %ptr, i32 %length) {
675 ; CHECK-LABEL: test_vstl1:
677 ; CHECK-NEXT: vstl %v24, %r3, 0(%r2)
678 ; CHECK-NEXT: br %r14
679 call void @llvm.s390.vstl(<16 x i8> %vec, i32 %length, ptr %ptr)
683 ; VSTL with the highest in-range displacement.
684 define void @test_vstl2(<16 x i8> %vec, ptr %base, i32 %length) {
685 ; CHECK-LABEL: test_vstl2:
687 ; CHECK-NEXT: vstl %v24, %r3, 4095(%r2)
688 ; CHECK-NEXT: br %r14
689 %ptr = getelementptr i8, ptr %base, i64 4095
690 call void @llvm.s390.vstl(<16 x i8> %vec, i32 %length, ptr %ptr)
694 ; VSTL with an out-of-range displacement.
695 define void @test_vstl3(<16 x i8> %vec, ptr %base, i32 %length) {
696 ; CHECK-LABEL: test_vstl3:
698 ; CHECK-NEXT: aghi %r2, 4096
699 ; CHECK-NEXT: vstl %v24, %r3, 0(%r2)
700 ; CHECK-NEXT: br %r14
701 %ptr = getelementptr i8, ptr %base, i64 4096
702 call void @llvm.s390.vstl(<16 x i8> %vec, i32 %length, ptr %ptr)
706 ; Check that VSTL doesn't allow an index.
707 define void @test_vstl4(<16 x i8> %vec, ptr %base, i64 %index, i32 %length) {
708 ; CHECK-LABEL: test_vstl4:
710 ; CHECK-NEXT: agr %r2, %r3
711 ; CHECK-NEXT: vstl %v24, %r4, 0(%r2)
712 ; CHECK-NEXT: br %r14
713 %ptr = getelementptr i8, ptr %base, i64 %index
714 call void @llvm.s390.vstl(<16 x i8> %vec, i32 %length, ptr %ptr)
718 ; VSTL with length >= 15 should become VST.
719 define void @test_vstl5(<16 x i8> %vec, ptr %ptr) {
720 ; CHECK-LABEL: test_vstl5:
722 ; CHECK-NEXT: vst %v24, 0(%r2), 3
723 ; CHECK-NEXT: br %r14
724 call void @llvm.s390.vstl(<16 x i8> %vec, i32 15, ptr %ptr)
729 define <8 x i16> @test_vuphb(<16 x i8> %a) {
730 ; CHECK-LABEL: test_vuphb:
732 ; CHECK-NEXT: vuphb %v24, %v24
733 ; CHECK-NEXT: br %r14
734 %res = call <8 x i16> @llvm.s390.vuphb(<16 x i8> %a)
739 define <4 x i32> @test_vuphh(<8 x i16> %a) {
740 ; CHECK-LABEL: test_vuphh:
742 ; CHECK-NEXT: vuphh %v24, %v24
743 ; CHECK-NEXT: br %r14
744 %res = call <4 x i32> @llvm.s390.vuphh(<8 x i16> %a)
749 define <2 x i64> @test_vuphf(<4 x i32> %a) {
750 ; CHECK-LABEL: test_vuphf:
752 ; CHECK-NEXT: vuphf %v24, %v24
753 ; CHECK-NEXT: br %r14
754 %res = call <2 x i64> @llvm.s390.vuphf(<4 x i32> %a)
759 define <8 x i16> @test_vuplhb(<16 x i8> %a) {
760 ; CHECK-LABEL: test_vuplhb:
762 ; CHECK-NEXT: vuplhb %v24, %v24
763 ; CHECK-NEXT: br %r14
764 %res = call <8 x i16> @llvm.s390.vuplhb(<16 x i8> %a)
769 define <4 x i32> @test_vuplhh(<8 x i16> %a) {
770 ; CHECK-LABEL: test_vuplhh:
772 ; CHECK-NEXT: vuplhh %v24, %v24
773 ; CHECK-NEXT: br %r14
774 %res = call <4 x i32> @llvm.s390.vuplhh(<8 x i16> %a)
779 define <2 x i64> @test_vuplhf(<4 x i32> %a) {
780 ; CHECK-LABEL: test_vuplhf:
782 ; CHECK-NEXT: vuplhf %v24, %v24
783 ; CHECK-NEXT: br %r14
784 %res = call <2 x i64> @llvm.s390.vuplhf(<4 x i32> %a)
789 define <8 x i16> @test_vuplb(<16 x i8> %a) {
790 ; CHECK-LABEL: test_vuplb:
792 ; CHECK-NEXT: vuplb %v24, %v24
793 ; CHECK-NEXT: br %r14
794 %res = call <8 x i16> @llvm.s390.vuplb(<16 x i8> %a)
799 define <4 x i32> @test_vuplhw(<8 x i16> %a) {
800 ; CHECK-LABEL: test_vuplhw:
802 ; CHECK-NEXT: vuplhw %v24, %v24
803 ; CHECK-NEXT: br %r14
804 %res = call <4 x i32> @llvm.s390.vuplhw(<8 x i16> %a)
809 define <2 x i64> @test_vuplf(<4 x i32> %a) {
810 ; CHECK-LABEL: test_vuplf:
812 ; CHECK-NEXT: vuplf %v24, %v24
813 ; CHECK-NEXT: br %r14
814 %res = call <2 x i64> @llvm.s390.vuplf(<4 x i32> %a)
819 define <8 x i16> @test_vupllb(<16 x i8> %a) {
820 ; CHECK-LABEL: test_vupllb:
822 ; CHECK-NEXT: vupllb %v24, %v24
823 ; CHECK-NEXT: br %r14
824 %res = call <8 x i16> @llvm.s390.vupllb(<16 x i8> %a)
829 define <4 x i32> @test_vupllh(<8 x i16> %a) {
830 ; CHECK-LABEL: test_vupllh:
832 ; CHECK-NEXT: vupllh %v24, %v24
833 ; CHECK-NEXT: br %r14
834 %res = call <4 x i32> @llvm.s390.vupllh(<8 x i16> %a)
839 define <2 x i64> @test_vupllf(<4 x i32> %a) {
840 ; CHECK-LABEL: test_vupllf:
842 ; CHECK-NEXT: vupllf %v24, %v24
843 ; CHECK-NEXT: br %r14
844 %res = call <2 x i64> @llvm.s390.vupllf(<4 x i32> %a)
849 define <16 x i8> @test_vaccb(<16 x i8> %a, <16 x i8> %b) {
850 ; CHECK-LABEL: test_vaccb:
852 ; CHECK-NEXT: vaccb %v24, %v24, %v26
853 ; CHECK-NEXT: br %r14
854 %res = call <16 x i8> @llvm.s390.vaccb(<16 x i8> %a, <16 x i8> %b)
859 define <8 x i16> @test_vacch(<8 x i16> %a, <8 x i16> %b) {
860 ; CHECK-LABEL: test_vacch:
862 ; CHECK-NEXT: vacch %v24, %v24, %v26
863 ; CHECK-NEXT: br %r14
864 %res = call <8 x i16> @llvm.s390.vacch(<8 x i16> %a, <8 x i16> %b)
869 define <4 x i32> @test_vaccf(<4 x i32> %a, <4 x i32> %b) {
870 ; CHECK-LABEL: test_vaccf:
872 ; CHECK-NEXT: vaccf %v24, %v24, %v26
873 ; CHECK-NEXT: br %r14
874 %res = call <4 x i32> @llvm.s390.vaccf(<4 x i32> %a, <4 x i32> %b)
879 define <2 x i64> @test_vaccg(<2 x i64> %a, <2 x i64> %b) {
880 ; CHECK-LABEL: test_vaccg:
882 ; CHECK-NEXT: vaccg %v24, %v24, %v26
883 ; CHECK-NEXT: br %r14
884 %res = call <2 x i64> @llvm.s390.vaccg(<2 x i64> %a, <2 x i64> %b)
889 define i128 @test_vaq(i128 %a, i128 %b) {
890 ; CHECK-LABEL: test_vaq:
892 ; CHECK-NEXT: vl %v0, 0(%r4), 3
893 ; CHECK-NEXT: vl %v1, 0(%r3), 3
894 ; CHECK-NEXT: vaq %v0, %v1, %v0
895 ; CHECK-NEXT: vst %v0, 0(%r2), 3
896 ; CHECK-NEXT: br %r14
897 %res = call i128 @llvm.s390.vaq(i128 %a, i128 %b)
902 define i128 @test_vacq(i128 %a, i128 %b, i128 %c) {
903 ; CHECK-LABEL: test_vacq:
905 ; CHECK-NEXT: vl %v0, 0(%r5), 3
906 ; CHECK-NEXT: vl %v1, 0(%r4), 3
907 ; CHECK-NEXT: vl %v2, 0(%r3), 3
908 ; CHECK-NEXT: vacq %v0, %v2, %v1, %v0
909 ; CHECK-NEXT: vst %v0, 0(%r2), 3
910 ; CHECK-NEXT: br %r14
911 %res = call i128 @llvm.s390.vacq(i128 %a, i128 %b, i128 %c)
916 define i128 @test_vaccq(i128 %a, i128 %b) {
917 ; CHECK-LABEL: test_vaccq:
919 ; CHECK-NEXT: vl %v0, 0(%r4), 3
920 ; CHECK-NEXT: vl %v1, 0(%r3), 3
921 ; CHECK-NEXT: vaccq %v0, %v1, %v0
922 ; CHECK-NEXT: vst %v0, 0(%r2), 3
923 ; CHECK-NEXT: br %r14
924 %res = call i128 @llvm.s390.vaccq(i128 %a, i128 %b)
929 define i128 @test_vacccq(i128 %a, i128 %b, i128 %c) {
930 ; CHECK-LABEL: test_vacccq:
932 ; CHECK-NEXT: vl %v0, 0(%r5), 3
933 ; CHECK-NEXT: vl %v1, 0(%r4), 3
934 ; CHECK-NEXT: vl %v2, 0(%r3), 3
935 ; CHECK-NEXT: vacccq %v0, %v2, %v1, %v0
936 ; CHECK-NEXT: vst %v0, 0(%r2), 3
937 ; CHECK-NEXT: br %r14
938 %res = call i128 @llvm.s390.vacccq(i128 %a, i128 %b, i128 %c)
943 define <16 x i8> @test_vavgb(<16 x i8> %a, <16 x i8> %b) {
944 ; CHECK-LABEL: test_vavgb:
946 ; CHECK-NEXT: vavgb %v24, %v24, %v26
947 ; CHECK-NEXT: br %r14
948 %res = call <16 x i8> @llvm.s390.vavgb(<16 x i8> %a, <16 x i8> %b)
953 define <8 x i16> @test_vavgh(<8 x i16> %a, <8 x i16> %b) {
954 ; CHECK-LABEL: test_vavgh:
956 ; CHECK-NEXT: vavgh %v24, %v24, %v26
957 ; CHECK-NEXT: br %r14
958 %res = call <8 x i16> @llvm.s390.vavgh(<8 x i16> %a, <8 x i16> %b)
963 define <4 x i32> @test_vavgf(<4 x i32> %a, <4 x i32> %b) {
964 ; CHECK-LABEL: test_vavgf:
966 ; CHECK-NEXT: vavgf %v24, %v24, %v26
967 ; CHECK-NEXT: br %r14
968 %res = call <4 x i32> @llvm.s390.vavgf(<4 x i32> %a, <4 x i32> %b)
973 define <2 x i64> @test_vavgg(<2 x i64> %a, <2 x i64> %b) {
974 ; CHECK-LABEL: test_vavgg:
976 ; CHECK-NEXT: vavgg %v24, %v24, %v26
977 ; CHECK-NEXT: br %r14
978 %res = call <2 x i64> @llvm.s390.vavgg(<2 x i64> %a, <2 x i64> %b)
983 define <16 x i8> @test_vavglb(<16 x i8> %a, <16 x i8> %b) {
984 ; CHECK-LABEL: test_vavglb:
986 ; CHECK-NEXT: vavglb %v24, %v24, %v26
987 ; CHECK-NEXT: br %r14
988 %res = call <16 x i8> @llvm.s390.vavglb(<16 x i8> %a, <16 x i8> %b)
993 define <8 x i16> @test_vavglh(<8 x i16> %a, <8 x i16> %b) {
994 ; CHECK-LABEL: test_vavglh:
996 ; CHECK-NEXT: vavglh %v24, %v24, %v26
997 ; CHECK-NEXT: br %r14
998 %res = call <8 x i16> @llvm.s390.vavglh(<8 x i16> %a, <8 x i16> %b)
1003 define <4 x i32> @test_vavglf(<4 x i32> %a, <4 x i32> %b) {
1004 ; CHECK-LABEL: test_vavglf:
1006 ; CHECK-NEXT: vavglf %v24, %v24, %v26
1007 ; CHECK-NEXT: br %r14
1008 %res = call <4 x i32> @llvm.s390.vavglf(<4 x i32> %a, <4 x i32> %b)
1013 define <2 x i64> @test_vavglg(<2 x i64> %a, <2 x i64> %b) {
1014 ; CHECK-LABEL: test_vavglg:
1016 ; CHECK-NEXT: vavglg %v24, %v24, %v26
1017 ; CHECK-NEXT: br %r14
1018 %res = call <2 x i64> @llvm.s390.vavglg(<2 x i64> %a, <2 x i64> %b)
1023 define <4 x i32> @test_vcksm(<4 x i32> %a, <4 x i32> %b) {
1024 ; CHECK-LABEL: test_vcksm:
1026 ; CHECK-NEXT: vcksm %v24, %v24, %v26
1027 ; CHECK-NEXT: br %r14
1028 %res = call <4 x i32> @llvm.s390.vcksm(<4 x i32> %a, <4 x i32> %b)
1033 define <8 x i16> @test_vgfmb(<16 x i8> %a, <16 x i8> %b) {
1034 ; CHECK-LABEL: test_vgfmb:
1036 ; CHECK-NEXT: vgfmb %v24, %v24, %v26
1037 ; CHECK-NEXT: br %r14
1038 %res = call <8 x i16> @llvm.s390.vgfmb(<16 x i8> %a, <16 x i8> %b)
1043 define <4 x i32> @test_vgfmh(<8 x i16> %a, <8 x i16> %b) {
1044 ; CHECK-LABEL: test_vgfmh:
1046 ; CHECK-NEXT: vgfmh %v24, %v24, %v26
1047 ; CHECK-NEXT: br %r14
1048 %res = call <4 x i32> @llvm.s390.vgfmh(<8 x i16> %a, <8 x i16> %b)
1053 define <2 x i64> @test_vgfmf(<4 x i32> %a, <4 x i32> %b) {
1054 ; CHECK-LABEL: test_vgfmf:
1056 ; CHECK-NEXT: vgfmf %v24, %v24, %v26
1057 ; CHECK-NEXT: br %r14
1058 %res = call <2 x i64> @llvm.s390.vgfmf(<4 x i32> %a, <4 x i32> %b)
1063 define i128 @test_vgfmg(<2 x i64> %a, <2 x i64> %b) {
1064 ; CHECK-LABEL: test_vgfmg:
1066 ; CHECK-NEXT: vgfmg %v0, %v24, %v26
1067 ; CHECK-NEXT: vst %v0, 0(%r2), 3
1068 ; CHECK-NEXT: br %r14
1069 %res = call i128 @llvm.s390.vgfmg(<2 x i64> %a, <2 x i64> %b)
1074 define <8 x i16> @test_vgfmab(<16 x i8> %a, <16 x i8> %b, <8 x i16> %c) {
1075 ; CHECK-LABEL: test_vgfmab:
1077 ; CHECK-NEXT: vgfmab %v24, %v24, %v26, %v28
1078 ; CHECK-NEXT: br %r14
1079 %res = call <8 x i16> @llvm.s390.vgfmab(<16 x i8> %a, <16 x i8> %b,
1085 define <4 x i32> @test_vgfmah(<8 x i16> %a, <8 x i16> %b, <4 x i32> %c) {
1086 ; CHECK-LABEL: test_vgfmah:
1088 ; CHECK-NEXT: vgfmah %v24, %v24, %v26, %v28
1089 ; CHECK-NEXT: br %r14
1090 %res = call <4 x i32> @llvm.s390.vgfmah(<8 x i16> %a, <8 x i16> %b,
1096 define <2 x i64> @test_vgfmaf(<4 x i32> %a, <4 x i32> %b, <2 x i64> %c) {
1097 ; CHECK-LABEL: test_vgfmaf:
1099 ; CHECK-NEXT: vgfmaf %v24, %v24, %v26, %v28
1100 ; CHECK-NEXT: br %r14
1101 %res = call <2 x i64> @llvm.s390.vgfmaf(<4 x i32> %a, <4 x i32> %b,
1107 define i128 @test_vgfmag(<2 x i64> %a, <2 x i64> %b, i128 %c) {
1108 ; CHECK-LABEL: test_vgfmag:
1110 ; CHECK-NEXT: vl %v0, 0(%r3), 3
1111 ; CHECK-NEXT: vgfmag %v0, %v24, %v26, %v0
1112 ; CHECK-NEXT: vst %v0, 0(%r2), 3
1113 ; CHECK-NEXT: br %r14
1114 %res = call i128 @llvm.s390.vgfmag(<2 x i64> %a, <2 x i64> %b, i128 %c)
1119 define <16 x i8> @test_vmahb(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {
1120 ; CHECK-LABEL: test_vmahb:
1122 ; CHECK-NEXT: vmahb %v24, %v24, %v26, %v28
1123 ; CHECK-NEXT: br %r14
1124 %res = call <16 x i8> @llvm.s390.vmahb(<16 x i8> %a, <16 x i8> %b,
1130 define <8 x i16> @test_vmahh(<8 x i16> %a, <8 x i16> %b, <8 x i16> %c) {
1131 ; CHECK-LABEL: test_vmahh:
1133 ; CHECK-NEXT: vmahh %v24, %v24, %v26, %v28
1134 ; CHECK-NEXT: br %r14
1135 %res = call <8 x i16> @llvm.s390.vmahh(<8 x i16> %a, <8 x i16> %b,
1141 define <4 x i32> @test_vmahf(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
1142 ; CHECK-LABEL: test_vmahf:
1144 ; CHECK-NEXT: vmahf %v24, %v24, %v26, %v28
1145 ; CHECK-NEXT: br %r14
1146 %res = call <4 x i32> @llvm.s390.vmahf(<4 x i32> %a, <4 x i32> %b,
1152 define <16 x i8> @test_vmalhb(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {
1153 ; CHECK-LABEL: test_vmalhb:
1155 ; CHECK-NEXT: vmalhb %v24, %v24, %v26, %v28
1156 ; CHECK-NEXT: br %r14
1157 %res = call <16 x i8> @llvm.s390.vmalhb(<16 x i8> %a, <16 x i8> %b,
1163 define <8 x i16> @test_vmalhh(<8 x i16> %a, <8 x i16> %b, <8 x i16> %c) {
1164 ; CHECK-LABEL: test_vmalhh:
1166 ; CHECK-NEXT: vmalhh %v24, %v24, %v26, %v28
1167 ; CHECK-NEXT: br %r14
1168 %res = call <8 x i16> @llvm.s390.vmalhh(<8 x i16> %a, <8 x i16> %b,
1174 define <4 x i32> @test_vmalhf(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
1175 ; CHECK-LABEL: test_vmalhf:
1177 ; CHECK-NEXT: vmalhf %v24, %v24, %v26, %v28
1178 ; CHECK-NEXT: br %r14
1179 %res = call <4 x i32> @llvm.s390.vmalhf(<4 x i32> %a, <4 x i32> %b,
1185 define <8 x i16> @test_vmaeb(<16 x i8> %a, <16 x i8> %b, <8 x i16> %c) {
1186 ; CHECK-LABEL: test_vmaeb:
1188 ; CHECK-NEXT: vmaeb %v24, %v24, %v26, %v28
1189 ; CHECK-NEXT: br %r14
1190 %res = call <8 x i16> @llvm.s390.vmaeb(<16 x i8> %a, <16 x i8> %b,
1196 define <4 x i32> @test_vmaeh(<8 x i16> %a, <8 x i16> %b, <4 x i32> %c) {
1197 ; CHECK-LABEL: test_vmaeh:
1199 ; CHECK-NEXT: vmaeh %v24, %v24, %v26, %v28
1200 ; CHECK-NEXT: br %r14
1201 %res = call <4 x i32> @llvm.s390.vmaeh(<8 x i16> %a, <8 x i16> %b,
1207 define <2 x i64> @test_vmaef(<4 x i32> %a, <4 x i32> %b, <2 x i64> %c) {
1208 ; CHECK-LABEL: test_vmaef:
1210 ; CHECK-NEXT: vmaef %v24, %v24, %v26, %v28
1211 ; CHECK-NEXT: br %r14
1212 %res = call <2 x i64> @llvm.s390.vmaef(<4 x i32> %a, <4 x i32> %b,
1218 define <8 x i16> @test_vmaleb(<16 x i8> %a, <16 x i8> %b, <8 x i16> %c) {
1219 ; CHECK-LABEL: test_vmaleb:
1221 ; CHECK-NEXT: vmaleb %v24, %v24, %v26, %v28
1222 ; CHECK-NEXT: br %r14
1223 %res = call <8 x i16> @llvm.s390.vmaleb(<16 x i8> %a, <16 x i8> %b,
1229 define <4 x i32> @test_vmaleh(<8 x i16> %a, <8 x i16> %b, <4 x i32> %c) {
1230 ; CHECK-LABEL: test_vmaleh:
1232 ; CHECK-NEXT: vmaleh %v24, %v24, %v26, %v28
1233 ; CHECK-NEXT: br %r14
1234 %res = call <4 x i32> @llvm.s390.vmaleh(<8 x i16> %a, <8 x i16> %b,
1240 define <2 x i64> @test_vmalef(<4 x i32> %a, <4 x i32> %b, <2 x i64> %c) {
1241 ; CHECK-LABEL: test_vmalef:
1243 ; CHECK-NEXT: vmalef %v24, %v24, %v26, %v28
1244 ; CHECK-NEXT: br %r14
1245 %res = call <2 x i64> @llvm.s390.vmalef(<4 x i32> %a, <4 x i32> %b,
1251 define <8 x i16> @test_vmaob(<16 x i8> %a, <16 x i8> %b, <8 x i16> %c) {
1252 ; CHECK-LABEL: test_vmaob:
1254 ; CHECK-NEXT: vmaob %v24, %v24, %v26, %v28
1255 ; CHECK-NEXT: br %r14
1256 %res = call <8 x i16> @llvm.s390.vmaob(<16 x i8> %a, <16 x i8> %b,
1262 define <4 x i32> @test_vmaoh(<8 x i16> %a, <8 x i16> %b, <4 x i32> %c) {
1263 ; CHECK-LABEL: test_vmaoh:
1265 ; CHECK-NEXT: vmaoh %v24, %v24, %v26, %v28
1266 ; CHECK-NEXT: br %r14
1267 %res = call <4 x i32> @llvm.s390.vmaoh(<8 x i16> %a, <8 x i16> %b,
1273 define <2 x i64> @test_vmaof(<4 x i32> %a, <4 x i32> %b, <2 x i64> %c) {
1274 ; CHECK-LABEL: test_vmaof:
1276 ; CHECK-NEXT: vmaof %v24, %v24, %v26, %v28
1277 ; CHECK-NEXT: br %r14
1278 %res = call <2 x i64> @llvm.s390.vmaof(<4 x i32> %a, <4 x i32> %b,
1284 define <8 x i16> @test_vmalob(<16 x i8> %a, <16 x i8> %b, <8 x i16> %c) {
1285 ; CHECK-LABEL: test_vmalob:
1287 ; CHECK-NEXT: vmalob %v24, %v24, %v26, %v28
1288 ; CHECK-NEXT: br %r14
1289 %res = call <8 x i16> @llvm.s390.vmalob(<16 x i8> %a, <16 x i8> %b,
1295 define <4 x i32> @test_vmaloh(<8 x i16> %a, <8 x i16> %b, <4 x i32> %c) {
1296 ; CHECK-LABEL: test_vmaloh:
1298 ; CHECK-NEXT: vmaloh %v24, %v24, %v26, %v28
1299 ; CHECK-NEXT: br %r14
1300 %res = call <4 x i32> @llvm.s390.vmaloh(<8 x i16> %a, <8 x i16> %b,
1306 define <2 x i64> @test_vmalof(<4 x i32> %a, <4 x i32> %b, <2 x i64> %c) {
1307 ; CHECK-LABEL: test_vmalof:
1309 ; CHECK-NEXT: vmalof %v24, %v24, %v26, %v28
1310 ; CHECK-NEXT: br %r14
1311 %res = call <2 x i64> @llvm.s390.vmalof(<4 x i32> %a, <4 x i32> %b,
1317 define <16 x i8> @test_vmhb(<16 x i8> %a, <16 x i8> %b) {
1318 ; CHECK-LABEL: test_vmhb:
1320 ; CHECK-NEXT: vmhb %v24, %v24, %v26
1321 ; CHECK-NEXT: br %r14
1322 %res = call <16 x i8> @llvm.s390.vmhb(<16 x i8> %a, <16 x i8> %b)
1327 define <8 x i16> @test_vmhh(<8 x i16> %a, <8 x i16> %b) {
1328 ; CHECK-LABEL: test_vmhh:
1330 ; CHECK-NEXT: vmhh %v24, %v24, %v26
1331 ; CHECK-NEXT: br %r14
1332 %res = call <8 x i16> @llvm.s390.vmhh(<8 x i16> %a, <8 x i16> %b)
1337 define <4 x i32> @test_vmhf(<4 x i32> %a, <4 x i32> %b) {
1338 ; CHECK-LABEL: test_vmhf:
1340 ; CHECK-NEXT: vmhf %v24, %v24, %v26
1341 ; CHECK-NEXT: br %r14
1342 %res = call <4 x i32> @llvm.s390.vmhf(<4 x i32> %a, <4 x i32> %b)
1347 define <16 x i8> @test_vmlhb(<16 x i8> %a, <16 x i8> %b) {
1348 ; CHECK-LABEL: test_vmlhb:
1350 ; CHECK-NEXT: vmlhb %v24, %v24, %v26
1351 ; CHECK-NEXT: br %r14
1352 %res = call <16 x i8> @llvm.s390.vmlhb(<16 x i8> %a, <16 x i8> %b)
1357 define <8 x i16> @test_vmlhh(<8 x i16> %a, <8 x i16> %b) {
1358 ; CHECK-LABEL: test_vmlhh:
1360 ; CHECK-NEXT: vmlhh %v24, %v24, %v26
1361 ; CHECK-NEXT: br %r14
1362 %res = call <8 x i16> @llvm.s390.vmlhh(<8 x i16> %a, <8 x i16> %b)
1367 define <4 x i32> @test_vmlhf(<4 x i32> %a, <4 x i32> %b) {
1368 ; CHECK-LABEL: test_vmlhf:
1370 ; CHECK-NEXT: vmlhf %v24, %v24, %v26
1371 ; CHECK-NEXT: br %r14
1372 %res = call <4 x i32> @llvm.s390.vmlhf(<4 x i32> %a, <4 x i32> %b)
1377 define <8 x i16> @test_vmeb(<16 x i8> %a, <16 x i8> %b) {
1378 ; CHECK-LABEL: test_vmeb:
1380 ; CHECK-NEXT: vmeb %v24, %v24, %v26
1381 ; CHECK-NEXT: br %r14
1382 %res = call <8 x i16> @llvm.s390.vmeb(<16 x i8> %a, <16 x i8> %b)
1387 define <4 x i32> @test_vmeh(<8 x i16> %a, <8 x i16> %b) {
1388 ; CHECK-LABEL: test_vmeh:
1390 ; CHECK-NEXT: vmeh %v24, %v24, %v26
1391 ; CHECK-NEXT: br %r14
1392 %res = call <4 x i32> @llvm.s390.vmeh(<8 x i16> %a, <8 x i16> %b)
1397 define <2 x i64> @test_vmef(<4 x i32> %a, <4 x i32> %b) {
1398 ; CHECK-LABEL: test_vmef:
1400 ; CHECK-NEXT: vmef %v24, %v24, %v26
1401 ; CHECK-NEXT: br %r14
1402 %res = call <2 x i64> @llvm.s390.vmef(<4 x i32> %a, <4 x i32> %b)
1407 define <8 x i16> @test_vmleb(<16 x i8> %a, <16 x i8> %b) {
1408 ; CHECK-LABEL: test_vmleb:
1410 ; CHECK-NEXT: vmleb %v24, %v24, %v26
1411 ; CHECK-NEXT: br %r14
1412 %res = call <8 x i16> @llvm.s390.vmleb(<16 x i8> %a, <16 x i8> %b)
1417 define <4 x i32> @test_vmleh(<8 x i16> %a, <8 x i16> %b) {
1418 ; CHECK-LABEL: test_vmleh:
1420 ; CHECK-NEXT: vmleh %v24, %v24, %v26
1421 ; CHECK-NEXT: br %r14
1422 %res = call <4 x i32> @llvm.s390.vmleh(<8 x i16> %a, <8 x i16> %b)
1427 define <2 x i64> @test_vmlef(<4 x i32> %a, <4 x i32> %b) {
1428 ; CHECK-LABEL: test_vmlef:
1430 ; CHECK-NEXT: vmlef %v24, %v24, %v26
1431 ; CHECK-NEXT: br %r14
1432 %res = call <2 x i64> @llvm.s390.vmlef(<4 x i32> %a, <4 x i32> %b)
1437 define <8 x i16> @test_vmob(<16 x i8> %a, <16 x i8> %b) {
1438 ; CHECK-LABEL: test_vmob:
1440 ; CHECK-NEXT: vmob %v24, %v24, %v26
1441 ; CHECK-NEXT: br %r14
1442 %res = call <8 x i16> @llvm.s390.vmob(<16 x i8> %a, <16 x i8> %b)
1447 define <4 x i32> @test_vmoh(<8 x i16> %a, <8 x i16> %b) {
1448 ; CHECK-LABEL: test_vmoh:
1450 ; CHECK-NEXT: vmoh %v24, %v24, %v26
1451 ; CHECK-NEXT: br %r14
1452 %res = call <4 x i32> @llvm.s390.vmoh(<8 x i16> %a, <8 x i16> %b)
1457 define <2 x i64> @test_vmof(<4 x i32> %a, <4 x i32> %b) {
1458 ; CHECK-LABEL: test_vmof:
1460 ; CHECK-NEXT: vmof %v24, %v24, %v26
1461 ; CHECK-NEXT: br %r14
1462 %res = call <2 x i64> @llvm.s390.vmof(<4 x i32> %a, <4 x i32> %b)
1467 define <8 x i16> @test_vmlob(<16 x i8> %a, <16 x i8> %b) {
1468 ; CHECK-LABEL: test_vmlob:
1470 ; CHECK-NEXT: vmlob %v24, %v24, %v26
1471 ; CHECK-NEXT: br %r14
1472 %res = call <8 x i16> @llvm.s390.vmlob(<16 x i8> %a, <16 x i8> %b)
1477 define <4 x i32> @test_vmloh(<8 x i16> %a, <8 x i16> %b) {
1478 ; CHECK-LABEL: test_vmloh:
1480 ; CHECK-NEXT: vmloh %v24, %v24, %v26
1481 ; CHECK-NEXT: br %r14
1482 %res = call <4 x i32> @llvm.s390.vmloh(<8 x i16> %a, <8 x i16> %b)
1487 define <2 x i64> @test_vmlof(<4 x i32> %a, <4 x i32> %b) {
1488 ; CHECK-LABEL: test_vmlof:
1490 ; CHECK-NEXT: vmlof %v24, %v24, %v26
1491 ; CHECK-NEXT: br %r14
1492 %res = call <2 x i64> @llvm.s390.vmlof(<4 x i32> %a, <4 x i32> %b)
1497 define <16 x i8> @test_verimb(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {
1498 ; CHECK-LABEL: test_verimb:
1500 ; CHECK-NEXT: verimb %v24, %v26, %v28, 1
1501 ; CHECK-NEXT: br %r14
1502 %res = call <16 x i8> @llvm.s390.verimb(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c, i32 1)
1507 define <8 x i16> @test_verimh(<8 x i16> %a, <8 x i16> %b, <8 x i16> %c) {
1508 ; CHECK-LABEL: test_verimh:
1510 ; CHECK-NEXT: verimh %v24, %v26, %v28, 1
1511 ; CHECK-NEXT: br %r14
1512 %res = call <8 x i16> @llvm.s390.verimh(<8 x i16> %a, <8 x i16> %b, <8 x i16> %c, i32 1)
1517 define <4 x i32> @test_verimf(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
1518 ; CHECK-LABEL: test_verimf:
1520 ; CHECK-NEXT: verimf %v24, %v26, %v28, 1
1521 ; CHECK-NEXT: br %r14
1522 %res = call <4 x i32> @llvm.s390.verimf(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c, i32 1)
1527 define <2 x i64> @test_verimg(<2 x i64> %a, <2 x i64> %b, <2 x i64> %c) {
1528 ; CHECK-LABEL: test_verimg:
1530 ; CHECK-NEXT: verimg %v24, %v26, %v28, 1
1531 ; CHECK-NEXT: br %r14
1532 %res = call <2 x i64> @llvm.s390.verimg(<2 x i64> %a, <2 x i64> %b, <2 x i64> %c, i32 1)
1536 ; VERIMB with a different mask.
1537 define <16 x i8> @test_verimb_254(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {
1538 ; CHECK-LABEL: test_verimb_254:
1540 ; CHECK-NEXT: verimb %v24, %v26, %v28, 254
1541 ; CHECK-NEXT: br %r14
1542 %res = call <16 x i8> @llvm.s390.verimb(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c, i32 254)
1547 define <16 x i8> @test_vsl(<16 x i8> %a, <16 x i8> %b) {
1548 ; CHECK-LABEL: test_vsl:
1550 ; CHECK-NEXT: vsl %v24, %v24, %v26
1551 ; CHECK-NEXT: br %r14
1552 %res = call <16 x i8> @llvm.s390.vsl(<16 x i8> %a, <16 x i8> %b)
1557 define <16 x i8> @test_vslb(<16 x i8> %a, <16 x i8> %b) {
1558 ; CHECK-LABEL: test_vslb:
1560 ; CHECK-NEXT: vslb %v24, %v24, %v26
1561 ; CHECK-NEXT: br %r14
1562 %res = call <16 x i8> @llvm.s390.vslb(<16 x i8> %a, <16 x i8> %b)
1567 define <16 x i8> @test_vsra(<16 x i8> %a, <16 x i8> %b) {
1568 ; CHECK-LABEL: test_vsra:
1570 ; CHECK-NEXT: vsra %v24, %v24, %v26
1571 ; CHECK-NEXT: br %r14
1572 %res = call <16 x i8> @llvm.s390.vsra(<16 x i8> %a, <16 x i8> %b)
1577 define <16 x i8> @test_vsrab(<16 x i8> %a, <16 x i8> %b) {
1578 ; CHECK-LABEL: test_vsrab:
1580 ; CHECK-NEXT: vsrab %v24, %v24, %v26
1581 ; CHECK-NEXT: br %r14
1582 %res = call <16 x i8> @llvm.s390.vsrab(<16 x i8> %a, <16 x i8> %b)
1587 define <16 x i8> @test_vsrl(<16 x i8> %a, <16 x i8> %b) {
1588 ; CHECK-LABEL: test_vsrl:
1590 ; CHECK-NEXT: vsrl %v24, %v24, %v26
1591 ; CHECK-NEXT: br %r14
1592 %res = call <16 x i8> @llvm.s390.vsrl(<16 x i8> %a, <16 x i8> %b)
1597 define <16 x i8> @test_vsrlb(<16 x i8> %a, <16 x i8> %b) {
1598 ; CHECK-LABEL: test_vsrlb:
1600 ; CHECK-NEXT: vsrlb %v24, %v24, %v26
1601 ; CHECK-NEXT: br %r14
1602 %res = call <16 x i8> @llvm.s390.vsrlb(<16 x i8> %a, <16 x i8> %b)
1606 ; VSLDB with the minimum useful value.
1607 define <16 x i8> @test_vsldb_1(<16 x i8> %a, <16 x i8> %b) {
1608 ; CHECK-LABEL: test_vsldb_1:
1610 ; CHECK-NEXT: vsldb %v24, %v24, %v26, 1
1611 ; CHECK-NEXT: br %r14
1612 %res = call <16 x i8> @llvm.s390.vsldb(<16 x i8> %a, <16 x i8> %b, i32 1)
1616 ; VSLDB with the maximum value.
1617 define <16 x i8> @test_vsldb_15(<16 x i8> %a, <16 x i8> %b) {
1618 ; CHECK-LABEL: test_vsldb_15:
1620 ; CHECK-NEXT: vsldb %v24, %v24, %v26, 15
1621 ; CHECK-NEXT: br %r14
1622 %res = call <16 x i8> @llvm.s390.vsldb(<16 x i8> %a, <16 x i8> %b, i32 15)
1627 define <16 x i8> @test_vscbib(<16 x i8> %a, <16 x i8> %b) {
1628 ; CHECK-LABEL: test_vscbib:
1630 ; CHECK-NEXT: vscbib %v24, %v24, %v26
1631 ; CHECK-NEXT: br %r14
1632 %res = call <16 x i8> @llvm.s390.vscbib(<16 x i8> %a, <16 x i8> %b)
1637 define <8 x i16> @test_vscbih(<8 x i16> %a, <8 x i16> %b) {
1638 ; CHECK-LABEL: test_vscbih:
1640 ; CHECK-NEXT: vscbih %v24, %v24, %v26
1641 ; CHECK-NEXT: br %r14
1642 %res = call <8 x i16> @llvm.s390.vscbih(<8 x i16> %a, <8 x i16> %b)
1647 define <4 x i32> @test_vscbif(<4 x i32> %a, <4 x i32> %b) {
1648 ; CHECK-LABEL: test_vscbif:
1650 ; CHECK-NEXT: vscbif %v24, %v24, %v26
1651 ; CHECK-NEXT: br %r14
1652 %res = call <4 x i32> @llvm.s390.vscbif(<4 x i32> %a, <4 x i32> %b)
1657 define <2 x i64> @test_vscbig(<2 x i64> %a, <2 x i64> %b) {
1658 ; CHECK-LABEL: test_vscbig:
1660 ; CHECK-NEXT: vscbig %v24, %v24, %v26
1661 ; CHECK-NEXT: br %r14
1662 %res = call <2 x i64> @llvm.s390.vscbig(<2 x i64> %a, <2 x i64> %b)
1667 define i128 @test_vsq(i128 %a, i128 %b) {
1668 ; CHECK-LABEL: test_vsq:
1670 ; CHECK-NEXT: vl %v0, 0(%r4), 3
1671 ; CHECK-NEXT: vl %v1, 0(%r3), 3
1672 ; CHECK-NEXT: vsq %v0, %v1, %v0
1673 ; CHECK-NEXT: vst %v0, 0(%r2), 3
1674 ; CHECK-NEXT: br %r14
1675 %res = call i128 @llvm.s390.vsq(i128 %a, i128 %b)
1680 define i128 @test_vsbiq(i128 %a, i128 %b, i128 %c) {
1681 ; CHECK-LABEL: test_vsbiq:
1683 ; CHECK-NEXT: vl %v0, 0(%r5), 3
1684 ; CHECK-NEXT: vl %v1, 0(%r4), 3
1685 ; CHECK-NEXT: vl %v2, 0(%r3), 3
1686 ; CHECK-NEXT: vsbiq %v0, %v2, %v1, %v0
1687 ; CHECK-NEXT: vst %v0, 0(%r2), 3
1688 ; CHECK-NEXT: br %r14
1689 %res = call i128 @llvm.s390.vsbiq(i128 %a, i128 %b, i128 %c)
1694 define i128 @test_vscbiq(i128 %a, i128 %b) {
1695 ; CHECK-LABEL: test_vscbiq:
1697 ; CHECK-NEXT: vl %v0, 0(%r4), 3
1698 ; CHECK-NEXT: vl %v1, 0(%r3), 3
1699 ; CHECK-NEXT: vscbiq %v0, %v1, %v0
1700 ; CHECK-NEXT: vst %v0, 0(%r2), 3
1701 ; CHECK-NEXT: br %r14
1702 %res = call i128 @llvm.s390.vscbiq(i128 %a, i128 %b)
1707 define i128 @test_vsbcbiq(i128 %a, i128 %b, i128 %c) {
1708 ; CHECK-LABEL: test_vsbcbiq:
1710 ; CHECK-NEXT: vl %v0, 0(%r5), 3
1711 ; CHECK-NEXT: vl %v1, 0(%r4), 3
1712 ; CHECK-NEXT: vl %v2, 0(%r3), 3
1713 ; CHECK-NEXT: vsbcbiq %v0, %v2, %v1, %v0
1714 ; CHECK-NEXT: vst %v0, 0(%r2), 3
1715 ; CHECK-NEXT: br %r14
1716 %res = call i128 @llvm.s390.vsbcbiq(i128 %a, i128 %b, i128 %c)
1721 define <4 x i32> @test_vsumb(<16 x i8> %a, <16 x i8> %b) {
1722 ; CHECK-LABEL: test_vsumb:
1724 ; CHECK-NEXT: vsumb %v24, %v24, %v26
1725 ; CHECK-NEXT: br %r14
1726 %res = call <4 x i32> @llvm.s390.vsumb(<16 x i8> %a, <16 x i8> %b)
1731 define <4 x i32> @test_vsumh(<8 x i16> %a, <8 x i16> %b) {
1732 ; CHECK-LABEL: test_vsumh:
1734 ; CHECK-NEXT: vsumh %v24, %v24, %v26
1735 ; CHECK-NEXT: br %r14
1736 %res = call <4 x i32> @llvm.s390.vsumh(<8 x i16> %a, <8 x i16> %b)
1741 define <2 x i64> @test_vsumgh(<8 x i16> %a, <8 x i16> %b) {
1742 ; CHECK-LABEL: test_vsumgh:
1744 ; CHECK-NEXT: vsumgh %v24, %v24, %v26
1745 ; CHECK-NEXT: br %r14
1746 %res = call <2 x i64> @llvm.s390.vsumgh(<8 x i16> %a, <8 x i16> %b)
1751 define <2 x i64> @test_vsumgf(<4 x i32> %a, <4 x i32> %b) {
1752 ; CHECK-LABEL: test_vsumgf:
1754 ; CHECK-NEXT: vsumgf %v24, %v24, %v26
1755 ; CHECK-NEXT: br %r14
1756 %res = call <2 x i64> @llvm.s390.vsumgf(<4 x i32> %a, <4 x i32> %b)
1761 define i128 @test_vsumqf(<4 x i32> %a, <4 x i32> %b) {
1762 ; CHECK-LABEL: test_vsumqf:
1764 ; CHECK-NEXT: vsumqf %v0, %v24, %v26
1765 ; CHECK-NEXT: vst %v0, 0(%r2), 3
1766 ; CHECK-NEXT: br %r14
1767 %res = call i128 @llvm.s390.vsumqf(<4 x i32> %a, <4 x i32> %b)
1772 define i128 @test_vsumqg(<2 x i64> %a, <2 x i64> %b) {
1773 ; CHECK-LABEL: test_vsumqg:
1775 ; CHECK-NEXT: vsumqg %v0, %v24, %v26
1776 ; CHECK-NEXT: vst %v0, 0(%r2), 3
1777 ; CHECK-NEXT: br %r14
1778 %res = call i128 @llvm.s390.vsumqg(<2 x i64> %a, <2 x i64> %b)
1782 ; VTM with no processing of the result.
1783 define i32 @test_vtm(<16 x i8> %a, <16 x i8> %b) {
1784 ; CHECK-LABEL: test_vtm:
1786 ; CHECK-NEXT: vtm %v24, %v26
1787 ; CHECK-NEXT: ipm %r2
1788 ; CHECK-NEXT: srl %r2, 28
1789 ; CHECK-NEXT: br %r14
1790 %res = call i32 @llvm.s390.vtm(<16 x i8> %a, <16 x i8> %b)
1794 ; VTM, storing to %ptr if all bits are set.
1795 define void @test_vtm_all_store(<16 x i8> %a, <16 x i8> %b, ptr %ptr) {
1796 ; CHECK-LABEL: test_vtm_all_store:
1798 ; CHECK-NEXT: vtm %v24, %v26
1799 ; CHECK-NEXT: bler %r14
1800 ; CHECK-NEXT: .LBB140_1: # %store
1801 ; CHECK-NEXT: mvhi 0(%r2), 0
1802 ; CHECK-NEXT: br %r14
1803 %res = call i32 @llvm.s390.vtm(<16 x i8> %a, <16 x i8> %b)
1804 %cmp = icmp sge i32 %res, 3
1805 br i1 %cmp, label %store, label %exit
1808 store i32 0, ptr %ptr
1815 ; VCEQBS with no processing of the result.
1816 define i32 @test_vceqbs(<16 x i8> %a, <16 x i8> %b) {
1817 ; CHECK-LABEL: test_vceqbs:
1819 ; CHECK-NEXT: vceqbs %v0, %v24, %v26
1820 ; CHECK-NEXT: ipm %r2
1821 ; CHECK-NEXT: srl %r2, 28
1822 ; CHECK-NEXT: br %r14
1823 %call = call {<16 x i8>, i32} @llvm.s390.vceqbs(<16 x i8> %a, <16 x i8> %b)
1824 %res = extractvalue {<16 x i8>, i32} %call, 1
1828 ; VCEQBS, returning 1 if any elements are equal (CC != 3).
1829 define i32 @test_vceqbs_any_bool(<16 x i8> %a, <16 x i8> %b) {
1830 ; CHECK-LABEL: test_vceqbs_any_bool:
1832 ; CHECK-NEXT: vceqbs %v0, %v24, %v26
1833 ; CHECK-NEXT: lhi %r2, 0
1834 ; CHECK-NEXT: lochile %r2, 1
1835 ; CHECK-NEXT: br %r14
1836 %call = call {<16 x i8>, i32} @llvm.s390.vceqbs(<16 x i8> %a, <16 x i8> %b)
1837 %res = extractvalue {<16 x i8>, i32} %call, 1
1838 %cmp = icmp ne i32 %res, 3
1839 %ext = zext i1 %cmp to i32
1843 ; VCEQBS, storing to %ptr if any elements are equal.
1844 define <16 x i8> @test_vceqbs_any_store(<16 x i8> %a, <16 x i8> %b, ptr %ptr) {
1845 ; CHECK-LABEL: test_vceqbs_any_store:
1847 ; CHECK-NEXT: vceqbs %v24, %v24, %v26
1848 ; CHECK-NEXT: bor %r14
1849 ; CHECK-NEXT: .LBB143_1: # %store
1850 ; CHECK-NEXT: mvhi 0(%r2), 0
1851 ; CHECK-NEXT: br %r14
1852 %call = call {<16 x i8>, i32} @llvm.s390.vceqbs(<16 x i8> %a, <16 x i8> %b)
1853 %res = extractvalue {<16 x i8>, i32} %call, 0
1854 %cc = extractvalue {<16 x i8>, i32} %call, 1
1855 %cmp = icmp ule i32 %cc, 2
1856 br i1 %cmp, label %store, label %exit
1859 store i32 0, ptr %ptr
1866 ; VCEQHS with no processing of the result.
1867 define i32 @test_vceqhs(<8 x i16> %a, <8 x i16> %b) {
1868 ; CHECK-LABEL: test_vceqhs:
1870 ; CHECK-NEXT: vceqhs %v0, %v24, %v26
1871 ; CHECK-NEXT: ipm %r2
1872 ; CHECK-NEXT: srl %r2, 28
1873 ; CHECK-NEXT: br %r14
1874 %call = call {<8 x i16>, i32} @llvm.s390.vceqhs(<8 x i16> %a, <8 x i16> %b)
1875 %res = extractvalue {<8 x i16>, i32} %call, 1
1879 ; VCEQHS, returning 1 if not all elements are equal.
1880 define i32 @test_vceqhs_notall_bool(<8 x i16> %a, <8 x i16> %b) {
1881 ; CHECK-LABEL: test_vceqhs_notall_bool:
1883 ; CHECK-NEXT: vceqhs %v0, %v24, %v26
1884 ; CHECK-NEXT: lhi %r2, 0
1885 ; CHECK-NEXT: lochinhe %r2, 1
1886 ; CHECK-NEXT: br %r14
1887 %call = call {<8 x i16>, i32} @llvm.s390.vceqhs(<8 x i16> %a, <8 x i16> %b)
1888 %res = extractvalue {<8 x i16>, i32} %call, 1
1889 %cmp = icmp sge i32 %res, 1
1890 %ext = zext i1 %cmp to i32
1894 ; VCEQHS, storing to %ptr if not all elements are equal.
1895 define <8 x i16> @test_vceqhs_notall_store(<8 x i16> %a, <8 x i16> %b,
1896 ; CHECK-LABEL: test_vceqhs_notall_store:
1898 ; CHECK-NEXT: vceqhs %v24, %v24, %v26
1899 ; CHECK-NEXT: ber %r14
1900 ; CHECK-NEXT: .LBB146_1: # %store
1901 ; CHECK-NEXT: mvhi 0(%r2), 0
1902 ; CHECK-NEXT: br %r14
1904 %call = call {<8 x i16>, i32} @llvm.s390.vceqhs(<8 x i16> %a, <8 x i16> %b)
1905 %res = extractvalue {<8 x i16>, i32} %call, 0
1906 %cc = extractvalue {<8 x i16>, i32} %call, 1
1907 %cmp = icmp ugt i32 %cc, 0
1908 br i1 %cmp, label %store, label %exit
1911 store i32 0, ptr %ptr
1918 ; VCEQFS with no processing of the result.
1919 define i32 @test_vceqfs(<4 x i32> %a, <4 x i32> %b) {
1920 ; CHECK-LABEL: test_vceqfs:
1922 ; CHECK-NEXT: vceqfs %v0, %v24, %v26
1923 ; CHECK-NEXT: ipm %r2
1924 ; CHECK-NEXT: srl %r2, 28
1925 ; CHECK-NEXT: br %r14
1926 %call = call {<4 x i32>, i32} @llvm.s390.vceqfs(<4 x i32> %a, <4 x i32> %b)
1927 %res = extractvalue {<4 x i32>, i32} %call, 1
1931 ; VCEQFS, returning 1 if no elements are equal.
1932 define i32 @test_vceqfs_none_bool(<4 x i32> %a, <4 x i32> %b) {
1933 ; CHECK-LABEL: test_vceqfs_none_bool:
1935 ; CHECK-NEXT: vceqfs %v0, %v24, %v26
1936 ; CHECK-NEXT: lhi %r2, 0
1937 ; CHECK-NEXT: lochio %r2, 1
1938 ; CHECK-NEXT: br %r14
1939 %call = call {<4 x i32>, i32} @llvm.s390.vceqfs(<4 x i32> %a, <4 x i32> %b)
1940 %res = extractvalue {<4 x i32>, i32} %call, 1
1941 %cmp = icmp eq i32 %res, 3
1942 %ext = zext i1 %cmp to i32
1946 ; VCEQFS, storing to %ptr if no elements are equal.
1947 define <4 x i32> @test_vceqfs_none_store(<4 x i32> %a, <4 x i32> %b,
1948 ; CHECK-LABEL: test_vceqfs_none_store:
1950 ; CHECK-NEXT: vceqfs %v24, %v24, %v26
1951 ; CHECK-NEXT: bler %r14
1952 ; CHECK-NEXT: .LBB149_1: # %store
1953 ; CHECK-NEXT: mvhi 0(%r2), 0
1954 ; CHECK-NEXT: br %r14
1956 %call = call {<4 x i32>, i32} @llvm.s390.vceqfs(<4 x i32> %a, <4 x i32> %b)
1957 %res = extractvalue {<4 x i32>, i32} %call, 0
1958 %cc = extractvalue {<4 x i32>, i32} %call, 1
1959 %cmp = icmp uge i32 %cc, 3
1960 br i1 %cmp, label %store, label %exit
1963 store i32 0, ptr %ptr
1970 ; VCEQGS with no processing of the result.
1971 define i32 @test_vceqgs(<2 x i64> %a, <2 x i64> %b) {
1972 ; CHECK-LABEL: test_vceqgs:
1974 ; CHECK-NEXT: vceqgs %v0, %v24, %v26
1975 ; CHECK-NEXT: ipm %r2
1976 ; CHECK-NEXT: srl %r2, 28
1977 ; CHECK-NEXT: br %r14
1978 %call = call {<2 x i64>, i32} @llvm.s390.vceqgs(<2 x i64> %a, <2 x i64> %b)
1979 %res = extractvalue {<2 x i64>, i32} %call, 1
1983 ; VCEQGS returning 1 if all elements are equal (CC == 0).
1984 define i32 @test_vceqgs_all_bool(<2 x i64> %a, <2 x i64> %b) {
1985 ; CHECK-LABEL: test_vceqgs_all_bool:
1987 ; CHECK-NEXT: vceqgs %v0, %v24, %v26
1988 ; CHECK-NEXT: lhi %r2, 0
1989 ; CHECK-NEXT: lochie %r2, 1
1990 ; CHECK-NEXT: br %r14
1991 %call = call {<2 x i64>, i32} @llvm.s390.vceqgs(<2 x i64> %a, <2 x i64> %b)
1992 %res = extractvalue {<2 x i64>, i32} %call, 1
1993 %cmp = icmp ult i32 %res, 1
1994 %ext = zext i1 %cmp to i32
1998 ; VCEQGS, storing to %ptr if all elements are equal.
1999 define <2 x i64> @test_vceqgs_all_store(<2 x i64> %a, <2 x i64> %b, ptr %ptr) {
2000 ; CHECK-LABEL: test_vceqgs_all_store:
2002 ; CHECK-NEXT: vceqgs %v24, %v24, %v26
2003 ; CHECK-NEXT: bnher %r14
2004 ; CHECK-NEXT: .LBB152_1: # %store
2005 ; CHECK-NEXT: mvhi 0(%r2), 0
2006 ; CHECK-NEXT: br %r14
2007 %call = call {<2 x i64>, i32} @llvm.s390.vceqgs(<2 x i64> %a, <2 x i64> %b)
2008 %res = extractvalue {<2 x i64>, i32} %call, 0
2009 %cc = extractvalue {<2 x i64>, i32} %call, 1
2010 %cmp = icmp sle i32 %cc, 0
2011 br i1 %cmp, label %store, label %exit
2014 store i32 0, ptr %ptr
2021 ; VCHBS with no processing of the result.
2022 define i32 @test_vchbs(<16 x i8> %a, <16 x i8> %b) {
2023 ; CHECK-LABEL: test_vchbs:
2025 ; CHECK-NEXT: vchbs %v0, %v24, %v26
2026 ; CHECK-NEXT: ipm %r2
2027 ; CHECK-NEXT: srl %r2, 28
2028 ; CHECK-NEXT: br %r14
2029 %call = call {<16 x i8>, i32} @llvm.s390.vchbs(<16 x i8> %a, <16 x i8> %b)
2030 %res = extractvalue {<16 x i8>, i32} %call, 1
2034 ; VCHBS, returning 1 if any elements are higher (CC != 3).
2035 define i32 @test_vchbs_any_bool(<16 x i8> %a, <16 x i8> %b) {
2036 ; CHECK-LABEL: test_vchbs_any_bool:
2038 ; CHECK-NEXT: vchbs %v0, %v24, %v26
2039 ; CHECK-NEXT: lhi %r2, 0
2040 ; CHECK-NEXT: lochile %r2, 1
2041 ; CHECK-NEXT: br %r14
2042 %call = call {<16 x i8>, i32} @llvm.s390.vchbs(<16 x i8> %a, <16 x i8> %b)
2043 %res = extractvalue {<16 x i8>, i32} %call, 1
2044 %cmp = icmp ne i32 %res, 3
2045 %ext = zext i1 %cmp to i32
2049 ; VCHBS, storing to %ptr if any elements are higher.
2050 define <16 x i8> @test_vchbs_any_store(<16 x i8> %a, <16 x i8> %b, ptr %ptr) {
2051 ; CHECK-LABEL: test_vchbs_any_store:
2053 ; CHECK-NEXT: vchbs %v24, %v24, %v26
2054 ; CHECK-NEXT: bor %r14
2055 ; CHECK-NEXT: .LBB155_1: # %store
2056 ; CHECK-NEXT: mvhi 0(%r2), 0
2057 ; CHECK-NEXT: br %r14
2058 %call = call {<16 x i8>, i32} @llvm.s390.vchbs(<16 x i8> %a, <16 x i8> %b)
2059 %res = extractvalue {<16 x i8>, i32} %call, 0
2060 %cc = extractvalue {<16 x i8>, i32} %call, 1
2061 %cmp = icmp ule i32 %cc, 2
2062 br i1 %cmp, label %store, label %exit
2065 store i32 0, ptr %ptr
2072 ; VCHHS with no processing of the result.
2073 define i32 @test_vchhs(<8 x i16> %a, <8 x i16> %b) {
2074 ; CHECK-LABEL: test_vchhs:
2076 ; CHECK-NEXT: vchhs %v0, %v24, %v26
2077 ; CHECK-NEXT: ipm %r2
2078 ; CHECK-NEXT: srl %r2, 28
2079 ; CHECK-NEXT: br %r14
2080 %call = call {<8 x i16>, i32} @llvm.s390.vchhs(<8 x i16> %a, <8 x i16> %b)
2081 %res = extractvalue {<8 x i16>, i32} %call, 1
2085 ; VCHHS, returning 1 if not all elements are higher.
2086 define i32 @test_vchhs_notall_bool(<8 x i16> %a, <8 x i16> %b) {
2087 ; CHECK-LABEL: test_vchhs_notall_bool:
2089 ; CHECK-NEXT: vchhs %v0, %v24, %v26
2090 ; CHECK-NEXT: lhi %r2, 0
2091 ; CHECK-NEXT: lochinhe %r2, 1
2092 ; CHECK-NEXT: br %r14
2093 %call = call {<8 x i16>, i32} @llvm.s390.vchhs(<8 x i16> %a, <8 x i16> %b)
2094 %res = extractvalue {<8 x i16>, i32} %call, 1
2095 %cmp = icmp sge i32 %res, 1
2096 %ext = zext i1 %cmp to i32
2100 ; VCHHS, storing to %ptr if not all elements are higher.
2101 define <8 x i16> @test_vchhs_notall_store(<8 x i16> %a, <8 x i16> %b,
2102 ; CHECK-LABEL: test_vchhs_notall_store:
2104 ; CHECK-NEXT: vchhs %v24, %v24, %v26
2105 ; CHECK-NEXT: ber %r14
2106 ; CHECK-NEXT: .LBB158_1: # %store
2107 ; CHECK-NEXT: mvhi 0(%r2), 0
2108 ; CHECK-NEXT: br %r14
2110 %call = call {<8 x i16>, i32} @llvm.s390.vchhs(<8 x i16> %a, <8 x i16> %b)
2111 %res = extractvalue {<8 x i16>, i32} %call, 0
2112 %cc = extractvalue {<8 x i16>, i32} %call, 1
2113 %cmp = icmp ugt i32 %cc, 0
2114 br i1 %cmp, label %store, label %exit
2117 store i32 0, ptr %ptr
2124 ; VCHFS with no processing of the result.
2125 define i32 @test_vchfs(<4 x i32> %a, <4 x i32> %b) {
2126 ; CHECK-LABEL: test_vchfs:
2128 ; CHECK-NEXT: vchfs %v0, %v24, %v26
2129 ; CHECK-NEXT: ipm %r2
2130 ; CHECK-NEXT: srl %r2, 28
2131 ; CHECK-NEXT: br %r14
2132 %call = call {<4 x i32>, i32} @llvm.s390.vchfs(<4 x i32> %a, <4 x i32> %b)
2133 %res = extractvalue {<4 x i32>, i32} %call, 1
2137 ; VCHFS, returning 1 if no elements are higher.
2138 define i32 @test_vchfs_none_bool(<4 x i32> %a, <4 x i32> %b) {
2139 ; CHECK-LABEL: test_vchfs_none_bool:
2141 ; CHECK-NEXT: vchfs %v0, %v24, %v26
2142 ; CHECK-NEXT: lhi %r2, 0
2143 ; CHECK-NEXT: lochio %r2, 1
2144 ; CHECK-NEXT: br %r14
2145 %call = call {<4 x i32>, i32} @llvm.s390.vchfs(<4 x i32> %a, <4 x i32> %b)
2146 %res = extractvalue {<4 x i32>, i32} %call, 1
2147 %cmp = icmp eq i32 %res, 3
2148 %ext = zext i1 %cmp to i32
2152 ; VCHFS, storing to %ptr if no elements are higher.
2153 define <4 x i32> @test_vchfs_none_store(<4 x i32> %a, <4 x i32> %b, ptr %ptr) {
2154 ; CHECK-LABEL: test_vchfs_none_store:
2156 ; CHECK-NEXT: vchfs %v24, %v24, %v26
2157 ; CHECK-NEXT: bler %r14
2158 ; CHECK-NEXT: .LBB161_1: # %store
2159 ; CHECK-NEXT: mvhi 0(%r2), 0
2160 ; CHECK-NEXT: br %r14
2161 %call = call {<4 x i32>, i32} @llvm.s390.vchfs(<4 x i32> %a, <4 x i32> %b)
2162 %res = extractvalue {<4 x i32>, i32} %call, 0
2163 %cc = extractvalue {<4 x i32>, i32} %call, 1
2164 %cmp = icmp uge i32 %cc, 3
2165 br i1 %cmp, label %store, label %exit
2168 store i32 0, ptr %ptr
2175 ; VCHGS with no processing of the result.
2176 define i32 @test_vchgs(<2 x i64> %a, <2 x i64> %b) {
2177 ; CHECK-LABEL: test_vchgs:
2179 ; CHECK-NEXT: vchgs %v0, %v24, %v26
2180 ; CHECK-NEXT: ipm %r2
2181 ; CHECK-NEXT: srl %r2, 28
2182 ; CHECK-NEXT: br %r14
2183 %call = call {<2 x i64>, i32} @llvm.s390.vchgs(<2 x i64> %a, <2 x i64> %b)
2184 %res = extractvalue {<2 x i64>, i32} %call, 1
2188 ; VCHGS returning 1 if all elements are higher (CC == 0).
2189 define i32 @test_vchgs_all_bool(<2 x i64> %a, <2 x i64> %b) {
2190 ; CHECK-LABEL: test_vchgs_all_bool:
2192 ; CHECK-NEXT: vchgs %v0, %v24, %v26
2193 ; CHECK-NEXT: lhi %r2, 0
2194 ; CHECK-NEXT: lochie %r2, 1
2195 ; CHECK-NEXT: br %r14
2196 %call = call {<2 x i64>, i32} @llvm.s390.vchgs(<2 x i64> %a, <2 x i64> %b)
2197 %res = extractvalue {<2 x i64>, i32} %call, 1
2198 %cmp = icmp ult i32 %res, 1
2199 %ext = zext i1 %cmp to i32
2203 ; VCHGS, storing to %ptr if all elements are higher.
2204 define <2 x i64> @test_vchgs_all_store(<2 x i64> %a, <2 x i64> %b, ptr %ptr) {
2205 ; CHECK-LABEL: test_vchgs_all_store:
2207 ; CHECK-NEXT: vchgs %v24, %v24, %v26
2208 ; CHECK-NEXT: bnher %r14
2209 ; CHECK-NEXT: .LBB164_1: # %store
2210 ; CHECK-NEXT: mvhi 0(%r2), 0
2211 ; CHECK-NEXT: br %r14
2212 %call = call {<2 x i64>, i32} @llvm.s390.vchgs(<2 x i64> %a, <2 x i64> %b)
2213 %res = extractvalue {<2 x i64>, i32} %call, 0
2214 %cc = extractvalue {<2 x i64>, i32} %call, 1
2215 %cmp = icmp sle i32 %cc, 0
2216 br i1 %cmp, label %store, label %exit
2219 store i32 0, ptr %ptr
2226 ; VCHLBS with no processing of the result.
2227 define i32 @test_vchlbs(<16 x i8> %a, <16 x i8> %b) {
2228 ; CHECK-LABEL: test_vchlbs:
2230 ; CHECK-NEXT: vchlbs %v0, %v24, %v26
2231 ; CHECK-NEXT: ipm %r2
2232 ; CHECK-NEXT: srl %r2, 28
2233 ; CHECK-NEXT: br %r14
2234 %call = call {<16 x i8>, i32} @llvm.s390.vchlbs(<16 x i8> %a, <16 x i8> %b)
2235 %res = extractvalue {<16 x i8>, i32} %call, 1
2239 ; VCHLBS, returning 1 if any elements are higher (CC != 3).
2240 define i32 @test_vchlbs_any_bool(<16 x i8> %a, <16 x i8> %b) {
2241 ; CHECK-LABEL: test_vchlbs_any_bool:
2243 ; CHECK-NEXT: vchlbs %v0, %v24, %v26
2244 ; CHECK-NEXT: lhi %r2, 0
2245 ; CHECK-NEXT: lochile %r2, 1
2246 ; CHECK-NEXT: br %r14
2247 %call = call {<16 x i8>, i32} @llvm.s390.vchlbs(<16 x i8> %a, <16 x i8> %b)
2248 %res = extractvalue {<16 x i8>, i32} %call, 1
2249 %cmp = icmp ne i32 %res, 3
2250 %ext = zext i1 %cmp to i32
2254 ; VCHLBS, storing to %ptr if any elements are higher.
2255 define <16 x i8> @test_vchlbs_any_store(<16 x i8> %a, <16 x i8> %b, ptr %ptr) {
2256 ; CHECK-LABEL: test_vchlbs_any_store:
2258 ; CHECK-NEXT: vchlbs %v24, %v24, %v26
2259 ; CHECK-NEXT: bor %r14
2260 ; CHECK-NEXT: .LBB167_1: # %store
2261 ; CHECK-NEXT: mvhi 0(%r2), 0
2262 ; CHECK-NEXT: br %r14
2263 %call = call {<16 x i8>, i32} @llvm.s390.vchlbs(<16 x i8> %a, <16 x i8> %b)
2264 %res = extractvalue {<16 x i8>, i32} %call, 0
2265 %cc = extractvalue {<16 x i8>, i32} %call, 1
2266 %cmp = icmp sle i32 %cc, 2
2267 br i1 %cmp, label %store, label %exit
2270 store i32 0, ptr %ptr
2277 ; VCHLHS with no processing of the result.
2278 define i32 @test_vchlhs(<8 x i16> %a, <8 x i16> %b) {
2279 ; CHECK-LABEL: test_vchlhs:
2281 ; CHECK-NEXT: vchlhs %v0, %v24, %v26
2282 ; CHECK-NEXT: ipm %r2
2283 ; CHECK-NEXT: srl %r2, 28
2284 ; CHECK-NEXT: br %r14
2285 %call = call {<8 x i16>, i32} @llvm.s390.vchlhs(<8 x i16> %a, <8 x i16> %b)
2286 %res = extractvalue {<8 x i16>, i32} %call, 1
2290 ; VCHLHS, returning 1 if not all elements are higher.
2291 define i32 @test_vchlhs_notall_bool(<8 x i16> %a, <8 x i16> %b) {
2292 ; CHECK-LABEL: test_vchlhs_notall_bool:
2294 ; CHECK-NEXT: vchlhs %v0, %v24, %v26
2295 ; CHECK-NEXT: lhi %r2, 0
2296 ; CHECK-NEXT: lochinhe %r2, 1
2297 ; CHECK-NEXT: br %r14
2298 %call = call {<8 x i16>, i32} @llvm.s390.vchlhs(<8 x i16> %a, <8 x i16> %b)
2299 %res = extractvalue {<8 x i16>, i32} %call, 1
2300 %cmp = icmp uge i32 %res, 1
2301 %ext = zext i1 %cmp to i32
2305 ; VCHLHS, storing to %ptr if not all elements are higher.
2306 define <8 x i16> @test_vchlhs_notall_store(<8 x i16> %a, <8 x i16> %b,
2307 ; CHECK-LABEL: test_vchlhs_notall_store:
2309 ; CHECK-NEXT: vchlhs %v24, %v24, %v26
2310 ; CHECK-NEXT: ber %r14
2311 ; CHECK-NEXT: .LBB170_1: # %store
2312 ; CHECK-NEXT: mvhi 0(%r2), 0
2313 ; CHECK-NEXT: br %r14
2315 %call = call {<8 x i16>, i32} @llvm.s390.vchlhs(<8 x i16> %a, <8 x i16> %b)
2316 %res = extractvalue {<8 x i16>, i32} %call, 0
2317 %cc = extractvalue {<8 x i16>, i32} %call, 1
2318 %cmp = icmp sgt i32 %cc, 0
2319 br i1 %cmp, label %store, label %exit
2322 store i32 0, ptr %ptr
2329 ; VCHLFS with no processing of the result.
2330 define i32 @test_vchlfs(<4 x i32> %a, <4 x i32> %b) {
2331 ; CHECK-LABEL: test_vchlfs:
2333 ; CHECK-NEXT: vchlfs %v0, %v24, %v26
2334 ; CHECK-NEXT: ipm %r2
2335 ; CHECK-NEXT: srl %r2, 28
2336 ; CHECK-NEXT: br %r14
2337 %call = call {<4 x i32>, i32} @llvm.s390.vchlfs(<4 x i32> %a, <4 x i32> %b)
2338 %res = extractvalue {<4 x i32>, i32} %call, 1
2342 ; VCHLFS, returning 1 if no elements are higher.
2343 define i32 @test_vchlfs_none_bool(<4 x i32> %a, <4 x i32> %b) {
2344 ; CHECK-LABEL: test_vchlfs_none_bool:
2346 ; CHECK-NEXT: vchlfs %v0, %v24, %v26
2347 ; CHECK-NEXT: lhi %r2, 0
2348 ; CHECK-NEXT: lochio %r2, 1
2349 ; CHECK-NEXT: br %r14
2350 %call = call {<4 x i32>, i32} @llvm.s390.vchlfs(<4 x i32> %a, <4 x i32> %b)
2351 %res = extractvalue {<4 x i32>, i32} %call, 1
2352 %cmp = icmp eq i32 %res, 3
2353 %ext = zext i1 %cmp to i32
2357 ; VCHLFS, storing to %ptr if no elements are higher.
2358 define <4 x i32> @test_vchlfs_none_store(<4 x i32> %a, <4 x i32> %b,
2359 ; CHECK-LABEL: test_vchlfs_none_store:
2361 ; CHECK-NEXT: vchlfs %v24, %v24, %v26
2362 ; CHECK-NEXT: bler %r14
2363 ; CHECK-NEXT: .LBB173_1: # %store
2364 ; CHECK-NEXT: mvhi 0(%r2), 0
2365 ; CHECK-NEXT: br %r14
2367 %call = call {<4 x i32>, i32} @llvm.s390.vchlfs(<4 x i32> %a, <4 x i32> %b)
2368 %res = extractvalue {<4 x i32>, i32} %call, 0
2369 %cc = extractvalue {<4 x i32>, i32} %call, 1
2370 %cmp = icmp sge i32 %cc, 3
2371 br i1 %cmp, label %store, label %exit
2374 store i32 0, ptr %ptr
2381 ; VCHLGS with no processing of the result.
2382 define i32 @test_vchlgs(<2 x i64> %a, <2 x i64> %b) {
2383 ; CHECK-LABEL: test_vchlgs:
2385 ; CHECK-NEXT: vchlgs %v0, %v24, %v26
2386 ; CHECK-NEXT: ipm %r2
2387 ; CHECK-NEXT: srl %r2, 28
2388 ; CHECK-NEXT: br %r14
2389 %call = call {<2 x i64>, i32} @llvm.s390.vchlgs(<2 x i64> %a, <2 x i64> %b)
2390 %res = extractvalue {<2 x i64>, i32} %call, 1
2394 ; VCHLGS returning 1 if all elements are higher (CC == 0).
2395 define i32 @test_vchlgs_all_bool(<2 x i64> %a, <2 x i64> %b) {
2396 ; CHECK-LABEL: test_vchlgs_all_bool:
2398 ; CHECK-NEXT: vchlgs %v0, %v24, %v26
2399 ; CHECK-NEXT: lhi %r2, 0
2400 ; CHECK-NEXT: lochie %r2, 1
2401 ; CHECK-NEXT: br %r14
2402 %call = call {<2 x i64>, i32} @llvm.s390.vchlgs(<2 x i64> %a, <2 x i64> %b)
2403 %res = extractvalue {<2 x i64>, i32} %call, 1
2404 %cmp = icmp slt i32 %res, 1
2405 %ext = zext i1 %cmp to i32
2409 ; VCHLGS, storing to %ptr if all elements are higher.
2410 define <2 x i64> @test_vchlgs_all_store(<2 x i64> %a, <2 x i64> %b, ptr %ptr) {
2411 ; CHECK-LABEL: test_vchlgs_all_store:
2413 ; CHECK-NEXT: vchlgs %v24, %v24, %v26
2414 ; CHECK-NEXT: bnher %r14
2415 ; CHECK-NEXT: .LBB176_1: # %store
2416 ; CHECK-NEXT: mvhi 0(%r2), 0
2417 ; CHECK-NEXT: br %r14
2418 %call = call {<2 x i64>, i32} @llvm.s390.vchlgs(<2 x i64> %a, <2 x i64> %b)
2419 %res = extractvalue {<2 x i64>, i32} %call, 0
2420 %cc = extractvalue {<2 x i64>, i32} %call, 1
2421 %cmp = icmp ule i32 %cc, 0
2422 br i1 %cmp, label %store, label %exit
2425 store i32 0, ptr %ptr
2432 ; VFAEB with !IN !RT.
2433 define <16 x i8> @test_vfaeb_0(<16 x i8> %a, <16 x i8> %b) {
2434 ; CHECK-LABEL: test_vfaeb_0:
2436 ; CHECK-NEXT: vfaeb %v24, %v24, %v26, 0
2437 ; CHECK-NEXT: br %r14
2438 %res = call <16 x i8> @llvm.s390.vfaeb(<16 x i8> %a, <16 x i8> %b, i32 0)
2442 ; VFAEB with !IN RT.
2443 define <16 x i8> @test_vfaeb_4(<16 x i8> %a, <16 x i8> %b) {
2444 ; CHECK-LABEL: test_vfaeb_4:
2446 ; CHECK-NEXT: vfaeb %v24, %v24, %v26, 4
2447 ; CHECK-NEXT: br %r14
2448 %res = call <16 x i8> @llvm.s390.vfaeb(<16 x i8> %a, <16 x i8> %b, i32 4)
2452 ; VFAEB with IN !RT.
2453 define <16 x i8> @test_vfaeb_8(<16 x i8> %a, <16 x i8> %b) {
2454 ; CHECK-LABEL: test_vfaeb_8:
2456 ; CHECK-NEXT: vfaeb %v24, %v24, %v26, 8
2457 ; CHECK-NEXT: br %r14
2458 %res = call <16 x i8> @llvm.s390.vfaeb(<16 x i8> %a, <16 x i8> %b, i32 8)
2463 define <16 x i8> @test_vfaeb_12(<16 x i8> %a, <16 x i8> %b) {
2464 ; CHECK-LABEL: test_vfaeb_12:
2466 ; CHECK-NEXT: vfaeb %v24, %v24, %v26, 12
2467 ; CHECK-NEXT: br %r14
2468 %res = call <16 x i8> @llvm.s390.vfaeb(<16 x i8> %a, <16 x i8> %b, i32 12)
2472 ; VFAEB with CS -- should be ignored.
2473 define <16 x i8> @test_vfaeb_1(<16 x i8> %a, <16 x i8> %b) {
2474 ; CHECK-LABEL: test_vfaeb_1:
2476 ; CHECK-NEXT: vfaeb %v24, %v24, %v26, 0
2477 ; CHECK-NEXT: br %r14
2478 %res = call <16 x i8> @llvm.s390.vfaeb(<16 x i8> %a, <16 x i8> %b, i32 1)
2483 define <8 x i16> @test_vfaeh(<8 x i16> %a, <8 x i16> %b) {
2484 ; CHECK-LABEL: test_vfaeh:
2486 ; CHECK-NEXT: vfaeh %v24, %v24, %v26, 4
2487 ; CHECK-NEXT: br %r14
2488 %res = call <8 x i16> @llvm.s390.vfaeh(<8 x i16> %a, <8 x i16> %b, i32 4)
2493 define <4 x i32> @test_vfaef(<4 x i32> %a, <4 x i32> %b) {
2494 ; CHECK-LABEL: test_vfaef:
2496 ; CHECK-NEXT: vfaef %v24, %v24, %v26, 8
2497 ; CHECK-NEXT: br %r14
2498 %res = call <4 x i32> @llvm.s390.vfaef(<4 x i32> %a, <4 x i32> %b, i32 8)
2503 define <16 x i8> @test_vfaebs(<16 x i8> %a, <16 x i8> %b, ptr %ccptr) {
2504 ; CHECK-LABEL: test_vfaebs:
2506 ; CHECK-NEXT: vfaebs %v24, %v24, %v26, 0
2507 ; CHECK-NEXT: ipm %r0
2508 ; CHECK-NEXT: srl %r0, 28
2509 ; CHECK-NEXT: st %r0, 0(%r2)
2510 ; CHECK-NEXT: br %r14
2511 %call = call {<16 x i8>, i32} @llvm.s390.vfaebs(<16 x i8> %a, <16 x i8> %b,
2513 %res = extractvalue {<16 x i8>, i32} %call, 0
2514 %cc = extractvalue {<16 x i8>, i32} %call, 1
2515 store i32 %cc, ptr %ccptr
2520 define <8 x i16> @test_vfaehs(<8 x i16> %a, <8 x i16> %b, ptr %ccptr) {
2521 ; CHECK-LABEL: test_vfaehs:
2523 ; CHECK-NEXT: vfaehs %v24, %v24, %v26, 4
2524 ; CHECK-NEXT: ipm %r0
2525 ; CHECK-NEXT: srl %r0, 28
2526 ; CHECK-NEXT: st %r0, 0(%r2)
2527 ; CHECK-NEXT: br %r14
2528 %call = call {<8 x i16>, i32} @llvm.s390.vfaehs(<8 x i16> %a, <8 x i16> %b,
2530 %res = extractvalue {<8 x i16>, i32} %call, 0
2531 %cc = extractvalue {<8 x i16>, i32} %call, 1
2532 store i32 %cc, ptr %ccptr
2537 define <4 x i32> @test_vfaefs(<4 x i32> %a, <4 x i32> %b, ptr %ccptr) {
2538 ; CHECK-LABEL: test_vfaefs:
2540 ; CHECK-NEXT: vfaefs %v24, %v24, %v26, 8
2541 ; CHECK-NEXT: ipm %r0
2542 ; CHECK-NEXT: srl %r0, 28
2543 ; CHECK-NEXT: st %r0, 0(%r2)
2544 ; CHECK-NEXT: br %r14
2545 %call = call {<4 x i32>, i32} @llvm.s390.vfaefs(<4 x i32> %a, <4 x i32> %b,
2547 %res = extractvalue {<4 x i32>, i32} %call, 0
2548 %cc = extractvalue {<4 x i32>, i32} %call, 1
2549 store i32 %cc, ptr %ccptr
2553 ; VFAEZB with !IN !RT.
2554 define <16 x i8> @test_vfaezb_0(<16 x i8> %a, <16 x i8> %b) {
2555 ; CHECK-LABEL: test_vfaezb_0:
2557 ; CHECK-NEXT: vfaezb %v24, %v24, %v26, 0
2558 ; CHECK-NEXT: br %r14
2559 %res = call <16 x i8> @llvm.s390.vfaezb(<16 x i8> %a, <16 x i8> %b, i32 0)
2563 ; VFAEZB with !IN RT.
2564 define <16 x i8> @test_vfaezb_4(<16 x i8> %a, <16 x i8> %b) {
2565 ; CHECK-LABEL: test_vfaezb_4:
2567 ; CHECK-NEXT: vfaezb %v24, %v24, %v26, 4
2568 ; CHECK-NEXT: br %r14
2569 %res = call <16 x i8> @llvm.s390.vfaezb(<16 x i8> %a, <16 x i8> %b, i32 4)
2573 ; VFAEZB with IN !RT.
2574 define <16 x i8> @test_vfaezb_8(<16 x i8> %a, <16 x i8> %b) {
2575 ; CHECK-LABEL: test_vfaezb_8:
2577 ; CHECK-NEXT: vfaezb %v24, %v24, %v26, 8
2578 ; CHECK-NEXT: br %r14
2579 %res = call <16 x i8> @llvm.s390.vfaezb(<16 x i8> %a, <16 x i8> %b, i32 8)
2583 ; VFAEZB with IN RT.
2584 define <16 x i8> @test_vfaezb_12(<16 x i8> %a, <16 x i8> %b) {
2585 ; CHECK-LABEL: test_vfaezb_12:
2587 ; CHECK-NEXT: vfaezb %v24, %v24, %v26, 12
2588 ; CHECK-NEXT: br %r14
2589 %res = call <16 x i8> @llvm.s390.vfaezb(<16 x i8> %a, <16 x i8> %b, i32 12)
2593 ; VFAEZB with CS -- should be ignored.
2594 define <16 x i8> @test_vfaezb_1(<16 x i8> %a, <16 x i8> %b) {
2595 ; CHECK-LABEL: test_vfaezb_1:
2597 ; CHECK-NEXT: vfaezb %v24, %v24, %v26, 0
2598 ; CHECK-NEXT: br %r14
2599 %res = call <16 x i8> @llvm.s390.vfaezb(<16 x i8> %a, <16 x i8> %b, i32 1)
2604 define <8 x i16> @test_vfaezh(<8 x i16> %a, <8 x i16> %b) {
2605 ; CHECK-LABEL: test_vfaezh:
2607 ; CHECK-NEXT: vfaezh %v24, %v24, %v26, 4
2608 ; CHECK-NEXT: br %r14
2609 %res = call <8 x i16> @llvm.s390.vfaezh(<8 x i16> %a, <8 x i16> %b, i32 4)
2614 define <4 x i32> @test_vfaezf(<4 x i32> %a, <4 x i32> %b) {
2615 ; CHECK-LABEL: test_vfaezf:
2617 ; CHECK-NEXT: vfaezf %v24, %v24, %v26, 8
2618 ; CHECK-NEXT: br %r14
2619 %res = call <4 x i32> @llvm.s390.vfaezf(<4 x i32> %a, <4 x i32> %b, i32 8)
2624 define <16 x i8> @test_vfaezbs(<16 x i8> %a, <16 x i8> %b, ptr %ccptr) {
2625 ; CHECK-LABEL: test_vfaezbs:
2627 ; CHECK-NEXT: vfaezbs %v24, %v24, %v26, 0
2628 ; CHECK-NEXT: ipm %r0
2629 ; CHECK-NEXT: srl %r0, 28
2630 ; CHECK-NEXT: st %r0, 0(%r2)
2631 ; CHECK-NEXT: br %r14
2632 %call = call {<16 x i8>, i32} @llvm.s390.vfaezbs(<16 x i8> %a, <16 x i8> %b,
2634 %res = extractvalue {<16 x i8>, i32} %call, 0
2635 %cc = extractvalue {<16 x i8>, i32} %call, 1
2636 store i32 %cc, ptr %ccptr
2641 define <8 x i16> @test_vfaezhs(<8 x i16> %a, <8 x i16> %b, ptr %ccptr) {
2642 ; CHECK-LABEL: test_vfaezhs:
2644 ; CHECK-NEXT: vfaezhs %v24, %v24, %v26, 4
2645 ; CHECK-NEXT: ipm %r0
2646 ; CHECK-NEXT: srl %r0, 28
2647 ; CHECK-NEXT: st %r0, 0(%r2)
2648 ; CHECK-NEXT: br %r14
2649 %call = call {<8 x i16>, i32} @llvm.s390.vfaezhs(<8 x i16> %a, <8 x i16> %b,
2651 %res = extractvalue {<8 x i16>, i32} %call, 0
2652 %cc = extractvalue {<8 x i16>, i32} %call, 1
2653 store i32 %cc, ptr %ccptr
2658 define <4 x i32> @test_vfaezfs(<4 x i32> %a, <4 x i32> %b, ptr %ccptr) {
2659 ; CHECK-LABEL: test_vfaezfs:
2661 ; CHECK-NEXT: vfaezfs %v24, %v24, %v26, 8
2662 ; CHECK-NEXT: ipm %r0
2663 ; CHECK-NEXT: srl %r0, 28
2664 ; CHECK-NEXT: st %r0, 0(%r2)
2665 ; CHECK-NEXT: br %r14
2666 %call = call {<4 x i32>, i32} @llvm.s390.vfaezfs(<4 x i32> %a, <4 x i32> %b,
2668 %res = extractvalue {<4 x i32>, i32} %call, 0
2669 %cc = extractvalue {<4 x i32>, i32} %call, 1
2670 store i32 %cc, ptr %ccptr
2675 define <16 x i8> @test_vfeeb_0(<16 x i8> %a, <16 x i8> %b) {
2676 ; CHECK-LABEL: test_vfeeb_0:
2678 ; CHECK-NEXT: vfeeb %v24, %v24, %v26, 0
2679 ; CHECK-NEXT: br %r14
2680 %res = call <16 x i8> @llvm.s390.vfeeb(<16 x i8> %a, <16 x i8> %b)
2685 define <8 x i16> @test_vfeeh(<8 x i16> %a, <8 x i16> %b) {
2686 ; CHECK-LABEL: test_vfeeh:
2688 ; CHECK-NEXT: vfeeh %v24, %v24, %v26, 0
2689 ; CHECK-NEXT: br %r14
2690 %res = call <8 x i16> @llvm.s390.vfeeh(<8 x i16> %a, <8 x i16> %b)
2695 define <4 x i32> @test_vfeef(<4 x i32> %a, <4 x i32> %b) {
2696 ; CHECK-LABEL: test_vfeef:
2698 ; CHECK-NEXT: vfeef %v24, %v24, %v26, 0
2699 ; CHECK-NEXT: br %r14
2700 %res = call <4 x i32> @llvm.s390.vfeef(<4 x i32> %a, <4 x i32> %b)
2705 define <16 x i8> @test_vfeebs(<16 x i8> %a, <16 x i8> %b, ptr %ccptr) {
2706 ; CHECK-LABEL: test_vfeebs:
2708 ; CHECK-NEXT: vfeebs %v24, %v24, %v26
2709 ; CHECK-NEXT: ipm %r0
2710 ; CHECK-NEXT: srl %r0, 28
2711 ; CHECK-NEXT: st %r0, 0(%r2)
2712 ; CHECK-NEXT: br %r14
2713 %call = call {<16 x i8>, i32} @llvm.s390.vfeebs(<16 x i8> %a, <16 x i8> %b)
2714 %res = extractvalue {<16 x i8>, i32} %call, 0
2715 %cc = extractvalue {<16 x i8>, i32} %call, 1
2716 store i32 %cc, ptr %ccptr
2721 define <8 x i16> @test_vfeehs(<8 x i16> %a, <8 x i16> %b, ptr %ccptr) {
2722 ; CHECK-LABEL: test_vfeehs:
2724 ; CHECK-NEXT: vfeehs %v24, %v24, %v26
2725 ; CHECK-NEXT: ipm %r0
2726 ; CHECK-NEXT: srl %r0, 28
2727 ; CHECK-NEXT: st %r0, 0(%r2)
2728 ; CHECK-NEXT: br %r14
2729 %call = call {<8 x i16>, i32} @llvm.s390.vfeehs(<8 x i16> %a, <8 x i16> %b)
2730 %res = extractvalue {<8 x i16>, i32} %call, 0
2731 %cc = extractvalue {<8 x i16>, i32} %call, 1
2732 store i32 %cc, ptr %ccptr
2737 define <4 x i32> @test_vfeefs(<4 x i32> %a, <4 x i32> %b, ptr %ccptr) {
2738 ; CHECK-LABEL: test_vfeefs:
2740 ; CHECK-NEXT: vfeefs %v24, %v24, %v26
2741 ; CHECK-NEXT: ipm %r0
2742 ; CHECK-NEXT: srl %r0, 28
2743 ; CHECK-NEXT: st %r0, 0(%r2)
2744 ; CHECK-NEXT: br %r14
2745 %call = call {<4 x i32>, i32} @llvm.s390.vfeefs(<4 x i32> %a, <4 x i32> %b)
2746 %res = extractvalue {<4 x i32>, i32} %call, 0
2747 %cc = extractvalue {<4 x i32>, i32} %call, 1
2748 store i32 %cc, ptr %ccptr
2753 define <16 x i8> @test_vfeezb(<16 x i8> %a, <16 x i8> %b) {
2754 ; CHECK-LABEL: test_vfeezb:
2756 ; CHECK-NEXT: vfeezb %v24, %v24, %v26
2757 ; CHECK-NEXT: br %r14
2758 %res = call <16 x i8> @llvm.s390.vfeezb(<16 x i8> %a, <16 x i8> %b)
2763 define <8 x i16> @test_vfeezh(<8 x i16> %a, <8 x i16> %b) {
2764 ; CHECK-LABEL: test_vfeezh:
2766 ; CHECK-NEXT: vfeezh %v24, %v24, %v26
2767 ; CHECK-NEXT: br %r14
2768 %res = call <8 x i16> @llvm.s390.vfeezh(<8 x i16> %a, <8 x i16> %b)
2773 define <4 x i32> @test_vfeezf(<4 x i32> %a, <4 x i32> %b) {
2774 ; CHECK-LABEL: test_vfeezf:
2776 ; CHECK-NEXT: vfeezf %v24, %v24, %v26
2777 ; CHECK-NEXT: br %r14
2778 %res = call <4 x i32> @llvm.s390.vfeezf(<4 x i32> %a, <4 x i32> %b)
2783 define <16 x i8> @test_vfeezbs(<16 x i8> %a, <16 x i8> %b, ptr %ccptr) {
2784 ; CHECK-LABEL: test_vfeezbs:
2786 ; CHECK-NEXT: vfeezbs %v24, %v24, %v26
2787 ; CHECK-NEXT: ipm %r0
2788 ; CHECK-NEXT: srl %r0, 28
2789 ; CHECK-NEXT: st %r0, 0(%r2)
2790 ; CHECK-NEXT: br %r14
2791 %call = call {<16 x i8>, i32} @llvm.s390.vfeezbs(<16 x i8> %a, <16 x i8> %b)
2792 %res = extractvalue {<16 x i8>, i32} %call, 0
2793 %cc = extractvalue {<16 x i8>, i32} %call, 1
2794 store i32 %cc, ptr %ccptr
2799 define <8 x i16> @test_vfeezhs(<8 x i16> %a, <8 x i16> %b, ptr %ccptr) {
2800 ; CHECK-LABEL: test_vfeezhs:
2802 ; CHECK-NEXT: vfeezhs %v24, %v24, %v26
2803 ; CHECK-NEXT: ipm %r0
2804 ; CHECK-NEXT: srl %r0, 28
2805 ; CHECK-NEXT: st %r0, 0(%r2)
2806 ; CHECK-NEXT: br %r14
2807 %call = call {<8 x i16>, i32} @llvm.s390.vfeezhs(<8 x i16> %a, <8 x i16> %b)
2808 %res = extractvalue {<8 x i16>, i32} %call, 0
2809 %cc = extractvalue {<8 x i16>, i32} %call, 1
2810 store i32 %cc, ptr %ccptr
2815 define <4 x i32> @test_vfeezfs(<4 x i32> %a, <4 x i32> %b, ptr %ccptr) {
2816 ; CHECK-LABEL: test_vfeezfs:
2818 ; CHECK-NEXT: vfeezfs %v24, %v24, %v26
2819 ; CHECK-NEXT: ipm %r0
2820 ; CHECK-NEXT: srl %r0, 28
2821 ; CHECK-NEXT: st %r0, 0(%r2)
2822 ; CHECK-NEXT: br %r14
2823 %call = call {<4 x i32>, i32} @llvm.s390.vfeezfs(<4 x i32> %a, <4 x i32> %b)
2824 %res = extractvalue {<4 x i32>, i32} %call, 0
2825 %cc = extractvalue {<4 x i32>, i32} %call, 1
2826 store i32 %cc, ptr %ccptr
2831 define <16 x i8> @test_vfeneb_0(<16 x i8> %a, <16 x i8> %b) {
2832 ; CHECK-LABEL: test_vfeneb_0:
2834 ; CHECK-NEXT: vfeneb %v24, %v24, %v26, 0
2835 ; CHECK-NEXT: br %r14
2836 %res = call <16 x i8> @llvm.s390.vfeneb(<16 x i8> %a, <16 x i8> %b)
2841 define <8 x i16> @test_vfeneh(<8 x i16> %a, <8 x i16> %b) {
2842 ; CHECK-LABEL: test_vfeneh:
2844 ; CHECK-NEXT: vfeneh %v24, %v24, %v26, 0
2845 ; CHECK-NEXT: br %r14
2846 %res = call <8 x i16> @llvm.s390.vfeneh(<8 x i16> %a, <8 x i16> %b)
2851 define <4 x i32> @test_vfenef(<4 x i32> %a, <4 x i32> %b) {
2852 ; CHECK-LABEL: test_vfenef:
2854 ; CHECK-NEXT: vfenef %v24, %v24, %v26, 0
2855 ; CHECK-NEXT: br %r14
2856 %res = call <4 x i32> @llvm.s390.vfenef(<4 x i32> %a, <4 x i32> %b)
2861 define <16 x i8> @test_vfenebs(<16 x i8> %a, <16 x i8> %b, ptr %ccptr) {
2862 ; CHECK-LABEL: test_vfenebs:
2864 ; CHECK-NEXT: vfenebs %v24, %v24, %v26
2865 ; CHECK-NEXT: ipm %r0
2866 ; CHECK-NEXT: srl %r0, 28
2867 ; CHECK-NEXT: st %r0, 0(%r2)
2868 ; CHECK-NEXT: br %r14
2869 %call = call {<16 x i8>, i32} @llvm.s390.vfenebs(<16 x i8> %a, <16 x i8> %b)
2870 %res = extractvalue {<16 x i8>, i32} %call, 0
2871 %cc = extractvalue {<16 x i8>, i32} %call, 1
2872 store i32 %cc, ptr %ccptr
2877 define <8 x i16> @test_vfenehs(<8 x i16> %a, <8 x i16> %b, ptr %ccptr) {
2878 ; CHECK-LABEL: test_vfenehs:
2880 ; CHECK-NEXT: vfenehs %v24, %v24, %v26
2881 ; CHECK-NEXT: ipm %r0
2882 ; CHECK-NEXT: srl %r0, 28
2883 ; CHECK-NEXT: st %r0, 0(%r2)
2884 ; CHECK-NEXT: br %r14
2885 %call = call {<8 x i16>, i32} @llvm.s390.vfenehs(<8 x i16> %a, <8 x i16> %b)
2886 %res = extractvalue {<8 x i16>, i32} %call, 0
2887 %cc = extractvalue {<8 x i16>, i32} %call, 1
2888 store i32 %cc, ptr %ccptr
2893 define <4 x i32> @test_vfenefs(<4 x i32> %a, <4 x i32> %b, ptr %ccptr) {
2894 ; CHECK-LABEL: test_vfenefs:
2896 ; CHECK-NEXT: vfenefs %v24, %v24, %v26
2897 ; CHECK-NEXT: ipm %r0
2898 ; CHECK-NEXT: srl %r0, 28
2899 ; CHECK-NEXT: st %r0, 0(%r2)
2900 ; CHECK-NEXT: br %r14
2901 %call = call {<4 x i32>, i32} @llvm.s390.vfenefs(<4 x i32> %a, <4 x i32> %b)
2902 %res = extractvalue {<4 x i32>, i32} %call, 0
2903 %cc = extractvalue {<4 x i32>, i32} %call, 1
2904 store i32 %cc, ptr %ccptr
2909 define <16 x i8> @test_vfenezb(<16 x i8> %a, <16 x i8> %b) {
2910 ; CHECK-LABEL: test_vfenezb:
2912 ; CHECK-NEXT: vfenezb %v24, %v24, %v26
2913 ; CHECK-NEXT: br %r14
2914 %res = call <16 x i8> @llvm.s390.vfenezb(<16 x i8> %a, <16 x i8> %b)
2919 define <8 x i16> @test_vfenezh(<8 x i16> %a, <8 x i16> %b) {
2920 ; CHECK-LABEL: test_vfenezh:
2922 ; CHECK-NEXT: vfenezh %v24, %v24, %v26
2923 ; CHECK-NEXT: br %r14
2924 %res = call <8 x i16> @llvm.s390.vfenezh(<8 x i16> %a, <8 x i16> %b)
2929 define <4 x i32> @test_vfenezf(<4 x i32> %a, <4 x i32> %b) {
2930 ; CHECK-LABEL: test_vfenezf:
2932 ; CHECK-NEXT: vfenezf %v24, %v24, %v26
2933 ; CHECK-NEXT: br %r14
2934 %res = call <4 x i32> @llvm.s390.vfenezf(<4 x i32> %a, <4 x i32> %b)
2939 define <16 x i8> @test_vfenezbs(<16 x i8> %a, <16 x i8> %b, ptr %ccptr) {
2940 ; CHECK-LABEL: test_vfenezbs:
2942 ; CHECK-NEXT: vfenezbs %v24, %v24, %v26
2943 ; CHECK-NEXT: ipm %r0
2944 ; CHECK-NEXT: srl %r0, 28
2945 ; CHECK-NEXT: st %r0, 0(%r2)
2946 ; CHECK-NEXT: br %r14
2947 %call = call {<16 x i8>, i32} @llvm.s390.vfenezbs(<16 x i8> %a, <16 x i8> %b)
2948 %res = extractvalue {<16 x i8>, i32} %call, 0
2949 %cc = extractvalue {<16 x i8>, i32} %call, 1
2950 store i32 %cc, ptr %ccptr
2955 define <8 x i16> @test_vfenezhs(<8 x i16> %a, <8 x i16> %b, ptr %ccptr) {
2956 ; CHECK-LABEL: test_vfenezhs:
2958 ; CHECK-NEXT: vfenezhs %v24, %v24, %v26
2959 ; CHECK-NEXT: ipm %r0
2960 ; CHECK-NEXT: srl %r0, 28
2961 ; CHECK-NEXT: st %r0, 0(%r2)
2962 ; CHECK-NEXT: br %r14
2963 %call = call {<8 x i16>, i32} @llvm.s390.vfenezhs(<8 x i16> %a, <8 x i16> %b)
2964 %res = extractvalue {<8 x i16>, i32} %call, 0
2965 %cc = extractvalue {<8 x i16>, i32} %call, 1
2966 store i32 %cc, ptr %ccptr
2971 define <4 x i32> @test_vfenezfs(<4 x i32> %a, <4 x i32> %b, ptr %ccptr) {
2972 ; CHECK-LABEL: test_vfenezfs:
2974 ; CHECK-NEXT: vfenezfs %v24, %v24, %v26
2975 ; CHECK-NEXT: ipm %r0
2976 ; CHECK-NEXT: srl %r0, 28
2977 ; CHECK-NEXT: st %r0, 0(%r2)
2978 ; CHECK-NEXT: br %r14
2979 %call = call {<4 x i32>, i32} @llvm.s390.vfenezfs(<4 x i32> %a, <4 x i32> %b)
2980 %res = extractvalue {<4 x i32>, i32} %call, 0
2981 %cc = extractvalue {<4 x i32>, i32} %call, 1
2982 store i32 %cc, ptr %ccptr
2987 define <16 x i8> @test_vistrb(<16 x i8> %a) {
2988 ; CHECK-LABEL: test_vistrb:
2990 ; CHECK-NEXT: vistrb %v24, %v24, 0
2991 ; CHECK-NEXT: br %r14
2992 %res = call <16 x i8> @llvm.s390.vistrb(<16 x i8> %a)
2997 define <8 x i16> @test_vistrh(<8 x i16> %a) {
2998 ; CHECK-LABEL: test_vistrh:
3000 ; CHECK-NEXT: vistrh %v24, %v24, 0
3001 ; CHECK-NEXT: br %r14
3002 %res = call <8 x i16> @llvm.s390.vistrh(<8 x i16> %a)
3007 define <4 x i32> @test_vistrf(<4 x i32> %a) {
3008 ; CHECK-LABEL: test_vistrf:
3010 ; CHECK-NEXT: vistrf %v24, %v24, 0
3011 ; CHECK-NEXT: br %r14
3012 %res = call <4 x i32> @llvm.s390.vistrf(<4 x i32> %a)
3017 define <16 x i8> @test_vistrbs(<16 x i8> %a, ptr %ccptr) {
3018 ; CHECK-LABEL: test_vistrbs:
3020 ; CHECK-NEXT: vistrbs %v24, %v24
3021 ; CHECK-NEXT: ipm %r0
3022 ; CHECK-NEXT: srl %r0, 28
3023 ; CHECK-NEXT: st %r0, 0(%r2)
3024 ; CHECK-NEXT: br %r14
3025 %call = call {<16 x i8>, i32} @llvm.s390.vistrbs(<16 x i8> %a)
3026 %res = extractvalue {<16 x i8>, i32} %call, 0
3027 %cc = extractvalue {<16 x i8>, i32} %call, 1
3028 store i32 %cc, ptr %ccptr
3033 define <8 x i16> @test_vistrhs(<8 x i16> %a, ptr %ccptr) {
3034 ; CHECK-LABEL: test_vistrhs:
3036 ; CHECK-NEXT: vistrhs %v24, %v24
3037 ; CHECK-NEXT: ipm %r0
3038 ; CHECK-NEXT: srl %r0, 28
3039 ; CHECK-NEXT: st %r0, 0(%r2)
3040 ; CHECK-NEXT: br %r14
3041 %call = call {<8 x i16>, i32} @llvm.s390.vistrhs(<8 x i16> %a)
3042 %res = extractvalue {<8 x i16>, i32} %call, 0
3043 %cc = extractvalue {<8 x i16>, i32} %call, 1
3044 store i32 %cc, ptr %ccptr
3049 define <4 x i32> @test_vistrfs(<4 x i32> %a, ptr %ccptr) {
3050 ; CHECK-LABEL: test_vistrfs:
3052 ; CHECK-NEXT: vistrfs %v24, %v24
3053 ; CHECK-NEXT: ipm %r0
3054 ; CHECK-NEXT: srl %r0, 28
3055 ; CHECK-NEXT: st %r0, 0(%r2)
3056 ; CHECK-NEXT: br %r14
3057 %call = call {<4 x i32>, i32} @llvm.s390.vistrfs(<4 x i32> %a)
3058 %res = extractvalue {<4 x i32>, i32} %call, 0
3059 %cc = extractvalue {<4 x i32>, i32} %call, 1
3060 store i32 %cc, ptr %ccptr
3064 ; VSTRCB with !IN !RT.
3065 define <16 x i8> @test_vstrcb_0(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {
3066 ; CHECK-LABEL: test_vstrcb_0:
3068 ; CHECK-NEXT: vstrcb %v24, %v24, %v26, %v28, 0
3069 ; CHECK-NEXT: br %r14
3070 %res = call <16 x i8> @llvm.s390.vstrcb(<16 x i8> %a, <16 x i8> %b,
3071 <16 x i8> %c, i32 0)
3075 ; VSTRCB with !IN RT.
3076 define <16 x i8> @test_vstrcb_4(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {
3077 ; CHECK-LABEL: test_vstrcb_4:
3079 ; CHECK-NEXT: vstrcb %v24, %v24, %v26, %v28, 4
3080 ; CHECK-NEXT: br %r14
3081 %res = call <16 x i8> @llvm.s390.vstrcb(<16 x i8> %a, <16 x i8> %b,
3082 <16 x i8> %c, i32 4)
3086 ; VSTRCB with IN !RT.
3087 define <16 x i8> @test_vstrcb_8(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {
3088 ; CHECK-LABEL: test_vstrcb_8:
3090 ; CHECK-NEXT: vstrcb %v24, %v24, %v26, %v28, 8
3091 ; CHECK-NEXT: br %r14
3092 %res = call <16 x i8> @llvm.s390.vstrcb(<16 x i8> %a, <16 x i8> %b,
3093 <16 x i8> %c, i32 8)
3097 ; VSTRCB with IN RT.
3098 define <16 x i8> @test_vstrcb_12(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {
3099 ; CHECK-LABEL: test_vstrcb_12:
3101 ; CHECK-NEXT: vstrcb %v24, %v24, %v26, %v28, 12
3102 ; CHECK-NEXT: br %r14
3103 %res = call <16 x i8> @llvm.s390.vstrcb(<16 x i8> %a, <16 x i8> %b,
3104 <16 x i8> %c, i32 12)
3108 ; VSTRCB with CS -- should be ignored.
3109 define <16 x i8> @test_vstrcb_1(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {
3110 ; CHECK-LABEL: test_vstrcb_1:
3112 ; CHECK-NEXT: vstrcb %v24, %v24, %v26, %v28, 0
3113 ; CHECK-NEXT: br %r14
3114 %res = call <16 x i8> @llvm.s390.vstrcb(<16 x i8> %a, <16 x i8> %b,
3115 <16 x i8> %c, i32 1)
3120 define <8 x i16> @test_vstrch(<8 x i16> %a, <8 x i16> %b, <8 x i16> %c) {
3121 ; CHECK-LABEL: test_vstrch:
3123 ; CHECK-NEXT: vstrch %v24, %v24, %v26, %v28, 4
3124 ; CHECK-NEXT: br %r14
3125 %res = call <8 x i16> @llvm.s390.vstrch(<8 x i16> %a, <8 x i16> %b,
3126 <8 x i16> %c, i32 4)
3131 define <4 x i32> @test_vstrcf(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
3132 ; CHECK-LABEL: test_vstrcf:
3134 ; CHECK-NEXT: vstrcf %v24, %v24, %v26, %v28, 8
3135 ; CHECK-NEXT: br %r14
3136 %res = call <4 x i32> @llvm.s390.vstrcf(<4 x i32> %a, <4 x i32> %b,
3137 <4 x i32> %c, i32 8)
3142 define <16 x i8> @test_vstrcbs(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c,
3143 ; CHECK-LABEL: test_vstrcbs:
3145 ; CHECK-NEXT: vstrcbs %v24, %v24, %v26, %v28, 0
3146 ; CHECK-NEXT: ipm %r0
3147 ; CHECK-NEXT: srl %r0, 28
3148 ; CHECK-NEXT: st %r0, 0(%r2)
3149 ; CHECK-NEXT: br %r14
3151 %call = call {<16 x i8>, i32} @llvm.s390.vstrcbs(<16 x i8> %a, <16 x i8> %b,
3152 <16 x i8> %c, i32 0)
3153 %res = extractvalue {<16 x i8>, i32} %call, 0
3154 %cc = extractvalue {<16 x i8>, i32} %call, 1
3155 store i32 %cc, ptr %ccptr
3160 define <8 x i16> @test_vstrchs(<8 x i16> %a, <8 x i16> %b, <8 x i16> %c,
3161 ; CHECK-LABEL: test_vstrchs:
3163 ; CHECK-NEXT: vstrchs %v24, %v24, %v26, %v28, 4
3164 ; CHECK-NEXT: ipm %r0
3165 ; CHECK-NEXT: srl %r0, 28
3166 ; CHECK-NEXT: st %r0, 0(%r2)
3167 ; CHECK-NEXT: br %r14
3169 %call = call {<8 x i16>, i32} @llvm.s390.vstrchs(<8 x i16> %a, <8 x i16> %b,
3170 <8 x i16> %c, i32 4)
3171 %res = extractvalue {<8 x i16>, i32} %call, 0
3172 %cc = extractvalue {<8 x i16>, i32} %call, 1
3173 store i32 %cc, ptr %ccptr
3178 define <4 x i32> @test_vstrcfs(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c,
3179 ; CHECK-LABEL: test_vstrcfs:
3181 ; CHECK-NEXT: vstrcfs %v24, %v24, %v26, %v28, 8
3182 ; CHECK-NEXT: ipm %r0
3183 ; CHECK-NEXT: srl %r0, 28
3184 ; CHECK-NEXT: st %r0, 0(%r2)
3185 ; CHECK-NEXT: br %r14
3187 %call = call {<4 x i32>, i32} @llvm.s390.vstrcfs(<4 x i32> %a, <4 x i32> %b,
3188 <4 x i32> %c, i32 8)
3189 %res = extractvalue {<4 x i32>, i32} %call, 0
3190 %cc = extractvalue {<4 x i32>, i32} %call, 1
3191 store i32 %cc, ptr %ccptr
3195 ; VSTRCZB with !IN !RT.
3196 define <16 x i8> @test_vstrczb_0(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {
3197 ; CHECK-LABEL: test_vstrczb_0:
3199 ; CHECK-NEXT: vstrczb %v24, %v24, %v26, %v28, 0
3200 ; CHECK-NEXT: br %r14
3201 %res = call <16 x i8> @llvm.s390.vstrczb(<16 x i8> %a, <16 x i8> %b,
3202 <16 x i8> %c, i32 0)
3206 ; VSTRCZB with !IN RT.
3207 define <16 x i8> @test_vstrczb_4(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {
3208 ; CHECK-LABEL: test_vstrczb_4:
3210 ; CHECK-NEXT: vstrczb %v24, %v24, %v26, %v28, 4
3211 ; CHECK-NEXT: br %r14
3212 %res = call <16 x i8> @llvm.s390.vstrczb(<16 x i8> %a, <16 x i8> %b,
3213 <16 x i8> %c, i32 4)
3217 ; VSTRCZB with IN !RT.
3218 define <16 x i8> @test_vstrczb_8(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {
3219 ; CHECK-LABEL: test_vstrczb_8:
3221 ; CHECK-NEXT: vstrczb %v24, %v24, %v26, %v28, 8
3222 ; CHECK-NEXT: br %r14
3223 %res = call <16 x i8> @llvm.s390.vstrczb(<16 x i8> %a, <16 x i8> %b,
3224 <16 x i8> %c, i32 8)
3228 ; VSTRCZB with IN RT.
3229 define <16 x i8> @test_vstrczb_12(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {
3230 ; CHECK-LABEL: test_vstrczb_12:
3232 ; CHECK-NEXT: vstrczb %v24, %v24, %v26, %v28, 12
3233 ; CHECK-NEXT: br %r14
3234 %res = call <16 x i8> @llvm.s390.vstrczb(<16 x i8> %a, <16 x i8> %b,
3235 <16 x i8> %c, i32 12)
3239 ; VSTRCZB with CS -- should be ignored.
3240 define <16 x i8> @test_vstrczb_1(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {
3241 ; CHECK-LABEL: test_vstrczb_1:
3243 ; CHECK-NEXT: vstrczb %v24, %v24, %v26, %v28, 0
3244 ; CHECK-NEXT: br %r14
3245 %res = call <16 x i8> @llvm.s390.vstrczb(<16 x i8> %a, <16 x i8> %b,
3246 <16 x i8> %c, i32 1)
3251 define <8 x i16> @test_vstrczh(<8 x i16> %a, <8 x i16> %b, <8 x i16> %c) {
3252 ; CHECK-LABEL: test_vstrczh:
3254 ; CHECK-NEXT: vstrczh %v24, %v24, %v26, %v28, 4
3255 ; CHECK-NEXT: br %r14
3256 %res = call <8 x i16> @llvm.s390.vstrczh(<8 x i16> %a, <8 x i16> %b,
3257 <8 x i16> %c, i32 4)
3262 define <4 x i32> @test_vstrczf(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
3263 ; CHECK-LABEL: test_vstrczf:
3265 ; CHECK-NEXT: vstrczf %v24, %v24, %v26, %v28, 8
3266 ; CHECK-NEXT: br %r14
3267 %res = call <4 x i32> @llvm.s390.vstrczf(<4 x i32> %a, <4 x i32> %b,
3268 <4 x i32> %c, i32 8)
3273 define <16 x i8> @test_vstrczbs(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c,
3274 ; CHECK-LABEL: test_vstrczbs:
3276 ; CHECK-NEXT: vstrczbs %v24, %v24, %v26, %v28, 0
3277 ; CHECK-NEXT: ipm %r0
3278 ; CHECK-NEXT: srl %r0, 28
3279 ; CHECK-NEXT: st %r0, 0(%r2)
3280 ; CHECK-NEXT: br %r14
3282 %call = call {<16 x i8>, i32} @llvm.s390.vstrczbs(<16 x i8> %a, <16 x i8> %b,
3283 <16 x i8> %c, i32 0)
3284 %res = extractvalue {<16 x i8>, i32} %call, 0
3285 %cc = extractvalue {<16 x i8>, i32} %call, 1
3286 store i32 %cc, ptr %ccptr
3291 define <8 x i16> @test_vstrczhs(<8 x i16> %a, <8 x i16> %b, <8 x i16> %c,
3292 ; CHECK-LABEL: test_vstrczhs:
3294 ; CHECK-NEXT: vstrczhs %v24, %v24, %v26, %v28, 4
3295 ; CHECK-NEXT: ipm %r0
3296 ; CHECK-NEXT: srl %r0, 28
3297 ; CHECK-NEXT: st %r0, 0(%r2)
3298 ; CHECK-NEXT: br %r14
3300 %call = call {<8 x i16>, i32} @llvm.s390.vstrczhs(<8 x i16> %a, <8 x i16> %b,
3301 <8 x i16> %c, i32 4)
3302 %res = extractvalue {<8 x i16>, i32} %call, 0
3303 %cc = extractvalue {<8 x i16>, i32} %call, 1
3304 store i32 %cc, ptr %ccptr
3309 define <4 x i32> @test_vstrczfs(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c,
3310 ; CHECK-LABEL: test_vstrczfs:
3312 ; CHECK-NEXT: vstrczfs %v24, %v24, %v26, %v28, 8
3313 ; CHECK-NEXT: ipm %r0
3314 ; CHECK-NEXT: srl %r0, 28
3315 ; CHECK-NEXT: st %r0, 0(%r2)
3316 ; CHECK-NEXT: br %r14
3318 %call = call {<4 x i32>, i32} @llvm.s390.vstrczfs(<4 x i32> %a, <4 x i32> %b,
3319 <4 x i32> %c, i32 8)
3320 %res = extractvalue {<4 x i32>, i32} %call, 0
3321 %cc = extractvalue {<4 x i32>, i32} %call, 1
3322 store i32 %cc, ptr %ccptr
3326 ; VFCEDBS with no processing of the result.
3327 define i32 @test_vfcedbs(<2 x double> %a, <2 x double> %b) {
3328 ; CHECK-LABEL: test_vfcedbs:
3330 ; CHECK-NEXT: vfcedbs %v0, %v24, %v26
3331 ; CHECK-NEXT: ipm %r2
3332 ; CHECK-NEXT: srl %r2, 28
3333 ; CHECK-NEXT: br %r14
3334 %call = call {<2 x i64>, i32} @llvm.s390.vfcedbs(<2 x double> %a,
3336 %res = extractvalue {<2 x i64>, i32} %call, 1
3340 ; VFCEDBS, returning 1 if any elements are equal (CC != 3).
3341 define i32 @test_vfcedbs_any_bool(<2 x double> %a, <2 x double> %b) {
3342 ; CHECK-LABEL: test_vfcedbs_any_bool:
3344 ; CHECK-NEXT: vfcedbs %v0, %v24, %v26
3345 ; CHECK-NEXT: lhi %r2, 0
3346 ; CHECK-NEXT: lochile %r2, 1
3347 ; CHECK-NEXT: br %r14
3348 %call = call {<2 x i64>, i32} @llvm.s390.vfcedbs(<2 x double> %a,
3350 %res = extractvalue {<2 x i64>, i32} %call, 1
3351 %cmp = icmp ne i32 %res, 3
3352 %ext = zext i1 %cmp to i32
3356 ; VFCEDBS, storing to %ptr if any elements are equal.
3357 define <2 x i64> @test_vfcedbs_any_store(<2 x double> %a, <2 x double> %b,
3358 ; CHECK-LABEL: test_vfcedbs_any_store:
3360 ; CHECK-NEXT: vfcedbs %v24, %v24, %v26
3361 ; CHECK-NEXT: bor %r14
3362 ; CHECK-NEXT: .LBB249_1: # %store
3363 ; CHECK-NEXT: mvhi 0(%r2), 0
3364 ; CHECK-NEXT: br %r14
3366 %call = call {<2 x i64>, i32} @llvm.s390.vfcedbs(<2 x double> %a,
3368 %res = extractvalue {<2 x i64>, i32} %call, 0
3369 %cc = extractvalue {<2 x i64>, i32} %call, 1
3370 %cmp = icmp ule i32 %cc, 2
3371 br i1 %cmp, label %store, label %exit
3374 store i32 0, ptr %ptr
3381 ; VFCHDBS with no processing of the result.
3382 define i32 @test_vfchdbs(<2 x double> %a, <2 x double> %b) {
3383 ; CHECK-LABEL: test_vfchdbs:
3385 ; CHECK-NEXT: vfchdbs %v0, %v24, %v26
3386 ; CHECK-NEXT: ipm %r2
3387 ; CHECK-NEXT: srl %r2, 28
3388 ; CHECK-NEXT: br %r14
3389 %call = call {<2 x i64>, i32} @llvm.s390.vfchdbs(<2 x double> %a,
3391 %res = extractvalue {<2 x i64>, i32} %call, 1
3395 ; VFCHDBS, returning 1 if not all elements are higher.
3396 define i32 @test_vfchdbs_notall_bool(<2 x double> %a, <2 x double> %b) {
3397 ; CHECK-LABEL: test_vfchdbs_notall_bool:
3399 ; CHECK-NEXT: vfchdbs %v0, %v24, %v26
3400 ; CHECK-NEXT: lhi %r2, 0
3401 ; CHECK-NEXT: lochinhe %r2, 1
3402 ; CHECK-NEXT: br %r14
3403 %call = call {<2 x i64>, i32} @llvm.s390.vfchdbs(<2 x double> %a,
3405 %res = extractvalue {<2 x i64>, i32} %call, 1
3406 %cmp = icmp sge i32 %res, 1
3407 %ext = zext i1 %cmp to i32
3411 ; VFCHDBS, storing to %ptr if not all elements are higher.
3412 define <2 x i64> @test_vfchdbs_notall_store(<2 x double> %a, <2 x double> %b,
3413 ; CHECK-LABEL: test_vfchdbs_notall_store:
3415 ; CHECK-NEXT: vfchdbs %v24, %v24, %v26
3416 ; CHECK-NEXT: ber %r14
3417 ; CHECK-NEXT: .LBB252_1: # %store
3418 ; CHECK-NEXT: mvhi 0(%r2), 0
3419 ; CHECK-NEXT: br %r14
3421 %call = call {<2 x i64>, i32} @llvm.s390.vfchdbs(<2 x double> %a,
3423 %res = extractvalue {<2 x i64>, i32} %call, 0
3424 %cc = extractvalue {<2 x i64>, i32} %call, 1
3425 %cmp = icmp ugt i32 %cc, 0
3426 br i1 %cmp, label %store, label %exit
3429 store i32 0, ptr %ptr
3436 ; VFCHEDBS with no processing of the result.
3437 define i32 @test_vfchedbs(<2 x double> %a, <2 x double> %b) {
3438 ; CHECK-LABEL: test_vfchedbs:
3440 ; CHECK-NEXT: vfchedbs %v0, %v24, %v26
3441 ; CHECK-NEXT: ipm %r2
3442 ; CHECK-NEXT: srl %r2, 28
3443 ; CHECK-NEXT: br %r14
3444 %call = call {<2 x i64>, i32} @llvm.s390.vfchedbs(<2 x double> %a,
3446 %res = extractvalue {<2 x i64>, i32} %call, 1
3450 ; VFCHEDBS, returning 1 if neither element is higher or equal.
3451 define i32 @test_vfchedbs_none_bool(<2 x double> %a, <2 x double> %b) {
3452 ; CHECK-LABEL: test_vfchedbs_none_bool:
3454 ; CHECK-NEXT: vfchedbs %v0, %v24, %v26
3455 ; CHECK-NEXT: lhi %r2, 0
3456 ; CHECK-NEXT: lochio %r2, 1
3457 ; CHECK-NEXT: br %r14
3458 %call = call {<2 x i64>, i32} @llvm.s390.vfchedbs(<2 x double> %a,
3460 %res = extractvalue {<2 x i64>, i32} %call, 1
3461 %cmp = icmp eq i32 %res, 3
3462 %ext = zext i1 %cmp to i32
3466 ; VFCHEDBS, storing to %ptr if neither element is higher or equal.
3467 define <2 x i64> @test_vfchedbs_none_store(<2 x double> %a, <2 x double> %b,
3468 ; CHECK-LABEL: test_vfchedbs_none_store:
3470 ; CHECK-NEXT: vfchedbs %v24, %v24, %v26
3471 ; CHECK-NEXT: bler %r14
3472 ; CHECK-NEXT: .LBB255_1: # %store
3473 ; CHECK-NEXT: mvhi 0(%r2), 0
3474 ; CHECK-NEXT: br %r14
3476 %call = call {<2 x i64>, i32} @llvm.s390.vfchedbs(<2 x double> %a,
3478 %res = extractvalue {<2 x i64>, i32} %call, 0
3479 %cc = extractvalue {<2 x i64>, i32} %call, 1
3480 %cmp = icmp uge i32 %cc, 3
3481 br i1 %cmp, label %store, label %exit
3484 store i32 0, ptr %ptr
3491 ; VFTCIDB with the lowest useful class selector and no processing of the result.
3492 define i32 @test_vftcidb(<2 x double> %a) {
3493 ; CHECK-LABEL: test_vftcidb:
3495 ; CHECK-NEXT: vftcidb %v0, %v24, 1
3496 ; CHECK-NEXT: ipm %r2
3497 ; CHECK-NEXT: srl %r2, 28
3498 ; CHECK-NEXT: br %r14
3499 %call = call {<2 x i64>, i32} @llvm.s390.vftcidb(<2 x double> %a, i32 1)
3500 %res = extractvalue {<2 x i64>, i32} %call, 1
3504 ; VFTCIDB with the highest useful class selector, returning 1 if all elements
3505 ; have the right class (CC == 0).
3506 define i32 @test_vftcidb_all_bool(<2 x double> %a) {
3507 ; CHECK-LABEL: test_vftcidb_all_bool:
3509 ; CHECK-NEXT: vftcidb %v0, %v24, 4094
3510 ; CHECK-NEXT: lhi %r2, 0
3511 ; CHECK-NEXT: lochie %r2, 1
3512 ; CHECK-NEXT: br %r14
3513 %call = call {<2 x i64>, i32} @llvm.s390.vftcidb(<2 x double> %a, i32 4094)
3514 %res = extractvalue {<2 x i64>, i32} %call, 1
3515 %cmp = icmp eq i32 %res, 0
3516 %ext = zext i1 %cmp to i32
3520 ; VFIDB with a rounding mode not usable via standard intrinsics.
3521 define <2 x double> @test_vfidb_0_4(<2 x double> %a) {
3522 ; CHECK-LABEL: test_vfidb_0_4:
3524 ; CHECK-NEXT: vfidb %v24, %v24, 0, 4
3525 ; CHECK-NEXT: br %r14
3526 %res = call <2 x double> @llvm.s390.vfidb(<2 x double> %a, i32 0, i32 4)
3527 ret <2 x double> %res
3530 ; VFIDB with IEEE-inexact exception suppressed.
3531 define <2 x double> @test_vfidb_4_0(<2 x double> %a) {
3532 ; CHECK-LABEL: test_vfidb_4_0:
3534 ; CHECK-NEXT: vfidb %v24, %v24, 4, 0
3535 ; CHECK-NEXT: br %r14
3536 %res = call <2 x double> @llvm.s390.vfidb(<2 x double> %a, i32 4, i32 0)
3537 ret <2 x double> %res