1 ; Test vector intrinsics.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s
5 declare i32 @llvm.s390.lcbb(ptr, i32)
6 declare <16 x i8> @llvm.s390.vlbb(ptr, i32)
7 declare <16 x i8> @llvm.s390.vll(i32, ptr)
8 declare <2 x i64> @llvm.s390.vpdi(<2 x i64>, <2 x i64>, i32)
9 declare <16 x i8> @llvm.s390.vperm(<16 x i8>, <16 x i8>, <16 x i8>)
10 declare <16 x i8> @llvm.s390.vpksh(<8 x i16>, <8 x i16>)
11 declare <8 x i16> @llvm.s390.vpksf(<4 x i32>, <4 x i32>)
12 declare <4 x i32> @llvm.s390.vpksg(<2 x i64>, <2 x i64>)
13 declare {<16 x i8>, i32} @llvm.s390.vpkshs(<8 x i16>, <8 x i16>)
14 declare {<8 x i16>, i32} @llvm.s390.vpksfs(<4 x i32>, <4 x i32>)
15 declare {<4 x i32>, i32} @llvm.s390.vpksgs(<2 x i64>, <2 x i64>)
16 declare <16 x i8> @llvm.s390.vpklsh(<8 x i16>, <8 x i16>)
17 declare <8 x i16> @llvm.s390.vpklsf(<4 x i32>, <4 x i32>)
18 declare <4 x i32> @llvm.s390.vpklsg(<2 x i64>, <2 x i64>)
19 declare {<16 x i8>, i32} @llvm.s390.vpklshs(<8 x i16>, <8 x i16>)
20 declare {<8 x i16>, i32} @llvm.s390.vpklsfs(<4 x i32>, <4 x i32>)
21 declare {<4 x i32>, i32} @llvm.s390.vpklsgs(<2 x i64>, <2 x i64>)
22 declare void @llvm.s390.vstl(<16 x i8>, i32, ptr)
23 declare <8 x i16> @llvm.s390.vuphb(<16 x i8>)
24 declare <4 x i32> @llvm.s390.vuphh(<8 x i16>)
25 declare <2 x i64> @llvm.s390.vuphf(<4 x i32>)
26 declare <8 x i16> @llvm.s390.vuplhb(<16 x i8>)
27 declare <4 x i32> @llvm.s390.vuplhh(<8 x i16>)
28 declare <2 x i64> @llvm.s390.vuplhf(<4 x i32>)
29 declare <8 x i16> @llvm.s390.vuplb(<16 x i8>)
30 declare <4 x i32> @llvm.s390.vuplhw(<8 x i16>)
31 declare <2 x i64> @llvm.s390.vuplf(<4 x i32>)
32 declare <8 x i16> @llvm.s390.vupllb(<16 x i8>)
33 declare <4 x i32> @llvm.s390.vupllh(<8 x i16>)
34 declare <2 x i64> @llvm.s390.vupllf(<4 x i32>)
35 declare <16 x i8> @llvm.s390.vaccb(<16 x i8>, <16 x i8>)
36 declare <8 x i16> @llvm.s390.vacch(<8 x i16>, <8 x i16>)
37 declare <4 x i32> @llvm.s390.vaccf(<4 x i32>, <4 x i32>)
38 declare <2 x i64> @llvm.s390.vaccg(<2 x i64>, <2 x i64>)
39 declare <16 x i8> @llvm.s390.vaq(<16 x i8>, <16 x i8>)
40 declare <16 x i8> @llvm.s390.vacq(<16 x i8>, <16 x i8>, <16 x i8>)
41 declare <16 x i8> @llvm.s390.vaccq(<16 x i8>, <16 x i8>)
42 declare <16 x i8> @llvm.s390.vacccq(<16 x i8>, <16 x i8>, <16 x i8>)
43 declare <16 x i8> @llvm.s390.vavgb(<16 x i8>, <16 x i8>)
44 declare <8 x i16> @llvm.s390.vavgh(<8 x i16>, <8 x i16>)
45 declare <4 x i32> @llvm.s390.vavgf(<4 x i32>, <4 x i32>)
46 declare <2 x i64> @llvm.s390.vavgg(<2 x i64>, <2 x i64>)
47 declare <16 x i8> @llvm.s390.vavglb(<16 x i8>, <16 x i8>)
48 declare <8 x i16> @llvm.s390.vavglh(<8 x i16>, <8 x i16>)
49 declare <4 x i32> @llvm.s390.vavglf(<4 x i32>, <4 x i32>)
50 declare <2 x i64> @llvm.s390.vavglg(<2 x i64>, <2 x i64>)
51 declare <4 x i32> @llvm.s390.vcksm(<4 x i32>, <4 x i32>)
52 declare <8 x i16> @llvm.s390.vgfmb(<16 x i8>, <16 x i8>)
53 declare <4 x i32> @llvm.s390.vgfmh(<8 x i16>, <8 x i16>)
54 declare <2 x i64> @llvm.s390.vgfmf(<4 x i32>, <4 x i32>)
55 declare <16 x i8> @llvm.s390.vgfmg(<2 x i64>, <2 x i64>)
56 declare <8 x i16> @llvm.s390.vgfmab(<16 x i8>, <16 x i8>, <8 x i16>)
57 declare <4 x i32> @llvm.s390.vgfmah(<8 x i16>, <8 x i16>, <4 x i32>)
58 declare <2 x i64> @llvm.s390.vgfmaf(<4 x i32>, <4 x i32>, <2 x i64>)
59 declare <16 x i8> @llvm.s390.vgfmag(<2 x i64>, <2 x i64>, <16 x i8>)
60 declare <16 x i8> @llvm.s390.vmahb(<16 x i8>, <16 x i8>, <16 x i8>)
61 declare <8 x i16> @llvm.s390.vmahh(<8 x i16>, <8 x i16>, <8 x i16>)
62 declare <4 x i32> @llvm.s390.vmahf(<4 x i32>, <4 x i32>, <4 x i32>)
63 declare <16 x i8> @llvm.s390.vmalhb(<16 x i8>, <16 x i8>, <16 x i8>)
64 declare <8 x i16> @llvm.s390.vmalhh(<8 x i16>, <8 x i16>, <8 x i16>)
65 declare <4 x i32> @llvm.s390.vmalhf(<4 x i32>, <4 x i32>, <4 x i32>)
66 declare <8 x i16> @llvm.s390.vmaeb(<16 x i8>, <16 x i8>, <8 x i16>)
67 declare <4 x i32> @llvm.s390.vmaeh(<8 x i16>, <8 x i16>, <4 x i32>)
68 declare <2 x i64> @llvm.s390.vmaef(<4 x i32>, <4 x i32>, <2 x i64>)
69 declare <8 x i16> @llvm.s390.vmaleb(<16 x i8>, <16 x i8>, <8 x i16>)
70 declare <4 x i32> @llvm.s390.vmaleh(<8 x i16>, <8 x i16>, <4 x i32>)
71 declare <2 x i64> @llvm.s390.vmalef(<4 x i32>, <4 x i32>, <2 x i64>)
72 declare <8 x i16> @llvm.s390.vmaob(<16 x i8>, <16 x i8>, <8 x i16>)
73 declare <4 x i32> @llvm.s390.vmaoh(<8 x i16>, <8 x i16>, <4 x i32>)
74 declare <2 x i64> @llvm.s390.vmaof(<4 x i32>, <4 x i32>, <2 x i64>)
75 declare <8 x i16> @llvm.s390.vmalob(<16 x i8>, <16 x i8>, <8 x i16>)
76 declare <4 x i32> @llvm.s390.vmaloh(<8 x i16>, <8 x i16>, <4 x i32>)
77 declare <2 x i64> @llvm.s390.vmalof(<4 x i32>, <4 x i32>, <2 x i64>)
78 declare <16 x i8> @llvm.s390.vmhb(<16 x i8>, <16 x i8>)
79 declare <8 x i16> @llvm.s390.vmhh(<8 x i16>, <8 x i16>)
80 declare <4 x i32> @llvm.s390.vmhf(<4 x i32>, <4 x i32>)
81 declare <16 x i8> @llvm.s390.vmlhb(<16 x i8>, <16 x i8>)
82 declare <8 x i16> @llvm.s390.vmlhh(<8 x i16>, <8 x i16>)
83 declare <4 x i32> @llvm.s390.vmlhf(<4 x i32>, <4 x i32>)
84 declare <8 x i16> @llvm.s390.vmeb(<16 x i8>, <16 x i8>)
85 declare <4 x i32> @llvm.s390.vmeh(<8 x i16>, <8 x i16>)
86 declare <2 x i64> @llvm.s390.vmef(<4 x i32>, <4 x i32>)
87 declare <8 x i16> @llvm.s390.vmleb(<16 x i8>, <16 x i8>)
88 declare <4 x i32> @llvm.s390.vmleh(<8 x i16>, <8 x i16>)
89 declare <2 x i64> @llvm.s390.vmlef(<4 x i32>, <4 x i32>)
90 declare <8 x i16> @llvm.s390.vmob(<16 x i8>, <16 x i8>)
91 declare <4 x i32> @llvm.s390.vmoh(<8 x i16>, <8 x i16>)
92 declare <2 x i64> @llvm.s390.vmof(<4 x i32>, <4 x i32>)
93 declare <8 x i16> @llvm.s390.vmlob(<16 x i8>, <16 x i8>)
94 declare <4 x i32> @llvm.s390.vmloh(<8 x i16>, <8 x i16>)
95 declare <2 x i64> @llvm.s390.vmlof(<4 x i32>, <4 x i32>)
96 declare <16 x i8> @llvm.s390.verllvb(<16 x i8>, <16 x i8>)
97 declare <8 x i16> @llvm.s390.verllvh(<8 x i16>, <8 x i16>)
98 declare <4 x i32> @llvm.s390.verllvf(<4 x i32>, <4 x i32>)
99 declare <2 x i64> @llvm.s390.verllvg(<2 x i64>, <2 x i64>)
100 declare <16 x i8> @llvm.s390.verllb(<16 x i8>, i32)
101 declare <8 x i16> @llvm.s390.verllh(<8 x i16>, i32)
102 declare <4 x i32> @llvm.s390.verllf(<4 x i32>, i32)
103 declare <2 x i64> @llvm.s390.verllg(<2 x i64>, i32)
104 declare <16 x i8> @llvm.s390.verimb(<16 x i8>, <16 x i8>, <16 x i8>, i32)
105 declare <8 x i16> @llvm.s390.verimh(<8 x i16>, <8 x i16>, <8 x i16>, i32)
106 declare <4 x i32> @llvm.s390.verimf(<4 x i32>, <4 x i32>, <4 x i32>, i32)
107 declare <2 x i64> @llvm.s390.verimg(<2 x i64>, <2 x i64>, <2 x i64>, i32)
108 declare <16 x i8> @llvm.s390.vsl(<16 x i8>, <16 x i8>)
109 declare <16 x i8> @llvm.s390.vslb(<16 x i8>, <16 x i8>)
110 declare <16 x i8> @llvm.s390.vsra(<16 x i8>, <16 x i8>)
111 declare <16 x i8> @llvm.s390.vsrab(<16 x i8>, <16 x i8>)
112 declare <16 x i8> @llvm.s390.vsrl(<16 x i8>, <16 x i8>)
113 declare <16 x i8> @llvm.s390.vsrlb(<16 x i8>, <16 x i8>)
114 declare <16 x i8> @llvm.s390.vsldb(<16 x i8>, <16 x i8>, i32)
115 declare <16 x i8> @llvm.s390.vscbib(<16 x i8>, <16 x i8>)
116 declare <8 x i16> @llvm.s390.vscbih(<8 x i16>, <8 x i16>)
117 declare <4 x i32> @llvm.s390.vscbif(<4 x i32>, <4 x i32>)
118 declare <2 x i64> @llvm.s390.vscbig(<2 x i64>, <2 x i64>)
119 declare <16 x i8> @llvm.s390.vsq(<16 x i8>, <16 x i8>)
120 declare <16 x i8> @llvm.s390.vsbiq(<16 x i8>, <16 x i8>, <16 x i8>)
121 declare <16 x i8> @llvm.s390.vscbiq(<16 x i8>, <16 x i8>)
122 declare <16 x i8> @llvm.s390.vsbcbiq(<16 x i8>, <16 x i8>, <16 x i8>)
123 declare <4 x i32> @llvm.s390.vsumb(<16 x i8>, <16 x i8>)
124 declare <4 x i32> @llvm.s390.vsumh(<8 x i16>, <8 x i16>)
125 declare <2 x i64> @llvm.s390.vsumgh(<8 x i16>, <8 x i16>)
126 declare <2 x i64> @llvm.s390.vsumgf(<4 x i32>, <4 x i32>)
127 declare <16 x i8> @llvm.s390.vsumqf(<4 x i32>, <4 x i32>)
128 declare <16 x i8> @llvm.s390.vsumqg(<2 x i64>, <2 x i64>)
129 declare i32 @llvm.s390.vtm(<16 x i8>, <16 x i8>)
130 declare {<16 x i8>, i32} @llvm.s390.vceqbs(<16 x i8>, <16 x i8>)
131 declare {<8 x i16>, i32} @llvm.s390.vceqhs(<8 x i16>, <8 x i16>)
132 declare {<4 x i32>, i32} @llvm.s390.vceqfs(<4 x i32>, <4 x i32>)
133 declare {<2 x i64>, i32} @llvm.s390.vceqgs(<2 x i64>, <2 x i64>)
134 declare {<16 x i8>, i32} @llvm.s390.vchbs(<16 x i8>, <16 x i8>)
135 declare {<8 x i16>, i32} @llvm.s390.vchhs(<8 x i16>, <8 x i16>)
136 declare {<4 x i32>, i32} @llvm.s390.vchfs(<4 x i32>, <4 x i32>)
137 declare {<2 x i64>, i32} @llvm.s390.vchgs(<2 x i64>, <2 x i64>)
138 declare {<16 x i8>, i32} @llvm.s390.vchlbs(<16 x i8>, <16 x i8>)
139 declare {<8 x i16>, i32} @llvm.s390.vchlhs(<8 x i16>, <8 x i16>)
140 declare {<4 x i32>, i32} @llvm.s390.vchlfs(<4 x i32>, <4 x i32>)
141 declare {<2 x i64>, i32} @llvm.s390.vchlgs(<2 x i64>, <2 x i64>)
142 declare <16 x i8> @llvm.s390.vfaeb(<16 x i8>, <16 x i8>, i32)
143 declare <8 x i16> @llvm.s390.vfaeh(<8 x i16>, <8 x i16>, i32)
144 declare <4 x i32> @llvm.s390.vfaef(<4 x i32>, <4 x i32>, i32)
145 declare {<16 x i8>, i32} @llvm.s390.vfaebs(<16 x i8>, <16 x i8>, i32)
146 declare {<8 x i16>, i32} @llvm.s390.vfaehs(<8 x i16>, <8 x i16>, i32)
147 declare {<4 x i32>, i32} @llvm.s390.vfaefs(<4 x i32>, <4 x i32>, i32)
148 declare <16 x i8> @llvm.s390.vfaezb(<16 x i8>, <16 x i8>, i32)
149 declare <8 x i16> @llvm.s390.vfaezh(<8 x i16>, <8 x i16>, i32)
150 declare <4 x i32> @llvm.s390.vfaezf(<4 x i32>, <4 x i32>, i32)
151 declare {<16 x i8>, i32} @llvm.s390.vfaezbs(<16 x i8>, <16 x i8>, i32)
152 declare {<8 x i16>, i32} @llvm.s390.vfaezhs(<8 x i16>, <8 x i16>, i32)
153 declare {<4 x i32>, i32} @llvm.s390.vfaezfs(<4 x i32>, <4 x i32>, i32)
154 declare <16 x i8> @llvm.s390.vfeeb(<16 x i8>, <16 x i8>)
155 declare <8 x i16> @llvm.s390.vfeeh(<8 x i16>, <8 x i16>)
156 declare <4 x i32> @llvm.s390.vfeef(<4 x i32>, <4 x i32>)
157 declare {<16 x i8>, i32} @llvm.s390.vfeebs(<16 x i8>, <16 x i8>)
158 declare {<8 x i16>, i32} @llvm.s390.vfeehs(<8 x i16>, <8 x i16>)
159 declare {<4 x i32>, i32} @llvm.s390.vfeefs(<4 x i32>, <4 x i32>)
160 declare <16 x i8> @llvm.s390.vfeezb(<16 x i8>, <16 x i8>)
161 declare <8 x i16> @llvm.s390.vfeezh(<8 x i16>, <8 x i16>)
162 declare <4 x i32> @llvm.s390.vfeezf(<4 x i32>, <4 x i32>)
163 declare {<16 x i8>, i32} @llvm.s390.vfeezbs(<16 x i8>, <16 x i8>)
164 declare {<8 x i16>, i32} @llvm.s390.vfeezhs(<8 x i16>, <8 x i16>)
165 declare {<4 x i32>, i32} @llvm.s390.vfeezfs(<4 x i32>, <4 x i32>)
166 declare <16 x i8> @llvm.s390.vfeneb(<16 x i8>, <16 x i8>)
167 declare <8 x i16> @llvm.s390.vfeneh(<8 x i16>, <8 x i16>)
168 declare <4 x i32> @llvm.s390.vfenef(<4 x i32>, <4 x i32>)
169 declare {<16 x i8>, i32} @llvm.s390.vfenebs(<16 x i8>, <16 x i8>)
170 declare {<8 x i16>, i32} @llvm.s390.vfenehs(<8 x i16>, <8 x i16>)
171 declare {<4 x i32>, i32} @llvm.s390.vfenefs(<4 x i32>, <4 x i32>)
172 declare <16 x i8> @llvm.s390.vfenezb(<16 x i8>, <16 x i8>)
173 declare <8 x i16> @llvm.s390.vfenezh(<8 x i16>, <8 x i16>)
174 declare <4 x i32> @llvm.s390.vfenezf(<4 x i32>, <4 x i32>)
175 declare {<16 x i8>, i32} @llvm.s390.vfenezbs(<16 x i8>, <16 x i8>)
176 declare {<8 x i16>, i32} @llvm.s390.vfenezhs(<8 x i16>, <8 x i16>)
177 declare {<4 x i32>, i32} @llvm.s390.vfenezfs(<4 x i32>, <4 x i32>)
178 declare <16 x i8> @llvm.s390.vistrb(<16 x i8>)
179 declare <8 x i16> @llvm.s390.vistrh(<8 x i16>)
180 declare <4 x i32> @llvm.s390.vistrf(<4 x i32>)
181 declare {<16 x i8>, i32} @llvm.s390.vistrbs(<16 x i8>)
182 declare {<8 x i16>, i32} @llvm.s390.vistrhs(<8 x i16>)
183 declare {<4 x i32>, i32} @llvm.s390.vistrfs(<4 x i32>)
184 declare <16 x i8> @llvm.s390.vstrcb(<16 x i8>, <16 x i8>, <16 x i8>, i32)
185 declare <8 x i16> @llvm.s390.vstrch(<8 x i16>, <8 x i16>, <8 x i16>, i32)
186 declare <4 x i32> @llvm.s390.vstrcf(<4 x i32>, <4 x i32>, <4 x i32>, i32)
187 declare {<16 x i8>, i32} @llvm.s390.vstrcbs(<16 x i8>, <16 x i8>, <16 x i8>,
189 declare {<8 x i16>, i32} @llvm.s390.vstrchs(<8 x i16>, <8 x i16>, <8 x i16>,
191 declare {<4 x i32>, i32} @llvm.s390.vstrcfs(<4 x i32>, <4 x i32>, <4 x i32>,
193 declare <16 x i8> @llvm.s390.vstrczb(<16 x i8>, <16 x i8>, <16 x i8>, i32)
194 declare <8 x i16> @llvm.s390.vstrczh(<8 x i16>, <8 x i16>, <8 x i16>, i32)
195 declare <4 x i32> @llvm.s390.vstrczf(<4 x i32>, <4 x i32>, <4 x i32>, i32)
196 declare {<16 x i8>, i32} @llvm.s390.vstrczbs(<16 x i8>, <16 x i8>, <16 x i8>,
198 declare {<8 x i16>, i32} @llvm.s390.vstrczhs(<8 x i16>, <8 x i16>, <8 x i16>,
200 declare {<4 x i32>, i32} @llvm.s390.vstrczfs(<4 x i32>, <4 x i32>, <4 x i32>,
202 declare {<2 x i64>, i32} @llvm.s390.vfcedbs(<2 x double>, <2 x double>)
203 declare {<2 x i64>, i32} @llvm.s390.vfchdbs(<2 x double>, <2 x double>)
204 declare {<2 x i64>, i32} @llvm.s390.vfchedbs(<2 x double>, <2 x double>)
205 declare {<2 x i64>, i32} @llvm.s390.vftcidb(<2 x double>, i32)
206 declare <2 x double> @llvm.s390.vfidb(<2 x double>, i32, i32)
208 ; LCBB with the lowest M3 operand.
209 define i32 @test_lcbb1(ptr %ptr) {
210 ; CHECK-LABEL: test_lcbb1:
211 ; CHECK: lcbb %r2, 0(%r2), 0
213 %res = call i32 @llvm.s390.lcbb(ptr %ptr, i32 0)
217 ; LCBB with the highest M3 operand.
218 define i32 @test_lcbb2(ptr %ptr) {
219 ; CHECK-LABEL: test_lcbb2:
220 ; CHECK: lcbb %r2, 0(%r2), 15
222 %res = call i32 @llvm.s390.lcbb(ptr %ptr, i32 15)
226 ; LCBB with a displacement and index.
227 define i32 @test_lcbb3(ptr %base, i64 %index) {
228 ; CHECK-LABEL: test_lcbb3:
229 ; CHECK: lcbb %r2, 4095({{%r2,%r3|%r3,%r2}}), 4
231 %add = add i64 %index, 4095
232 %ptr = getelementptr i8, ptr %base, i64 %add
233 %res = call i32 @llvm.s390.lcbb(ptr %ptr, i32 4)
237 ; LCBB with an out-of-range displacement.
238 define i32 @test_lcbb4(ptr %base) {
239 ; CHECK-LABEL: test_lcbb4:
240 ; CHECK: lcbb %r2, 0({{%r[1-5]}}), 5
242 %ptr = getelementptr i8, ptr %base, i64 4096
243 %res = call i32 @llvm.s390.lcbb(ptr %ptr, i32 5)
247 ; VLBB with the lowest M3 operand.
248 define <16 x i8> @test_vlbb1(ptr %ptr) {
249 ; CHECK-LABEL: test_vlbb1:
250 ; CHECK: vlbb %v24, 0(%r2), 0
252 %res = call <16 x i8> @llvm.s390.vlbb(ptr %ptr, i32 0)
256 ; VLBB with the highest M3 operand.
257 define <16 x i8> @test_vlbb2(ptr %ptr) {
258 ; CHECK-LABEL: test_vlbb2:
259 ; CHECK: vlbb %v24, 0(%r2), 15
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:
268 ; CHECK: vlbb %v24, 4095({{%r2,%r3|%r3,%r2}}), 4
270 %add = add i64 %index, 4095
271 %ptr = getelementptr i8, ptr %base, i64 %add
272 %res = call <16 x i8> @llvm.s390.vlbb(ptr %ptr, i32 4)
276 ; VLBB with an out-of-range displacement.
277 define <16 x i8> @test_vlbb4(ptr %base) {
278 ; CHECK-LABEL: test_vlbb4:
279 ; CHECK: vlbb %v24, 0({{%r[1-5]}}), 5
281 %ptr = getelementptr i8, ptr %base, i64 4096
282 %res = call <16 x i8> @llvm.s390.vlbb(ptr %ptr, i32 5)
286 ; VLL with the lowest in-range displacement.
287 define <16 x i8> @test_vll1(ptr %ptr, i32 %length) {
288 ; CHECK-LABEL: test_vll1:
289 ; CHECK: vll %v24, %r3, 0(%r2)
291 %res = call <16 x i8> @llvm.s390.vll(i32 %length, ptr %ptr)
295 ; VLL with the highest in-range displacement.
296 define <16 x i8> @test_vll2(ptr %base, i32 %length) {
297 ; CHECK-LABEL: test_vll2:
298 ; CHECK: vll %v24, %r3, 4095(%r2)
300 %ptr = getelementptr i8, ptr %base, i64 4095
301 %res = call <16 x i8> @llvm.s390.vll(i32 %length, ptr %ptr)
305 ; VLL with an out-of-range displacementa.
306 define <16 x i8> @test_vll3(ptr %base, i32 %length) {
307 ; CHECK-LABEL: test_vll3:
308 ; CHECK: vll %v24, %r3, 0({{%r[1-5]}})
310 %ptr = getelementptr i8, ptr %base, i64 4096
311 %res = call <16 x i8> @llvm.s390.vll(i32 %length, ptr %ptr)
315 ; Check that VLL doesn't allow an index.
316 define <16 x i8> @test_vll4(ptr %base, i64 %index, i32 %length) {
317 ; CHECK-LABEL: test_vll4:
318 ; CHECK: vll %v24, %r4, 0({{%r[1-5]}})
320 %ptr = getelementptr i8, ptr %base, i64 %index
321 %res = call <16 x i8> @llvm.s390.vll(i32 %length, ptr %ptr)
325 ; VLL with length >= 15 should become VL.
326 define <16 x i8> @test_vll5(ptr %ptr) {
327 ; CHECK-LABEL: test_vll5:
328 ; CHECK: vl %v24, 0({{%r[1-5]}})
330 %res = call <16 x i8> @llvm.s390.vll(i32 15, ptr %ptr)
334 ; VPDI taking element 0 from each half.
335 define <2 x i64> @test_vpdi1(<2 x i64> %a, <2 x i64> %b) {
336 ; CHECK-LABEL: test_vpdi1:
337 ; CHECK: vpdi %v24, %v24, %v26, 0
339 %res = call <2 x i64> @llvm.s390.vpdi(<2 x i64> %a, <2 x i64> %b, i32 0)
343 ; VPDI taking element 1 from each half.
344 define <2 x i64> @test_vpdi2(<2 x i64> %a, <2 x i64> %b) {
345 ; CHECK-LABEL: test_vpdi2:
346 ; CHECK: vpdi %v24, %v24, %v26, 5
348 %res = call <2 x i64> @llvm.s390.vpdi(<2 x i64> %a, <2 x i64> %b, i32 5)
353 define <16 x i8> @test_vperm(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {
354 ; CHECK-LABEL: test_vperm:
355 ; CHECK: vperm %v24, %v24, %v26, %v28
357 %res = call <16 x i8> @llvm.s390.vperm(<16 x i8> %a, <16 x i8> %b,
363 define <16 x i8> @test_vpksh(<8 x i16> %a, <8 x i16> %b) {
364 ; CHECK-LABEL: test_vpksh:
365 ; CHECK: vpksh %v24, %v24, %v26
367 %res = call <16 x i8> @llvm.s390.vpksh(<8 x i16> %a, <8 x i16> %b)
372 define <8 x i16> @test_vpksf(<4 x i32> %a, <4 x i32> %b) {
373 ; CHECK-LABEL: test_vpksf:
374 ; CHECK: vpksf %v24, %v24, %v26
376 %res = call <8 x i16> @llvm.s390.vpksf(<4 x i32> %a, <4 x i32> %b)
381 define <4 x i32> @test_vpksg(<2 x i64> %a, <2 x i64> %b) {
382 ; CHECK-LABEL: test_vpksg:
383 ; CHECK: vpksg %v24, %v24, %v26
385 %res = call <4 x i32> @llvm.s390.vpksg(<2 x i64> %a, <2 x i64> %b)
389 ; VPKSHS with no processing of the result.
390 define <16 x i8> @test_vpkshs(<8 x i16> %a, <8 x i16> %b, ptr %ccptr) {
391 ; CHECK-LABEL: test_vpkshs:
392 ; CHECK: vpkshs %v24, %v24, %v26
393 ; CHECK: ipm [[REG:%r[0-5]]]
394 ; CHECK: srl [[REG]], 28
395 ; CHECK: st [[REG]], 0(%r2)
397 %call = call {<16 x i8>, i32} @llvm.s390.vpkshs(<8 x i16> %a, <8 x i16> %b)
398 %res = extractvalue {<16 x i8>, i32} %call, 0
399 %cc = extractvalue {<16 x i8>, i32} %call, 1
400 store i32 %cc, ptr %ccptr
404 ; VPKSHS, storing to %ptr if all values were saturated.
405 define <16 x i8> @test_vpkshs_all_store(<8 x i16> %a, <8 x i16> %b, ptr %ptr) {
406 ; CHECK-LABEL: test_vpkshs_all_store:
407 ; CHECK: vpkshs %v24, %v24, %v26
408 ; CHECK-NEXT: {{bnor|bler}} %r14
409 ; CHECK: mvhi 0(%r2), 0
411 %call = call {<16 x i8>, i32} @llvm.s390.vpkshs(<8 x i16> %a, <8 x i16> %b)
412 %res = extractvalue {<16 x i8>, i32} %call, 0
413 %cc = extractvalue {<16 x i8>, i32} %call, 1
414 %cmp = icmp uge i32 %cc, 3
415 br i1 %cmp, label %store, label %exit
418 store i32 0, ptr %ptr
425 ; VPKSFS with no processing of the result.
426 define <8 x i16> @test_vpksfs(<4 x i32> %a, <4 x i32> %b, ptr %ccptr) {
427 ; CHECK-LABEL: test_vpksfs:
428 ; CHECK: vpksfs %v24, %v24, %v26
429 ; CHECK: ipm [[REG:%r[0-5]]]
430 ; CHECK: srl [[REG]], 28
431 ; CHECK: st [[REG]], 0(%r2)
433 %call = call {<8 x i16>, i32} @llvm.s390.vpksfs(<4 x i32> %a, <4 x i32> %b)
434 %res = extractvalue {<8 x i16>, i32} %call, 0
435 %cc = extractvalue {<8 x i16>, i32} %call, 1
436 store i32 %cc, ptr %ccptr
440 ; VPKSFS, storing to %ptr if any values were saturated.
441 define <8 x i16> @test_vpksfs_any_store(<4 x i32> %a, <4 x i32> %b, ptr %ptr) {
442 ; CHECK-LABEL: test_vpksfs_any_store:
443 ; CHECK: vpksfs %v24, %v24, %v26
444 ; CHECK-NEXT: {{bher|ber}} %r14
445 ; CHECK: mvhi 0(%r2), 0
447 %call = call {<8 x i16>, i32} @llvm.s390.vpksfs(<4 x i32> %a, <4 x i32> %b)
448 %res = extractvalue {<8 x i16>, i32} %call, 0
449 %cc = extractvalue {<8 x i16>, i32} %call, 1
450 %cmp = icmp ugt i32 %cc, 0
451 br i1 %cmp, label %store, label %exit
454 store i32 0, ptr %ptr
461 ; VPKSGS with no processing of the result.
462 define <4 x i32> @test_vpksgs(<2 x i64> %a, <2 x i64> %b, ptr %ccptr) {
463 ; CHECK-LABEL: test_vpksgs:
464 ; CHECK: vpksgs %v24, %v24, %v26
465 ; CHECK: ipm [[REG:%r[0-5]]]
466 ; CHECK: srl [[REG]], 28
467 ; CHECK: st [[REG]], 0(%r2)
469 %call = call {<4 x i32>, i32} @llvm.s390.vpksgs(<2 x i64> %a, <2 x i64> %b)
470 %res = extractvalue {<4 x i32>, i32} %call, 0
471 %cc = extractvalue {<4 x i32>, i32} %call, 1
472 store i32 %cc, ptr %ccptr
476 ; VPKSGS, storing to %ptr if no elements were saturated
477 define <4 x i32> @test_vpksgs_none_store(<2 x i64> %a, <2 x i64> %b,
479 ; CHECK-LABEL: test_vpksgs_none_store:
480 ; CHECK: vpksgs %v24, %v24, %v26
481 ; CHECK-NEXT: {{bnher|bner}} %r14
482 ; CHECK: mvhi 0(%r2), 0
484 %call = call {<4 x i32>, i32} @llvm.s390.vpksgs(<2 x i64> %a, <2 x i64> %b)
485 %res = extractvalue {<4 x i32>, i32} %call, 0
486 %cc = extractvalue {<4 x i32>, i32} %call, 1
487 %cmp = icmp sle i32 %cc, 0
488 br i1 %cmp, label %store, label %exit
491 store i32 0, ptr %ptr
499 define <16 x i8> @test_vpklsh(<8 x i16> %a, <8 x i16> %b) {
500 ; CHECK-LABEL: test_vpklsh:
501 ; CHECK: vpklsh %v24, %v24, %v26
503 %res = call <16 x i8> @llvm.s390.vpklsh(<8 x i16> %a, <8 x i16> %b)
508 define <8 x i16> @test_vpklsf(<4 x i32> %a, <4 x i32> %b) {
509 ; CHECK-LABEL: test_vpklsf:
510 ; CHECK: vpklsf %v24, %v24, %v26
512 %res = call <8 x i16> @llvm.s390.vpklsf(<4 x i32> %a, <4 x i32> %b)
517 define <4 x i32> @test_vpklsg(<2 x i64> %a, <2 x i64> %b) {
518 ; CHECK-LABEL: test_vpklsg:
519 ; CHECK: vpklsg %v24, %v24, %v26
521 %res = call <4 x i32> @llvm.s390.vpklsg(<2 x i64> %a, <2 x i64> %b)
525 ; VPKLSHS with no processing of the result.
526 define <16 x i8> @test_vpklshs(<8 x i16> %a, <8 x i16> %b, ptr %ccptr) {
527 ; CHECK-LABEL: test_vpklshs:
528 ; CHECK: vpklshs %v24, %v24, %v26
529 ; CHECK: ipm [[REG:%r[0-5]]]
530 ; CHECK: srl [[REG]], 28
531 ; CHECK: st [[REG]], 0(%r2)
533 %call = call {<16 x i8>, i32} @llvm.s390.vpklshs(<8 x i16> %a, <8 x i16> %b)
534 %res = extractvalue {<16 x i8>, i32} %call, 0
535 %cc = extractvalue {<16 x i8>, i32} %call, 1
536 store i32 %cc, ptr %ccptr
540 ; VPKLSHS, storing to %ptr if all values were saturated.
541 define <16 x i8> @test_vpklshs_all_store(<8 x i16> %a, <8 x i16> %b,
543 ; CHECK-LABEL: test_vpklshs_all_store:
544 ; CHECK: vpklshs %v24, %v24, %v26
545 ; CHECK-NEXT: {{bnor|bler}} %r14
546 ; CHECK: mvhi 0(%r2), 0
548 %call = call {<16 x i8>, i32} @llvm.s390.vpklshs(<8 x i16> %a, <8 x i16> %b)
549 %res = extractvalue {<16 x i8>, i32} %call, 0
550 %cc = extractvalue {<16 x i8>, i32} %call, 1
551 %cmp = icmp eq i32 %cc, 3
552 br i1 %cmp, label %store, label %exit
555 store i32 0, ptr %ptr
562 ; VPKLSFS with no processing of the result.
563 define <8 x i16> @test_vpklsfs(<4 x i32> %a, <4 x i32> %b, ptr %ccptr) {
564 ; CHECK-LABEL: test_vpklsfs:
565 ; CHECK: vpklsfs %v24, %v24, %v26
566 ; CHECK: ipm [[REG:%r[0-5]]]
567 ; CHECK: srl [[REG]], 28
568 ; CHECK: st [[REG]], 0(%r2)
570 %call = call {<8 x i16>, i32} @llvm.s390.vpklsfs(<4 x i32> %a, <4 x i32> %b)
571 %res = extractvalue {<8 x i16>, i32} %call, 0
572 %cc = extractvalue {<8 x i16>, i32} %call, 1
573 store i32 %cc, ptr %ccptr
577 ; VPKLSFS, storing to %ptr if any values were saturated.
578 define <8 x i16> @test_vpklsfs_any_store(<4 x i32> %a, <4 x i32> %b,
580 ; CHECK-LABEL: test_vpklsfs_any_store:
581 ; CHECK: vpklsfs %v24, %v24, %v26
582 ; CHECK-NEXT: {{bher|ber}} %r14
583 ; CHECK: mvhi 0(%r2), 0
585 %call = call {<8 x i16>, i32} @llvm.s390.vpklsfs(<4 x i32> %a, <4 x i32> %b)
586 %res = extractvalue {<8 x i16>, i32} %call, 0
587 %cc = extractvalue {<8 x i16>, i32} %call, 1
588 %cmp = icmp ne i32 %cc, 0
589 br i1 %cmp, label %store, label %exit
592 store i32 0, ptr %ptr
599 ; VPKLSGS with no processing of the result.
600 define <4 x i32> @test_vpklsgs(<2 x i64> %a, <2 x i64> %b, ptr %ccptr) {
601 ; CHECK-LABEL: test_vpklsgs:
602 ; CHECK: vpklsgs %v24, %v24, %v26
603 ; CHECK: ipm [[REG:%r[0-5]]]
604 ; CHECK: srl [[REG]], 28
605 ; CHECK: st [[REG]], 0(%r2)
607 %call = call {<4 x i32>, i32} @llvm.s390.vpklsgs(<2 x i64> %a, <2 x i64> %b)
608 %res = extractvalue {<4 x i32>, i32} %call, 0
609 %cc = extractvalue {<4 x i32>, i32} %call, 1
610 store i32 %cc, ptr %ccptr
614 ; VPKLSGS, storing to %ptr if no elements were saturated
615 define <4 x i32> @test_vpklsgs_none_store(<2 x i64> %a, <2 x i64> %b,
617 ; CHECK-LABEL: test_vpklsgs_none_store:
618 ; CHECK: vpklsgs %v24, %v24, %v26
619 ; CHECK-NEXT: {{bnher|bner}} %r14
620 ; CHECK: mvhi 0(%r2), 0
622 %call = call {<4 x i32>, i32} @llvm.s390.vpklsgs(<2 x i64> %a, <2 x i64> %b)
623 %res = extractvalue {<4 x i32>, i32} %call, 0
624 %cc = extractvalue {<4 x i32>, i32} %call, 1
625 %cmp = icmp eq i32 %cc, 0
626 br i1 %cmp, label %store, label %exit
629 store i32 0, ptr %ptr
636 ; VSTL with the lowest in-range displacement.
637 define void @test_vstl1(<16 x i8> %vec, ptr %ptr, i32 %length) {
638 ; CHECK-LABEL: test_vstl1:
639 ; CHECK: vstl %v24, %r3, 0(%r2)
641 call void @llvm.s390.vstl(<16 x i8> %vec, i32 %length, ptr %ptr)
645 ; VSTL with the highest in-range displacement.
646 define void @test_vstl2(<16 x i8> %vec, ptr %base, i32 %length) {
647 ; CHECK-LABEL: test_vstl2:
648 ; CHECK: vstl %v24, %r3, 4095(%r2)
650 %ptr = getelementptr i8, ptr %base, i64 4095
651 call void @llvm.s390.vstl(<16 x i8> %vec, i32 %length, ptr %ptr)
655 ; VSTL with an out-of-range displacement.
656 define void @test_vstl3(<16 x i8> %vec, ptr %base, i32 %length) {
657 ; CHECK-LABEL: test_vstl3:
658 ; CHECK: vstl %v24, %r3, 0({{%r[1-5]}})
660 %ptr = getelementptr i8, ptr %base, i64 4096
661 call void @llvm.s390.vstl(<16 x i8> %vec, i32 %length, ptr %ptr)
665 ; Check that VSTL doesn't allow an index.
666 define void @test_vstl4(<16 x i8> %vec, ptr %base, i64 %index, i32 %length) {
667 ; CHECK-LABEL: test_vstl4:
668 ; CHECK: vstl %v24, %r4, 0({{%r[1-5]}})
670 %ptr = getelementptr i8, ptr %base, i64 %index
671 call void @llvm.s390.vstl(<16 x i8> %vec, i32 %length, ptr %ptr)
675 ; VSTL with length >= 15 should become VST.
676 define void @test_vstl5(<16 x i8> %vec, ptr %ptr) {
677 ; CHECK-LABEL: test_vstl5:
678 ; CHECK: vst %v24, 0({{%r[1-5]}})
680 call void @llvm.s390.vstl(<16 x i8> %vec, i32 15, ptr %ptr)
685 define <8 x i16> @test_vuphb(<16 x i8> %a) {
686 ; CHECK-LABEL: test_vuphb:
687 ; CHECK: vuphb %v24, %v24
689 %res = call <8 x i16> @llvm.s390.vuphb(<16 x i8> %a)
694 define <4 x i32> @test_vuphh(<8 x i16> %a) {
695 ; CHECK-LABEL: test_vuphh:
696 ; CHECK: vuphh %v24, %v24
698 %res = call <4 x i32> @llvm.s390.vuphh(<8 x i16> %a)
703 define <2 x i64> @test_vuphf(<4 x i32> %a) {
704 ; CHECK-LABEL: test_vuphf:
705 ; CHECK: vuphf %v24, %v24
707 %res = call <2 x i64> @llvm.s390.vuphf(<4 x i32> %a)
712 define <8 x i16> @test_vuplhb(<16 x i8> %a) {
713 ; CHECK-LABEL: test_vuplhb:
714 ; CHECK: vuplhb %v24, %v24
716 %res = call <8 x i16> @llvm.s390.vuplhb(<16 x i8> %a)
721 define <4 x i32> @test_vuplhh(<8 x i16> %a) {
722 ; CHECK-LABEL: test_vuplhh:
723 ; CHECK: vuplhh %v24, %v24
725 %res = call <4 x i32> @llvm.s390.vuplhh(<8 x i16> %a)
730 define <2 x i64> @test_vuplhf(<4 x i32> %a) {
731 ; CHECK-LABEL: test_vuplhf:
732 ; CHECK: vuplhf %v24, %v24
734 %res = call <2 x i64> @llvm.s390.vuplhf(<4 x i32> %a)
739 define <8 x i16> @test_vuplb(<16 x i8> %a) {
740 ; CHECK-LABEL: test_vuplb:
741 ; CHECK: vuplb %v24, %v24
743 %res = call <8 x i16> @llvm.s390.vuplb(<16 x i8> %a)
748 define <4 x i32> @test_vuplhw(<8 x i16> %a) {
749 ; CHECK-LABEL: test_vuplhw:
750 ; CHECK: vuplhw %v24, %v24
752 %res = call <4 x i32> @llvm.s390.vuplhw(<8 x i16> %a)
757 define <2 x i64> @test_vuplf(<4 x i32> %a) {
758 ; CHECK-LABEL: test_vuplf:
759 ; CHECK: vuplf %v24, %v24
761 %res = call <2 x i64> @llvm.s390.vuplf(<4 x i32> %a)
766 define <8 x i16> @test_vupllb(<16 x i8> %a) {
767 ; CHECK-LABEL: test_vupllb:
768 ; CHECK: vupllb %v24, %v24
770 %res = call <8 x i16> @llvm.s390.vupllb(<16 x i8> %a)
775 define <4 x i32> @test_vupllh(<8 x i16> %a) {
776 ; CHECK-LABEL: test_vupllh:
777 ; CHECK: vupllh %v24, %v24
779 %res = call <4 x i32> @llvm.s390.vupllh(<8 x i16> %a)
784 define <2 x i64> @test_vupllf(<4 x i32> %a) {
785 ; CHECK-LABEL: test_vupllf:
786 ; CHECK: vupllf %v24, %v24
788 %res = call <2 x i64> @llvm.s390.vupllf(<4 x i32> %a)
793 define <16 x i8> @test_vaccb(<16 x i8> %a, <16 x i8> %b) {
794 ; CHECK-LABEL: test_vaccb:
795 ; CHECK: vaccb %v24, %v24, %v26
797 %res = call <16 x i8> @llvm.s390.vaccb(<16 x i8> %a, <16 x i8> %b)
802 define <8 x i16> @test_vacch(<8 x i16> %a, <8 x i16> %b) {
803 ; CHECK-LABEL: test_vacch:
804 ; CHECK: vacch %v24, %v24, %v26
806 %res = call <8 x i16> @llvm.s390.vacch(<8 x i16> %a, <8 x i16> %b)
811 define <4 x i32> @test_vaccf(<4 x i32> %a, <4 x i32> %b) {
812 ; CHECK-LABEL: test_vaccf:
813 ; CHECK: vaccf %v24, %v24, %v26
815 %res = call <4 x i32> @llvm.s390.vaccf(<4 x i32> %a, <4 x i32> %b)
820 define <2 x i64> @test_vaccg(<2 x i64> %a, <2 x i64> %b) {
821 ; CHECK-LABEL: test_vaccg:
822 ; CHECK: vaccg %v24, %v24, %v26
824 %res = call <2 x i64> @llvm.s390.vaccg(<2 x i64> %a, <2 x i64> %b)
829 define <16 x i8> @test_vaq(<16 x i8> %a, <16 x i8> %b) {
830 ; CHECK-LABEL: test_vaq:
831 ; CHECK: vaq %v24, %v24, %v26
833 %res = call <16 x i8> @llvm.s390.vaq(<16 x i8> %a, <16 x i8> %b)
838 define <16 x i8> @test_vacq(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {
839 ; CHECK-LABEL: test_vacq:
840 ; CHECK: vacq %v24, %v24, %v26, %v28
842 %res = call <16 x i8> @llvm.s390.vacq(<16 x i8> %a, <16 x i8> %b,
848 define <16 x i8> @test_vaccq(<16 x i8> %a, <16 x i8> %b) {
849 ; CHECK-LABEL: test_vaccq:
850 ; CHECK: vaccq %v24, %v24, %v26
852 %res = call <16 x i8> @llvm.s390.vaccq(<16 x i8> %a, <16 x i8> %b)
857 define <16 x i8> @test_vacccq(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {
858 ; CHECK-LABEL: test_vacccq:
859 ; CHECK: vacccq %v24, %v24, %v26, %v28
861 %res = call <16 x i8> @llvm.s390.vacccq(<16 x i8> %a, <16 x i8> %b,
867 define <16 x i8> @test_vavgb(<16 x i8> %a, <16 x i8> %b) {
868 ; CHECK-LABEL: test_vavgb:
869 ; CHECK: vavgb %v24, %v24, %v26
871 %res = call <16 x i8> @llvm.s390.vavgb(<16 x i8> %a, <16 x i8> %b)
876 define <8 x i16> @test_vavgh(<8 x i16> %a, <8 x i16> %b) {
877 ; CHECK-LABEL: test_vavgh:
878 ; CHECK: vavgh %v24, %v24, %v26
880 %res = call <8 x i16> @llvm.s390.vavgh(<8 x i16> %a, <8 x i16> %b)
885 define <4 x i32> @test_vavgf(<4 x i32> %a, <4 x i32> %b) {
886 ; CHECK-LABEL: test_vavgf:
887 ; CHECK: vavgf %v24, %v24, %v26
889 %res = call <4 x i32> @llvm.s390.vavgf(<4 x i32> %a, <4 x i32> %b)
894 define <2 x i64> @test_vavgg(<2 x i64> %a, <2 x i64> %b) {
895 ; CHECK-LABEL: test_vavgg:
896 ; CHECK: vavgg %v24, %v24, %v26
898 %res = call <2 x i64> @llvm.s390.vavgg(<2 x i64> %a, <2 x i64> %b)
903 define <16 x i8> @test_vavglb(<16 x i8> %a, <16 x i8> %b) {
904 ; CHECK-LABEL: test_vavglb:
905 ; CHECK: vavglb %v24, %v24, %v26
907 %res = call <16 x i8> @llvm.s390.vavglb(<16 x i8> %a, <16 x i8> %b)
912 define <8 x i16> @test_vavglh(<8 x i16> %a, <8 x i16> %b) {
913 ; CHECK-LABEL: test_vavglh:
914 ; CHECK: vavglh %v24, %v24, %v26
916 %res = call <8 x i16> @llvm.s390.vavglh(<8 x i16> %a, <8 x i16> %b)
921 define <4 x i32> @test_vavglf(<4 x i32> %a, <4 x i32> %b) {
922 ; CHECK-LABEL: test_vavglf:
923 ; CHECK: vavglf %v24, %v24, %v26
925 %res = call <4 x i32> @llvm.s390.vavglf(<4 x i32> %a, <4 x i32> %b)
930 define <2 x i64> @test_vavglg(<2 x i64> %a, <2 x i64> %b) {
931 ; CHECK-LABEL: test_vavglg:
932 ; CHECK: vavglg %v24, %v24, %v26
934 %res = call <2 x i64> @llvm.s390.vavglg(<2 x i64> %a, <2 x i64> %b)
939 define <4 x i32> @test_vcksm(<4 x i32> %a, <4 x i32> %b) {
940 ; CHECK-LABEL: test_vcksm:
941 ; CHECK: vcksm %v24, %v24, %v26
943 %res = call <4 x i32> @llvm.s390.vcksm(<4 x i32> %a, <4 x i32> %b)
948 define <8 x i16> @test_vgfmb(<16 x i8> %a, <16 x i8> %b) {
949 ; CHECK-LABEL: test_vgfmb:
950 ; CHECK: vgfmb %v24, %v24, %v26
952 %res = call <8 x i16> @llvm.s390.vgfmb(<16 x i8> %a, <16 x i8> %b)
957 define <4 x i32> @test_vgfmh(<8 x i16> %a, <8 x i16> %b) {
958 ; CHECK-LABEL: test_vgfmh:
959 ; CHECK: vgfmh %v24, %v24, %v26
961 %res = call <4 x i32> @llvm.s390.vgfmh(<8 x i16> %a, <8 x i16> %b)
966 define <2 x i64> @test_vgfmf(<4 x i32> %a, <4 x i32> %b) {
967 ; CHECK-LABEL: test_vgfmf:
968 ; CHECK: vgfmf %v24, %v24, %v26
970 %res = call <2 x i64> @llvm.s390.vgfmf(<4 x i32> %a, <4 x i32> %b)
975 define <16 x i8> @test_vgfmg(<2 x i64> %a, <2 x i64> %b) {
976 ; CHECK-LABEL: test_vgfmg:
977 ; CHECK: vgfmg %v24, %v24, %v26
979 %res = call <16 x i8> @llvm.s390.vgfmg(<2 x i64> %a, <2 x i64> %b)
984 define <8 x i16> @test_vgfmab(<16 x i8> %a, <16 x i8> %b, <8 x i16> %c) {
985 ; CHECK-LABEL: test_vgfmab:
986 ; CHECK: vgfmab %v24, %v24, %v26, %v28
988 %res = call <8 x i16> @llvm.s390.vgfmab(<16 x i8> %a, <16 x i8> %b,
994 define <4 x i32> @test_vgfmah(<8 x i16> %a, <8 x i16> %b, <4 x i32> %c) {
995 ; CHECK-LABEL: test_vgfmah:
996 ; CHECK: vgfmah %v24, %v24, %v26, %v28
998 %res = call <4 x i32> @llvm.s390.vgfmah(<8 x i16> %a, <8 x i16> %b,
1004 define <2 x i64> @test_vgfmaf(<4 x i32> %a, <4 x i32> %b, <2 x i64> %c) {
1005 ; CHECK-LABEL: test_vgfmaf:
1006 ; CHECK: vgfmaf %v24, %v24, %v26, %v28
1008 %res = call <2 x i64> @llvm.s390.vgfmaf(<4 x i32> %a, <4 x i32> %b,
1014 define <16 x i8> @test_vgfmag(<2 x i64> %a, <2 x i64> %b, <16 x i8> %c) {
1015 ; CHECK-LABEL: test_vgfmag:
1016 ; CHECK: vgfmag %v24, %v24, %v26, %v28
1018 %res = call <16 x i8> @llvm.s390.vgfmag(<2 x i64> %a, <2 x i64> %b,
1024 define <16 x i8> @test_vmahb(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {
1025 ; CHECK-LABEL: test_vmahb:
1026 ; CHECK: vmahb %v24, %v24, %v26, %v28
1028 %res = call <16 x i8> @llvm.s390.vmahb(<16 x i8> %a, <16 x i8> %b,
1034 define <8 x i16> @test_vmahh(<8 x i16> %a, <8 x i16> %b, <8 x i16> %c) {
1035 ; CHECK-LABEL: test_vmahh:
1036 ; CHECK: vmahh %v24, %v24, %v26, %v28
1038 %res = call <8 x i16> @llvm.s390.vmahh(<8 x i16> %a, <8 x i16> %b,
1044 define <4 x i32> @test_vmahf(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
1045 ; CHECK-LABEL: test_vmahf:
1046 ; CHECK: vmahf %v24, %v24, %v26, %v28
1048 %res = call <4 x i32> @llvm.s390.vmahf(<4 x i32> %a, <4 x i32> %b,
1054 define <16 x i8> @test_vmalhb(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {
1055 ; CHECK-LABEL: test_vmalhb:
1056 ; CHECK: vmalhb %v24, %v24, %v26, %v28
1058 %res = call <16 x i8> @llvm.s390.vmalhb(<16 x i8> %a, <16 x i8> %b,
1064 define <8 x i16> @test_vmalhh(<8 x i16> %a, <8 x i16> %b, <8 x i16> %c) {
1065 ; CHECK-LABEL: test_vmalhh:
1066 ; CHECK: vmalhh %v24, %v24, %v26, %v28
1068 %res = call <8 x i16> @llvm.s390.vmalhh(<8 x i16> %a, <8 x i16> %b,
1074 define <4 x i32> @test_vmalhf(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
1075 ; CHECK-LABEL: test_vmalhf:
1076 ; CHECK: vmalhf %v24, %v24, %v26, %v28
1078 %res = call <4 x i32> @llvm.s390.vmalhf(<4 x i32> %a, <4 x i32> %b,
1084 define <8 x i16> @test_vmaeb(<16 x i8> %a, <16 x i8> %b, <8 x i16> %c) {
1085 ; CHECK-LABEL: test_vmaeb:
1086 ; CHECK: vmaeb %v24, %v24, %v26, %v28
1088 %res = call <8 x i16> @llvm.s390.vmaeb(<16 x i8> %a, <16 x i8> %b,
1094 define <4 x i32> @test_vmaeh(<8 x i16> %a, <8 x i16> %b, <4 x i32> %c) {
1095 ; CHECK-LABEL: test_vmaeh:
1096 ; CHECK: vmaeh %v24, %v24, %v26, %v28
1098 %res = call <4 x i32> @llvm.s390.vmaeh(<8 x i16> %a, <8 x i16> %b,
1104 define <2 x i64> @test_vmaef(<4 x i32> %a, <4 x i32> %b, <2 x i64> %c) {
1105 ; CHECK-LABEL: test_vmaef:
1106 ; CHECK: vmaef %v24, %v24, %v26, %v28
1108 %res = call <2 x i64> @llvm.s390.vmaef(<4 x i32> %a, <4 x i32> %b,
1114 define <8 x i16> @test_vmaleb(<16 x i8> %a, <16 x i8> %b, <8 x i16> %c) {
1115 ; CHECK-LABEL: test_vmaleb:
1116 ; CHECK: vmaleb %v24, %v24, %v26, %v28
1118 %res = call <8 x i16> @llvm.s390.vmaleb(<16 x i8> %a, <16 x i8> %b,
1124 define <4 x i32> @test_vmaleh(<8 x i16> %a, <8 x i16> %b, <4 x i32> %c) {
1125 ; CHECK-LABEL: test_vmaleh:
1126 ; CHECK: vmaleh %v24, %v24, %v26, %v28
1128 %res = call <4 x i32> @llvm.s390.vmaleh(<8 x i16> %a, <8 x i16> %b,
1134 define <2 x i64> @test_vmalef(<4 x i32> %a, <4 x i32> %b, <2 x i64> %c) {
1135 ; CHECK-LABEL: test_vmalef:
1136 ; CHECK: vmalef %v24, %v24, %v26, %v28
1138 %res = call <2 x i64> @llvm.s390.vmalef(<4 x i32> %a, <4 x i32> %b,
1144 define <8 x i16> @test_vmaob(<16 x i8> %a, <16 x i8> %b, <8 x i16> %c) {
1145 ; CHECK-LABEL: test_vmaob:
1146 ; CHECK: vmaob %v24, %v24, %v26, %v28
1148 %res = call <8 x i16> @llvm.s390.vmaob(<16 x i8> %a, <16 x i8> %b,
1154 define <4 x i32> @test_vmaoh(<8 x i16> %a, <8 x i16> %b, <4 x i32> %c) {
1155 ; CHECK-LABEL: test_vmaoh:
1156 ; CHECK: vmaoh %v24, %v24, %v26, %v28
1158 %res = call <4 x i32> @llvm.s390.vmaoh(<8 x i16> %a, <8 x i16> %b,
1164 define <2 x i64> @test_vmaof(<4 x i32> %a, <4 x i32> %b, <2 x i64> %c) {
1165 ; CHECK-LABEL: test_vmaof:
1166 ; CHECK: vmaof %v24, %v24, %v26, %v28
1168 %res = call <2 x i64> @llvm.s390.vmaof(<4 x i32> %a, <4 x i32> %b,
1174 define <8 x i16> @test_vmalob(<16 x i8> %a, <16 x i8> %b, <8 x i16> %c) {
1175 ; CHECK-LABEL: test_vmalob:
1176 ; CHECK: vmalob %v24, %v24, %v26, %v28
1178 %res = call <8 x i16> @llvm.s390.vmalob(<16 x i8> %a, <16 x i8> %b,
1184 define <4 x i32> @test_vmaloh(<8 x i16> %a, <8 x i16> %b, <4 x i32> %c) {
1185 ; CHECK-LABEL: test_vmaloh:
1186 ; CHECK: vmaloh %v24, %v24, %v26, %v28
1188 %res = call <4 x i32> @llvm.s390.vmaloh(<8 x i16> %a, <8 x i16> %b,
1194 define <2 x i64> @test_vmalof(<4 x i32> %a, <4 x i32> %b, <2 x i64> %c) {
1195 ; CHECK-LABEL: test_vmalof:
1196 ; CHECK: vmalof %v24, %v24, %v26, %v28
1198 %res = call <2 x i64> @llvm.s390.vmalof(<4 x i32> %a, <4 x i32> %b,
1204 define <16 x i8> @test_vmhb(<16 x i8> %a, <16 x i8> %b) {
1205 ; CHECK-LABEL: test_vmhb:
1206 ; CHECK: vmhb %v24, %v24, %v26
1208 %res = call <16 x i8> @llvm.s390.vmhb(<16 x i8> %a, <16 x i8> %b)
1213 define <8 x i16> @test_vmhh(<8 x i16> %a, <8 x i16> %b) {
1214 ; CHECK-LABEL: test_vmhh:
1215 ; CHECK: vmhh %v24, %v24, %v26
1217 %res = call <8 x i16> @llvm.s390.vmhh(<8 x i16> %a, <8 x i16> %b)
1222 define <4 x i32> @test_vmhf(<4 x i32> %a, <4 x i32> %b) {
1223 ; CHECK-LABEL: test_vmhf:
1224 ; CHECK: vmhf %v24, %v24, %v26
1226 %res = call <4 x i32> @llvm.s390.vmhf(<4 x i32> %a, <4 x i32> %b)
1231 define <16 x i8> @test_vmlhb(<16 x i8> %a, <16 x i8> %b) {
1232 ; CHECK-LABEL: test_vmlhb:
1233 ; CHECK: vmlhb %v24, %v24, %v26
1235 %res = call <16 x i8> @llvm.s390.vmlhb(<16 x i8> %a, <16 x i8> %b)
1240 define <8 x i16> @test_vmlhh(<8 x i16> %a, <8 x i16> %b) {
1241 ; CHECK-LABEL: test_vmlhh:
1242 ; CHECK: vmlhh %v24, %v24, %v26
1244 %res = call <8 x i16> @llvm.s390.vmlhh(<8 x i16> %a, <8 x i16> %b)
1249 define <4 x i32> @test_vmlhf(<4 x i32> %a, <4 x i32> %b) {
1250 ; CHECK-LABEL: test_vmlhf:
1251 ; CHECK: vmlhf %v24, %v24, %v26
1253 %res = call <4 x i32> @llvm.s390.vmlhf(<4 x i32> %a, <4 x i32> %b)
1258 define <8 x i16> @test_vmeb(<16 x i8> %a, <16 x i8> %b) {
1259 ; CHECK-LABEL: test_vmeb:
1260 ; CHECK: vmeb %v24, %v24, %v26
1262 %res = call <8 x i16> @llvm.s390.vmeb(<16 x i8> %a, <16 x i8> %b)
1267 define <4 x i32> @test_vmeh(<8 x i16> %a, <8 x i16> %b) {
1268 ; CHECK-LABEL: test_vmeh:
1269 ; CHECK: vmeh %v24, %v24, %v26
1271 %res = call <4 x i32> @llvm.s390.vmeh(<8 x i16> %a, <8 x i16> %b)
1276 define <2 x i64> @test_vmef(<4 x i32> %a, <4 x i32> %b) {
1277 ; CHECK-LABEL: test_vmef:
1278 ; CHECK: vmef %v24, %v24, %v26
1280 %res = call <2 x i64> @llvm.s390.vmef(<4 x i32> %a, <4 x i32> %b)
1285 define <8 x i16> @test_vmleb(<16 x i8> %a, <16 x i8> %b) {
1286 ; CHECK-LABEL: test_vmleb:
1287 ; CHECK: vmleb %v24, %v24, %v26
1289 %res = call <8 x i16> @llvm.s390.vmleb(<16 x i8> %a, <16 x i8> %b)
1294 define <4 x i32> @test_vmleh(<8 x i16> %a, <8 x i16> %b) {
1295 ; CHECK-LABEL: test_vmleh:
1296 ; CHECK: vmleh %v24, %v24, %v26
1298 %res = call <4 x i32> @llvm.s390.vmleh(<8 x i16> %a, <8 x i16> %b)
1303 define <2 x i64> @test_vmlef(<4 x i32> %a, <4 x i32> %b) {
1304 ; CHECK-LABEL: test_vmlef:
1305 ; CHECK: vmlef %v24, %v24, %v26
1307 %res = call <2 x i64> @llvm.s390.vmlef(<4 x i32> %a, <4 x i32> %b)
1312 define <8 x i16> @test_vmob(<16 x i8> %a, <16 x i8> %b) {
1313 ; CHECK-LABEL: test_vmob:
1314 ; CHECK: vmob %v24, %v24, %v26
1316 %res = call <8 x i16> @llvm.s390.vmob(<16 x i8> %a, <16 x i8> %b)
1321 define <4 x i32> @test_vmoh(<8 x i16> %a, <8 x i16> %b) {
1322 ; CHECK-LABEL: test_vmoh:
1323 ; CHECK: vmoh %v24, %v24, %v26
1325 %res = call <4 x i32> @llvm.s390.vmoh(<8 x i16> %a, <8 x i16> %b)
1330 define <2 x i64> @test_vmof(<4 x i32> %a, <4 x i32> %b) {
1331 ; CHECK-LABEL: test_vmof:
1332 ; CHECK: vmof %v24, %v24, %v26
1334 %res = call <2 x i64> @llvm.s390.vmof(<4 x i32> %a, <4 x i32> %b)
1339 define <8 x i16> @test_vmlob(<16 x i8> %a, <16 x i8> %b) {
1340 ; CHECK-LABEL: test_vmlob:
1341 ; CHECK: vmlob %v24, %v24, %v26
1343 %res = call <8 x i16> @llvm.s390.vmlob(<16 x i8> %a, <16 x i8> %b)
1348 define <4 x i32> @test_vmloh(<8 x i16> %a, <8 x i16> %b) {
1349 ; CHECK-LABEL: test_vmloh:
1350 ; CHECK: vmloh %v24, %v24, %v26
1352 %res = call <4 x i32> @llvm.s390.vmloh(<8 x i16> %a, <8 x i16> %b)
1357 define <2 x i64> @test_vmlof(<4 x i32> %a, <4 x i32> %b) {
1358 ; CHECK-LABEL: test_vmlof:
1359 ; CHECK: vmlof %v24, %v24, %v26
1361 %res = call <2 x i64> @llvm.s390.vmlof(<4 x i32> %a, <4 x i32> %b)
1366 define <16 x i8> @test_verllvb(<16 x i8> %a, <16 x i8> %b) {
1367 ; CHECK-LABEL: test_verllvb:
1368 ; CHECK: verllvb %v24, %v24, %v26
1370 %res = call <16 x i8> @llvm.s390.verllvb(<16 x i8> %a, <16 x i8> %b)
1375 define <8 x i16> @test_verllvh(<8 x i16> %a, <8 x i16> %b) {
1376 ; CHECK-LABEL: test_verllvh:
1377 ; CHECK: verllvh %v24, %v24, %v26
1379 %res = call <8 x i16> @llvm.s390.verllvh(<8 x i16> %a, <8 x i16> %b)
1384 define <4 x i32> @test_verllvf(<4 x i32> %a, <4 x i32> %b) {
1385 ; CHECK-LABEL: test_verllvf:
1386 ; CHECK: verllvf %v24, %v24, %v26
1388 %res = call <4 x i32> @llvm.s390.verllvf(<4 x i32> %a, <4 x i32> %b)
1393 define <2 x i64> @test_verllvg(<2 x i64> %a, <2 x i64> %b) {
1394 ; CHECK-LABEL: test_verllvg:
1395 ; CHECK: verllvg %v24, %v24, %v26
1397 %res = call <2 x i64> @llvm.s390.verllvg(<2 x i64> %a, <2 x i64> %b)
1402 define <16 x i8> @test_verllb(<16 x i8> %a, i32 %b) {
1403 ; CHECK-LABEL: test_verllb:
1404 ; CHECK: verllb %v24, %v24, 0(%r2)
1406 %res = call <16 x i8> @llvm.s390.verllb(<16 x i8> %a, i32 %b)
1411 define <8 x i16> @test_verllh(<8 x i16> %a, i32 %b) {
1412 ; CHECK-LABEL: test_verllh:
1413 ; CHECK: verllh %v24, %v24, 0(%r2)
1415 %res = call <8 x i16> @llvm.s390.verllh(<8 x i16> %a, i32 %b)
1420 define <4 x i32> @test_verllf(<4 x i32> %a, i32 %b) {
1421 ; CHECK-LABEL: test_verllf:
1422 ; CHECK: verllf %v24, %v24, 0(%r2)
1424 %res = call <4 x i32> @llvm.s390.verllf(<4 x i32> %a, i32 %b)
1429 define <2 x i64> @test_verllg(<2 x i64> %a, i32 %b) {
1430 ; CHECK-LABEL: test_verllg:
1431 ; CHECK: verllg %v24, %v24, 0(%r2)
1433 %res = call <2 x i64> @llvm.s390.verllg(<2 x i64> %a, i32 %b)
1437 ; VERLLB with the smallest count.
1438 define <16 x i8> @test_verllb_1(<16 x i8> %a) {
1439 ; CHECK-LABEL: test_verllb_1:
1440 ; CHECK: verllb %v24, %v24, 1
1442 %res = call <16 x i8> @llvm.s390.verllb(<16 x i8> %a, i32 1)
1446 ; VERLLB with the largest count.
1447 define <16 x i8> @test_verllb_4095(<16 x i8> %a) {
1448 ; CHECK-LABEL: test_verllb_4095:
1449 ; CHECK: verllb %v24, %v24, 4095
1451 %res = call <16 x i8> @llvm.s390.verllb(<16 x i8> %a, i32 4095)
1455 ; VERLLB with the largest count + 1.
1456 define <16 x i8> @test_verllb_4096(<16 x i8> %a) {
1457 ; CHECK-LABEL: test_verllb_4096:
1458 ; CHECK: lhi [[REG:%r[1-5]]], 4096
1459 ; CHECK: verllb %v24, %v24, 0([[REG]])
1461 %res = call <16 x i8> @llvm.s390.verllb(<16 x i8> %a, i32 4096)
1466 define <16 x i8> @test_verimb(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {
1467 ; CHECK-LABEL: test_verimb:
1468 ; CHECK: verimb %v24, %v26, %v28, 1
1470 %res = call <16 x i8> @llvm.s390.verimb(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c, i32 1)
1475 define <8 x i16> @test_verimh(<8 x i16> %a, <8 x i16> %b, <8 x i16> %c) {
1476 ; CHECK-LABEL: test_verimh:
1477 ; CHECK: verimh %v24, %v26, %v28, 1
1479 %res = call <8 x i16> @llvm.s390.verimh(<8 x i16> %a, <8 x i16> %b, <8 x i16> %c, i32 1)
1484 define <4 x i32> @test_verimf(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
1485 ; CHECK-LABEL: test_verimf:
1486 ; CHECK: verimf %v24, %v26, %v28, 1
1488 %res = call <4 x i32> @llvm.s390.verimf(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c, i32 1)
1493 define <2 x i64> @test_verimg(<2 x i64> %a, <2 x i64> %b, <2 x i64> %c) {
1494 ; CHECK-LABEL: test_verimg:
1495 ; CHECK: verimg %v24, %v26, %v28, 1
1497 %res = call <2 x i64> @llvm.s390.verimg(<2 x i64> %a, <2 x i64> %b, <2 x i64> %c, i32 1)
1501 ; VERIMB with a different mask.
1502 define <16 x i8> @test_verimb_254(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {
1503 ; CHECK-LABEL: test_verimb_254:
1504 ; CHECK: verimb %v24, %v26, %v28, 254
1506 %res = call <16 x i8> @llvm.s390.verimb(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c, i32 254)
1511 define <16 x i8> @test_vsl(<16 x i8> %a, <16 x i8> %b) {
1512 ; CHECK-LABEL: test_vsl:
1513 ; CHECK: vsl %v24, %v24, %v26
1515 %res = call <16 x i8> @llvm.s390.vsl(<16 x i8> %a, <16 x i8> %b)
1520 define <16 x i8> @test_vslb(<16 x i8> %a, <16 x i8> %b) {
1521 ; CHECK-LABEL: test_vslb:
1522 ; CHECK: vslb %v24, %v24, %v26
1524 %res = call <16 x i8> @llvm.s390.vslb(<16 x i8> %a, <16 x i8> %b)
1529 define <16 x i8> @test_vsra(<16 x i8> %a, <16 x i8> %b) {
1530 ; CHECK-LABEL: test_vsra:
1531 ; CHECK: vsra %v24, %v24, %v26
1533 %res = call <16 x i8> @llvm.s390.vsra(<16 x i8> %a, <16 x i8> %b)
1538 define <16 x i8> @test_vsrab(<16 x i8> %a, <16 x i8> %b) {
1539 ; CHECK-LABEL: test_vsrab:
1540 ; CHECK: vsrab %v24, %v24, %v26
1542 %res = call <16 x i8> @llvm.s390.vsrab(<16 x i8> %a, <16 x i8> %b)
1547 define <16 x i8> @test_vsrl(<16 x i8> %a, <16 x i8> %b) {
1548 ; CHECK-LABEL: test_vsrl:
1549 ; CHECK: vsrl %v24, %v24, %v26
1551 %res = call <16 x i8> @llvm.s390.vsrl(<16 x i8> %a, <16 x i8> %b)
1556 define <16 x i8> @test_vsrlb(<16 x i8> %a, <16 x i8> %b) {
1557 ; CHECK-LABEL: test_vsrlb:
1558 ; CHECK: vsrlb %v24, %v24, %v26
1560 %res = call <16 x i8> @llvm.s390.vsrlb(<16 x i8> %a, <16 x i8> %b)
1564 ; VSLDB with the minimum useful value.
1565 define <16 x i8> @test_vsldb_1(<16 x i8> %a, <16 x i8> %b) {
1566 ; CHECK-LABEL: test_vsldb_1:
1567 ; CHECK: vsldb %v24, %v24, %v26, 1
1569 %res = call <16 x i8> @llvm.s390.vsldb(<16 x i8> %a, <16 x i8> %b, i32 1)
1573 ; VSLDB with the maximum value.
1574 define <16 x i8> @test_vsldb_15(<16 x i8> %a, <16 x i8> %b) {
1575 ; CHECK-LABEL: test_vsldb_15:
1576 ; CHECK: vsldb %v24, %v24, %v26, 15
1578 %res = call <16 x i8> @llvm.s390.vsldb(<16 x i8> %a, <16 x i8> %b, i32 15)
1583 define <16 x i8> @test_vscbib(<16 x i8> %a, <16 x i8> %b) {
1584 ; CHECK-LABEL: test_vscbib:
1585 ; CHECK: vscbib %v24, %v24, %v26
1587 %res = call <16 x i8> @llvm.s390.vscbib(<16 x i8> %a, <16 x i8> %b)
1592 define <8 x i16> @test_vscbih(<8 x i16> %a, <8 x i16> %b) {
1593 ; CHECK-LABEL: test_vscbih:
1594 ; CHECK: vscbih %v24, %v24, %v26
1596 %res = call <8 x i16> @llvm.s390.vscbih(<8 x i16> %a, <8 x i16> %b)
1601 define <4 x i32> @test_vscbif(<4 x i32> %a, <4 x i32> %b) {
1602 ; CHECK-LABEL: test_vscbif:
1603 ; CHECK: vscbif %v24, %v24, %v26
1605 %res = call <4 x i32> @llvm.s390.vscbif(<4 x i32> %a, <4 x i32> %b)
1610 define <2 x i64> @test_vscbig(<2 x i64> %a, <2 x i64> %b) {
1611 ; CHECK-LABEL: test_vscbig:
1612 ; CHECK: vscbig %v24, %v24, %v26
1614 %res = call <2 x i64> @llvm.s390.vscbig(<2 x i64> %a, <2 x i64> %b)
1619 define <16 x i8> @test_vsq(<16 x i8> %a, <16 x i8> %b) {
1620 ; CHECK-LABEL: test_vsq:
1621 ; CHECK: vsq %v24, %v24, %v26
1623 %res = call <16 x i8> @llvm.s390.vsq(<16 x i8> %a, <16 x i8> %b)
1628 define <16 x i8> @test_vsbiq(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {
1629 ; CHECK-LABEL: test_vsbiq:
1630 ; CHECK: vsbiq %v24, %v24, %v26, %v28
1632 %res = call <16 x i8> @llvm.s390.vsbiq(<16 x i8> %a, <16 x i8> %b,
1638 define <16 x i8> @test_vscbiq(<16 x i8> %a, <16 x i8> %b) {
1639 ; CHECK-LABEL: test_vscbiq:
1640 ; CHECK: vscbiq %v24, %v24, %v26
1642 %res = call <16 x i8> @llvm.s390.vscbiq(<16 x i8> %a, <16 x i8> %b)
1647 define <16 x i8> @test_vsbcbiq(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {
1648 ; CHECK-LABEL: test_vsbcbiq:
1649 ; CHECK: vsbcbiq %v24, %v24, %v26, %v28
1651 %res = call <16 x i8> @llvm.s390.vsbcbiq(<16 x i8> %a, <16 x i8> %b,
1657 define <4 x i32> @test_vsumb(<16 x i8> %a, <16 x i8> %b) {
1658 ; CHECK-LABEL: test_vsumb:
1659 ; CHECK: vsumb %v24, %v24, %v26
1661 %res = call <4 x i32> @llvm.s390.vsumb(<16 x i8> %a, <16 x i8> %b)
1666 define <4 x i32> @test_vsumh(<8 x i16> %a, <8 x i16> %b) {
1667 ; CHECK-LABEL: test_vsumh:
1668 ; CHECK: vsumh %v24, %v24, %v26
1670 %res = call <4 x i32> @llvm.s390.vsumh(<8 x i16> %a, <8 x i16> %b)
1675 define <2 x i64> @test_vsumgh(<8 x i16> %a, <8 x i16> %b) {
1676 ; CHECK-LABEL: test_vsumgh:
1677 ; CHECK: vsumgh %v24, %v24, %v26
1679 %res = call <2 x i64> @llvm.s390.vsumgh(<8 x i16> %a, <8 x i16> %b)
1684 define <2 x i64> @test_vsumgf(<4 x i32> %a, <4 x i32> %b) {
1685 ; CHECK-LABEL: test_vsumgf:
1686 ; CHECK: vsumgf %v24, %v24, %v26
1688 %res = call <2 x i64> @llvm.s390.vsumgf(<4 x i32> %a, <4 x i32> %b)
1693 define <16 x i8> @test_vsumqf(<4 x i32> %a, <4 x i32> %b) {
1694 ; CHECK-LABEL: test_vsumqf:
1695 ; CHECK: vsumqf %v24, %v24, %v26
1697 %res = call <16 x i8> @llvm.s390.vsumqf(<4 x i32> %a, <4 x i32> %b)
1702 define <16 x i8> @test_vsumqg(<2 x i64> %a, <2 x i64> %b) {
1703 ; CHECK-LABEL: test_vsumqg:
1704 ; CHECK: vsumqg %v24, %v24, %v26
1706 %res = call <16 x i8> @llvm.s390.vsumqg(<2 x i64> %a, <2 x i64> %b)
1710 ; VTM with no processing of the result.
1711 define i32 @test_vtm(<16 x i8> %a, <16 x i8> %b) {
1712 ; CHECK-LABEL: test_vtm:
1713 ; CHECK: vtm %v24, %v26
1715 ; CHECK: srl %r2, 28
1717 %res = call i32 @llvm.s390.vtm(<16 x i8> %a, <16 x i8> %b)
1721 ; VTM, storing to %ptr if all bits are set.
1722 define void @test_vtm_all_store(<16 x i8> %a, <16 x i8> %b, ptr %ptr) {
1723 ; CHECK-LABEL: test_vtm_all_store:
1725 ; CHECK: vtm %v24, %v26
1726 ; CHECK-NEXT: {{bnor|bler}} %r14
1727 ; CHECK: mvhi 0(%r2), 0
1729 %res = call i32 @llvm.s390.vtm(<16 x i8> %a, <16 x i8> %b)
1730 %cmp = icmp sge i32 %res, 3
1731 br i1 %cmp, label %store, label %exit
1734 store i32 0, ptr %ptr
1741 ; VCEQBS with no processing of the result.
1742 define i32 @test_vceqbs(<16 x i8> %a, <16 x i8> %b) {
1743 ; CHECK-LABEL: test_vceqbs:
1744 ; CHECK: vceqbs {{%v[0-9]+}}, %v24, %v26
1746 ; CHECK: srl %r2, 28
1748 %call = call {<16 x i8>, i32} @llvm.s390.vceqbs(<16 x i8> %a, <16 x i8> %b)
1749 %res = extractvalue {<16 x i8>, i32} %call, 1
1753 ; VCEQBS, returning 1 if any elements are equal (CC != 3).
1754 define i32 @test_vceqbs_any_bool(<16 x i8> %a, <16 x i8> %b) {
1755 ; CHECK-LABEL: test_vceqbs_any_bool:
1756 ; CHECK: vceqbs {{%v[0-9]+}}, %v24, %v26
1758 ; CHECK: lochile %r2, 1
1760 %call = call {<16 x i8>, i32} @llvm.s390.vceqbs(<16 x i8> %a, <16 x i8> %b)
1761 %res = extractvalue {<16 x i8>, i32} %call, 1
1762 %cmp = icmp ne i32 %res, 3
1763 %ext = zext i1 %cmp to i32
1767 ; VCEQBS, storing to %ptr if any elements are equal.
1768 define <16 x i8> @test_vceqbs_any_store(<16 x i8> %a, <16 x i8> %b, ptr %ptr) {
1769 ; CHECK-LABEL: test_vceqbs_any_store:
1771 ; CHECK: vceqbs %v24, %v24, %v26
1772 ; CHECK-NEXT: {{bor|bnler}} %r14
1773 ; CHECK: mvhi 0(%r2), 0
1775 %call = call {<16 x i8>, i32} @llvm.s390.vceqbs(<16 x i8> %a, <16 x i8> %b)
1776 %res = extractvalue {<16 x i8>, i32} %call, 0
1777 %cc = extractvalue {<16 x i8>, i32} %call, 1
1778 %cmp = icmp ule i32 %cc, 2
1779 br i1 %cmp, label %store, label %exit
1782 store i32 0, ptr %ptr
1789 ; VCEQHS with no processing of the result.
1790 define i32 @test_vceqhs(<8 x i16> %a, <8 x i16> %b) {
1791 ; CHECK-LABEL: test_vceqhs:
1792 ; CHECK: vceqhs {{%v[0-9]+}}, %v24, %v26
1794 ; CHECK: srl %r2, 28
1796 %call = call {<8 x i16>, i32} @llvm.s390.vceqhs(<8 x i16> %a, <8 x i16> %b)
1797 %res = extractvalue {<8 x i16>, i32} %call, 1
1801 ; VCEQHS, returning 1 if not all elements are equal.
1802 define i32 @test_vceqhs_notall_bool(<8 x i16> %a, <8 x i16> %b) {
1803 ; CHECK-LABEL: test_vceqhs_notall_bool:
1804 ; CHECK: vceqhs {{%v[0-9]+}}, %v24, %v26
1806 ; CHECK: lochinhe %r2, 1
1808 %call = call {<8 x i16>, i32} @llvm.s390.vceqhs(<8 x i16> %a, <8 x i16> %b)
1809 %res = extractvalue {<8 x i16>, i32} %call, 1
1810 %cmp = icmp sge i32 %res, 1
1811 %ext = zext i1 %cmp to i32
1815 ; VCEQHS, storing to %ptr if not all elements are equal.
1816 define <8 x i16> @test_vceqhs_notall_store(<8 x i16> %a, <8 x i16> %b,
1818 ; CHECK-LABEL: test_vceqhs_notall_store:
1820 ; CHECK: vceqhs %v24, %v24, %v26
1821 ; CHECK-NEXT: {{bher|ber}} %r14
1822 ; CHECK: mvhi 0(%r2), 0
1824 %call = call {<8 x i16>, i32} @llvm.s390.vceqhs(<8 x i16> %a, <8 x i16> %b)
1825 %res = extractvalue {<8 x i16>, i32} %call, 0
1826 %cc = extractvalue {<8 x i16>, i32} %call, 1
1827 %cmp = icmp ugt i32 %cc, 0
1828 br i1 %cmp, label %store, label %exit
1831 store i32 0, ptr %ptr
1838 ; VCEQFS with no processing of the result.
1839 define i32 @test_vceqfs(<4 x i32> %a, <4 x i32> %b) {
1840 ; CHECK-LABEL: test_vceqfs:
1841 ; CHECK: vceqfs {{%v[0-9]+}}, %v24, %v26
1843 ; CHECK: srl %r2, 28
1845 %call = call {<4 x i32>, i32} @llvm.s390.vceqfs(<4 x i32> %a, <4 x i32> %b)
1846 %res = extractvalue {<4 x i32>, i32} %call, 1
1850 ; VCEQFS, returning 1 if no elements are equal.
1851 define i32 @test_vceqfs_none_bool(<4 x i32> %a, <4 x i32> %b) {
1852 ; CHECK-LABEL: test_vceqfs_none_bool:
1853 ; CHECK: vceqfs {{%v[0-9]+}}, %v24, %v26
1855 ; CHECK: lochio %r2, 1
1857 %call = call {<4 x i32>, i32} @llvm.s390.vceqfs(<4 x i32> %a, <4 x i32> %b)
1858 %res = extractvalue {<4 x i32>, i32} %call, 1
1859 %cmp = icmp eq i32 %res, 3
1860 %ext = zext i1 %cmp to i32
1864 ; VCEQFS, storing to %ptr if no elements are equal.
1865 define <4 x i32> @test_vceqfs_none_store(<4 x i32> %a, <4 x i32> %b,
1867 ; CHECK-LABEL: test_vceqfs_none_store:
1869 ; CHECK: vceqfs %v24, %v24, %v26
1870 ; CHECK-NEXT: {{bnor|bler}} %r14
1871 ; CHECK: mvhi 0(%r2), 0
1873 %call = call {<4 x i32>, i32} @llvm.s390.vceqfs(<4 x i32> %a, <4 x i32> %b)
1874 %res = extractvalue {<4 x i32>, i32} %call, 0
1875 %cc = extractvalue {<4 x i32>, i32} %call, 1
1876 %cmp = icmp uge i32 %cc, 3
1877 br i1 %cmp, label %store, label %exit
1880 store i32 0, ptr %ptr
1887 ; VCEQGS with no processing of the result.
1888 define i32 @test_vceqgs(<2 x i64> %a, <2 x i64> %b) {
1889 ; CHECK-LABEL: test_vceqgs:
1890 ; CHECK: vceqgs {{%v[0-9]+}}, %v24, %v26
1892 ; CHECK: srl %r2, 28
1894 %call = call {<2 x i64>, i32} @llvm.s390.vceqgs(<2 x i64> %a, <2 x i64> %b)
1895 %res = extractvalue {<2 x i64>, i32} %call, 1
1899 ; VCEQGS returning 1 if all elements are equal (CC == 0).
1900 define i32 @test_vceqgs_all_bool(<2 x i64> %a, <2 x i64> %b) {
1901 ; CHECK-LABEL: test_vceqgs_all_bool:
1902 ; CHECK: vceqgs {{%v[0-9]+}}, %v24, %v26
1904 ; CHECK: lochie %r2, 1
1906 %call = call {<2 x i64>, i32} @llvm.s390.vceqgs(<2 x i64> %a, <2 x i64> %b)
1907 %res = extractvalue {<2 x i64>, i32} %call, 1
1908 %cmp = icmp ult i32 %res, 1
1909 %ext = zext i1 %cmp to i32
1913 ; VCEQGS, storing to %ptr if all elements are equal.
1914 define <2 x i64> @test_vceqgs_all_store(<2 x i64> %a, <2 x i64> %b, ptr %ptr) {
1915 ; CHECK-LABEL: test_vceqgs_all_store:
1917 ; CHECK: vceqgs %v24, %v24, %v26
1918 ; CHECK-NEXT: {{bnher|bner}} %r14
1919 ; CHECK: mvhi 0(%r2), 0
1921 %call = call {<2 x i64>, i32} @llvm.s390.vceqgs(<2 x i64> %a, <2 x i64> %b)
1922 %res = extractvalue {<2 x i64>, i32} %call, 0
1923 %cc = extractvalue {<2 x i64>, i32} %call, 1
1924 %cmp = icmp sle i32 %cc, 0
1925 br i1 %cmp, label %store, label %exit
1928 store i32 0, ptr %ptr
1935 ; VCHBS with no processing of the result.
1936 define i32 @test_vchbs(<16 x i8> %a, <16 x i8> %b) {
1937 ; CHECK-LABEL: test_vchbs:
1938 ; CHECK: vchbs {{%v[0-9]+}}, %v24, %v26
1940 ; CHECK: srl %r2, 28
1942 %call = call {<16 x i8>, i32} @llvm.s390.vchbs(<16 x i8> %a, <16 x i8> %b)
1943 %res = extractvalue {<16 x i8>, i32} %call, 1
1947 ; VCHBS, returning 1 if any elements are higher (CC != 3).
1948 define i32 @test_vchbs_any_bool(<16 x i8> %a, <16 x i8> %b) {
1949 ; CHECK-LABEL: test_vchbs_any_bool:
1950 ; CHECK: vchbs {{%v[0-9]+}}, %v24, %v26
1952 ; CHECK: lochile %r2, 1
1954 %call = call {<16 x i8>, i32} @llvm.s390.vchbs(<16 x i8> %a, <16 x i8> %b)
1955 %res = extractvalue {<16 x i8>, i32} %call, 1
1956 %cmp = icmp ne i32 %res, 3
1957 %ext = zext i1 %cmp to i32
1961 ; VCHBS, storing to %ptr if any elements are higher.
1962 define <16 x i8> @test_vchbs_any_store(<16 x i8> %a, <16 x i8> %b, ptr %ptr) {
1963 ; CHECK-LABEL: test_vchbs_any_store:
1965 ; CHECK: vchbs %v24, %v24, %v26
1966 ; CHECK-NEXT: {{bor|bnler}} %r14
1967 ; CHECK: mvhi 0(%r2), 0
1969 %call = call {<16 x i8>, i32} @llvm.s390.vchbs(<16 x i8> %a, <16 x i8> %b)
1970 %res = extractvalue {<16 x i8>, i32} %call, 0
1971 %cc = extractvalue {<16 x i8>, i32} %call, 1
1972 %cmp = icmp ule i32 %cc, 2
1973 br i1 %cmp, label %store, label %exit
1976 store i32 0, ptr %ptr
1983 ; VCHHS with no processing of the result.
1984 define i32 @test_vchhs(<8 x i16> %a, <8 x i16> %b) {
1985 ; CHECK-LABEL: test_vchhs:
1986 ; CHECK: vchhs {{%v[0-9]+}}, %v24, %v26
1988 ; CHECK: srl %r2, 28
1990 %call = call {<8 x i16>, i32} @llvm.s390.vchhs(<8 x i16> %a, <8 x i16> %b)
1991 %res = extractvalue {<8 x i16>, i32} %call, 1
1995 ; VCHHS, returning 1 if not all elements are higher.
1996 define i32 @test_vchhs_notall_bool(<8 x i16> %a, <8 x i16> %b) {
1997 ; CHECK-LABEL: test_vchhs_notall_bool:
1998 ; CHECK: vchhs {{%v[0-9]+}}, %v24, %v26
2000 ; CHECK: lochinhe %r2, 1
2002 %call = call {<8 x i16>, i32} @llvm.s390.vchhs(<8 x i16> %a, <8 x i16> %b)
2003 %res = extractvalue {<8 x i16>, i32} %call, 1
2004 %cmp = icmp sge i32 %res, 1
2005 %ext = zext i1 %cmp to i32
2009 ; VCHHS, storing to %ptr if not all elements are higher.
2010 define <8 x i16> @test_vchhs_notall_store(<8 x i16> %a, <8 x i16> %b,
2012 ; CHECK-LABEL: test_vchhs_notall_store:
2014 ; CHECK: vchhs %v24, %v24, %v26
2015 ; CHECK-NEXT: {{bher|ber}} %r14
2016 ; CHECK: mvhi 0(%r2), 0
2018 %call = call {<8 x i16>, i32} @llvm.s390.vchhs(<8 x i16> %a, <8 x i16> %b)
2019 %res = extractvalue {<8 x i16>, i32} %call, 0
2020 %cc = extractvalue {<8 x i16>, i32} %call, 1
2021 %cmp = icmp ugt i32 %cc, 0
2022 br i1 %cmp, label %store, label %exit
2025 store i32 0, ptr %ptr
2032 ; VCHFS with no processing of the result.
2033 define i32 @test_vchfs(<4 x i32> %a, <4 x i32> %b) {
2034 ; CHECK-LABEL: test_vchfs:
2035 ; CHECK: vchfs {{%v[0-9]+}}, %v24, %v26
2037 ; CHECK: srl %r2, 28
2039 %call = call {<4 x i32>, i32} @llvm.s390.vchfs(<4 x i32> %a, <4 x i32> %b)
2040 %res = extractvalue {<4 x i32>, i32} %call, 1
2044 ; VCHFS, returning 1 if no elements are higher.
2045 define i32 @test_vchfs_none_bool(<4 x i32> %a, <4 x i32> %b) {
2046 ; CHECK-LABEL: test_vchfs_none_bool:
2047 ; CHECK: vchfs {{%v[0-9]+}}, %v24, %v26
2049 ; CHECK: lochio %r2, 1
2051 %call = call {<4 x i32>, i32} @llvm.s390.vchfs(<4 x i32> %a, <4 x i32> %b)
2052 %res = extractvalue {<4 x i32>, i32} %call, 1
2053 %cmp = icmp eq i32 %res, 3
2054 %ext = zext i1 %cmp to i32
2058 ; VCHFS, storing to %ptr if no elements are higher.
2059 define <4 x i32> @test_vchfs_none_store(<4 x i32> %a, <4 x i32> %b, ptr %ptr) {
2060 ; CHECK-LABEL: test_vchfs_none_store:
2062 ; CHECK: vchfs %v24, %v24, %v26
2063 ; CHECK-NEXT: {{bnor|bler}} %r14
2064 ; CHECK: mvhi 0(%r2), 0
2066 %call = call {<4 x i32>, i32} @llvm.s390.vchfs(<4 x i32> %a, <4 x i32> %b)
2067 %res = extractvalue {<4 x i32>, i32} %call, 0
2068 %cc = extractvalue {<4 x i32>, i32} %call, 1
2069 %cmp = icmp uge i32 %cc, 3
2070 br i1 %cmp, label %store, label %exit
2073 store i32 0, ptr %ptr
2080 ; VCHGS with no processing of the result.
2081 define i32 @test_vchgs(<2 x i64> %a, <2 x i64> %b) {
2082 ; CHECK-LABEL: test_vchgs:
2083 ; CHECK: vchgs {{%v[0-9]+}}, %v24, %v26
2085 ; CHECK: srl %r2, 28
2087 %call = call {<2 x i64>, i32} @llvm.s390.vchgs(<2 x i64> %a, <2 x i64> %b)
2088 %res = extractvalue {<2 x i64>, i32} %call, 1
2092 ; VCHGS returning 1 if all elements are higher (CC == 0).
2093 define i32 @test_vchgs_all_bool(<2 x i64> %a, <2 x i64> %b) {
2094 ; CHECK-LABEL: test_vchgs_all_bool:
2095 ; CHECK: vchgs {{%v[0-9]+}}, %v24, %v26
2097 ; CHECK: lochie %r2, 1
2099 %call = call {<2 x i64>, i32} @llvm.s390.vchgs(<2 x i64> %a, <2 x i64> %b)
2100 %res = extractvalue {<2 x i64>, i32} %call, 1
2101 %cmp = icmp ult i32 %res, 1
2102 %ext = zext i1 %cmp to i32
2106 ; VCHGS, storing to %ptr if all elements are higher.
2107 define <2 x i64> @test_vchgs_all_store(<2 x i64> %a, <2 x i64> %b, ptr %ptr) {
2108 ; CHECK-LABEL: test_vchgs_all_store:
2110 ; CHECK: vchgs %v24, %v24, %v26
2111 ; CHECK-NEXT: {{bnher|bner}} %r14
2112 ; CHECK: mvhi 0(%r2), 0
2114 %call = call {<2 x i64>, i32} @llvm.s390.vchgs(<2 x i64> %a, <2 x i64> %b)
2115 %res = extractvalue {<2 x i64>, i32} %call, 0
2116 %cc = extractvalue {<2 x i64>, i32} %call, 1
2117 %cmp = icmp sle i32 %cc, 0
2118 br i1 %cmp, label %store, label %exit
2121 store i32 0, ptr %ptr
2128 ; VCHLBS with no processing of the result.
2129 define i32 @test_vchlbs(<16 x i8> %a, <16 x i8> %b) {
2130 ; CHECK-LABEL: test_vchlbs:
2131 ; CHECK: vchlbs {{%v[0-9]+}}, %v24, %v26
2133 ; CHECK: srl %r2, 28
2135 %call = call {<16 x i8>, i32} @llvm.s390.vchlbs(<16 x i8> %a, <16 x i8> %b)
2136 %res = extractvalue {<16 x i8>, i32} %call, 1
2140 ; VCHLBS, returning 1 if any elements are higher (CC != 3).
2141 define i32 @test_vchlbs_any_bool(<16 x i8> %a, <16 x i8> %b) {
2142 ; CHECK-LABEL: test_vchlbs_any_bool:
2143 ; CHECK: vchlbs {{%v[0-9]+}}, %v24, %v26
2145 ; CHECK: lochile %r2, 1
2147 %call = call {<16 x i8>, i32} @llvm.s390.vchlbs(<16 x i8> %a, <16 x i8> %b)
2148 %res = extractvalue {<16 x i8>, i32} %call, 1
2149 %cmp = icmp ne i32 %res, 3
2150 %ext = zext i1 %cmp to i32
2154 ; VCHLBS, storing to %ptr if any elements are higher.
2155 define <16 x i8> @test_vchlbs_any_store(<16 x i8> %a, <16 x i8> %b, ptr %ptr) {
2156 ; CHECK-LABEL: test_vchlbs_any_store:
2158 ; CHECK: vchlbs %v24, %v24, %v26
2159 ; CHECK-NEXT: {{bor|bnler}} %r14
2160 ; CHECK: mvhi 0(%r2), 0
2162 %call = call {<16 x i8>, i32} @llvm.s390.vchlbs(<16 x i8> %a, <16 x i8> %b)
2163 %res = extractvalue {<16 x i8>, i32} %call, 0
2164 %cc = extractvalue {<16 x i8>, i32} %call, 1
2165 %cmp = icmp sle i32 %cc, 2
2166 br i1 %cmp, label %store, label %exit
2169 store i32 0, ptr %ptr
2176 ; VCHLHS with no processing of the result.
2177 define i32 @test_vchlhs(<8 x i16> %a, <8 x i16> %b) {
2178 ; CHECK-LABEL: test_vchlhs:
2179 ; CHECK: vchlhs {{%v[0-9]+}}, %v24, %v26
2181 ; CHECK: srl %r2, 28
2183 %call = call {<8 x i16>, i32} @llvm.s390.vchlhs(<8 x i16> %a, <8 x i16> %b)
2184 %res = extractvalue {<8 x i16>, i32} %call, 1
2188 ; VCHLHS, returning 1 if not all elements are higher.
2189 define i32 @test_vchlhs_notall_bool(<8 x i16> %a, <8 x i16> %b) {
2190 ; CHECK-LABEL: test_vchlhs_notall_bool:
2191 ; CHECK: vchlhs {{%v[0-9]+}}, %v24, %v26
2193 ; CHECK: lochinhe %r2, 1
2195 %call = call {<8 x i16>, i32} @llvm.s390.vchlhs(<8 x i16> %a, <8 x i16> %b)
2196 %res = extractvalue {<8 x i16>, i32} %call, 1
2197 %cmp = icmp uge i32 %res, 1
2198 %ext = zext i1 %cmp to i32
2202 ; VCHLHS, storing to %ptr if not all elements are higher.
2203 define <8 x i16> @test_vchlhs_notall_store(<8 x i16> %a, <8 x i16> %b,
2205 ; CHECK-LABEL: test_vchlhs_notall_store:
2207 ; CHECK: vchlhs %v24, %v24, %v26
2208 ; CHECK-NEXT: {{bher|ber}} %r14
2209 ; CHECK: mvhi 0(%r2), 0
2211 %call = call {<8 x i16>, i32} @llvm.s390.vchlhs(<8 x i16> %a, <8 x i16> %b)
2212 %res = extractvalue {<8 x i16>, i32} %call, 0
2213 %cc = extractvalue {<8 x i16>, i32} %call, 1
2214 %cmp = icmp sgt i32 %cc, 0
2215 br i1 %cmp, label %store, label %exit
2218 store i32 0, ptr %ptr
2225 ; VCHLFS with no processing of the result.
2226 define i32 @test_vchlfs(<4 x i32> %a, <4 x i32> %b) {
2227 ; CHECK-LABEL: test_vchlfs:
2228 ; CHECK: vchlfs {{%v[0-9]+}}, %v24, %v26
2230 ; CHECK: srl %r2, 28
2232 %call = call {<4 x i32>, i32} @llvm.s390.vchlfs(<4 x i32> %a, <4 x i32> %b)
2233 %res = extractvalue {<4 x i32>, i32} %call, 1
2237 ; VCHLFS, returning 1 if no elements are higher.
2238 define i32 @test_vchlfs_none_bool(<4 x i32> %a, <4 x i32> %b) {
2239 ; CHECK-LABEL: test_vchlfs_none_bool:
2240 ; CHECK: vchlfs {{%v[0-9]+}}, %v24, %v26
2242 ; CHECK: lochio %r2, 1
2244 %call = call {<4 x i32>, i32} @llvm.s390.vchlfs(<4 x i32> %a, <4 x i32> %b)
2245 %res = extractvalue {<4 x i32>, i32} %call, 1
2246 %cmp = icmp eq i32 %res, 3
2247 %ext = zext i1 %cmp to i32
2251 ; VCHLFS, storing to %ptr if no elements are higher.
2252 define <4 x i32> @test_vchlfs_none_store(<4 x i32> %a, <4 x i32> %b,
2254 ; CHECK-LABEL: test_vchlfs_none_store:
2256 ; CHECK: vchlfs %v24, %v24, %v26
2257 ; CHECK-NEXT: {{bnor|bler}} %r14
2258 ; CHECK: mvhi 0(%r2), 0
2260 %call = call {<4 x i32>, i32} @llvm.s390.vchlfs(<4 x i32> %a, <4 x i32> %b)
2261 %res = extractvalue {<4 x i32>, i32} %call, 0
2262 %cc = extractvalue {<4 x i32>, i32} %call, 1
2263 %cmp = icmp sge i32 %cc, 3
2264 br i1 %cmp, label %store, label %exit
2267 store i32 0, ptr %ptr
2274 ; VCHLGS with no processing of the result.
2275 define i32 @test_vchlgs(<2 x i64> %a, <2 x i64> %b) {
2276 ; CHECK-LABEL: test_vchlgs:
2277 ; CHECK: vchlgs {{%v[0-9]+}}, %v24, %v26
2279 ; CHECK: srl %r2, 28
2281 %call = call {<2 x i64>, i32} @llvm.s390.vchlgs(<2 x i64> %a, <2 x i64> %b)
2282 %res = extractvalue {<2 x i64>, i32} %call, 1
2286 ; VCHLGS returning 1 if all elements are higher (CC == 0).
2287 define i32 @test_vchlgs_all_bool(<2 x i64> %a, <2 x i64> %b) {
2288 ; CHECK-LABEL: test_vchlgs_all_bool:
2289 ; CHECK: vchlgs {{%v[0-9]+}}, %v24, %v26
2291 ; CHECK: lochie %r2, 1
2293 %call = call {<2 x i64>, i32} @llvm.s390.vchlgs(<2 x i64> %a, <2 x i64> %b)
2294 %res = extractvalue {<2 x i64>, i32} %call, 1
2295 %cmp = icmp slt i32 %res, 1
2296 %ext = zext i1 %cmp to i32
2300 ; VCHLGS, storing to %ptr if all elements are higher.
2301 define <2 x i64> @test_vchlgs_all_store(<2 x i64> %a, <2 x i64> %b, ptr %ptr) {
2302 ; CHECK-LABEL: test_vchlgs_all_store:
2304 ; CHECK: vchlgs %v24, %v24, %v26
2305 ; CHECK-NEXT: {{bnher|bner}} %r14
2306 ; CHECK: mvhi 0(%r2), 0
2308 %call = call {<2 x i64>, i32} @llvm.s390.vchlgs(<2 x i64> %a, <2 x i64> %b)
2309 %res = extractvalue {<2 x i64>, i32} %call, 0
2310 %cc = extractvalue {<2 x i64>, i32} %call, 1
2311 %cmp = icmp ule i32 %cc, 0
2312 br i1 %cmp, label %store, label %exit
2315 store i32 0, ptr %ptr
2322 ; VFAEB with !IN !RT.
2323 define <16 x i8> @test_vfaeb_0(<16 x i8> %a, <16 x i8> %b) {
2324 ; CHECK-LABEL: test_vfaeb_0:
2325 ; CHECK: vfaeb %v24, %v24, %v26, 0
2327 %res = call <16 x i8> @llvm.s390.vfaeb(<16 x i8> %a, <16 x i8> %b, i32 0)
2331 ; VFAEB with !IN RT.
2332 define <16 x i8> @test_vfaeb_4(<16 x i8> %a, <16 x i8> %b) {
2333 ; CHECK-LABEL: test_vfaeb_4:
2334 ; CHECK: vfaeb %v24, %v24, %v26, 4
2336 %res = call <16 x i8> @llvm.s390.vfaeb(<16 x i8> %a, <16 x i8> %b, i32 4)
2340 ; VFAEB with IN !RT.
2341 define <16 x i8> @test_vfaeb_8(<16 x i8> %a, <16 x i8> %b) {
2342 ; CHECK-LABEL: test_vfaeb_8:
2343 ; CHECK: vfaeb %v24, %v24, %v26, 8
2345 %res = call <16 x i8> @llvm.s390.vfaeb(<16 x i8> %a, <16 x i8> %b, i32 8)
2350 define <16 x i8> @test_vfaeb_12(<16 x i8> %a, <16 x i8> %b) {
2351 ; CHECK-LABEL: test_vfaeb_12:
2352 ; CHECK: vfaeb %v24, %v24, %v26, 12
2354 %res = call <16 x i8> @llvm.s390.vfaeb(<16 x i8> %a, <16 x i8> %b, i32 12)
2358 ; VFAEB with CS -- should be ignored.
2359 define <16 x i8> @test_vfaeb_1(<16 x i8> %a, <16 x i8> %b) {
2360 ; CHECK-LABEL: test_vfaeb_1:
2361 ; CHECK: vfaeb %v24, %v24, %v26, 0
2363 %res = call <16 x i8> @llvm.s390.vfaeb(<16 x i8> %a, <16 x i8> %b, i32 1)
2368 define <8 x i16> @test_vfaeh(<8 x i16> %a, <8 x i16> %b) {
2369 ; CHECK-LABEL: test_vfaeh:
2370 ; CHECK: vfaeh %v24, %v24, %v26, 4
2372 %res = call <8 x i16> @llvm.s390.vfaeh(<8 x i16> %a, <8 x i16> %b, i32 4)
2377 define <4 x i32> @test_vfaef(<4 x i32> %a, <4 x i32> %b) {
2378 ; CHECK-LABEL: test_vfaef:
2379 ; CHECK: vfaef %v24, %v24, %v26, 8
2381 %res = call <4 x i32> @llvm.s390.vfaef(<4 x i32> %a, <4 x i32> %b, i32 8)
2386 define <16 x i8> @test_vfaebs(<16 x i8> %a, <16 x i8> %b, ptr %ccptr) {
2387 ; CHECK-LABEL: test_vfaebs:
2388 ; CHECK: vfaebs %v24, %v24, %v26, 0
2389 ; CHECK: ipm [[REG:%r[0-5]]]
2390 ; CHECK: srl [[REG]], 28
2391 ; CHECK: st [[REG]], 0(%r2)
2393 %call = call {<16 x i8>, i32} @llvm.s390.vfaebs(<16 x i8> %a, <16 x i8> %b,
2395 %res = extractvalue {<16 x i8>, i32} %call, 0
2396 %cc = extractvalue {<16 x i8>, i32} %call, 1
2397 store i32 %cc, ptr %ccptr
2402 define <8 x i16> @test_vfaehs(<8 x i16> %a, <8 x i16> %b, ptr %ccptr) {
2403 ; CHECK-LABEL: test_vfaehs:
2404 ; CHECK: vfaehs %v24, %v24, %v26, 4
2405 ; CHECK: ipm [[REG:%r[0-5]]]
2406 ; CHECK: srl [[REG]], 28
2407 ; CHECK: st [[REG]], 0(%r2)
2409 %call = call {<8 x i16>, i32} @llvm.s390.vfaehs(<8 x i16> %a, <8 x i16> %b,
2411 %res = extractvalue {<8 x i16>, i32} %call, 0
2412 %cc = extractvalue {<8 x i16>, i32} %call, 1
2413 store i32 %cc, ptr %ccptr
2418 define <4 x i32> @test_vfaefs(<4 x i32> %a, <4 x i32> %b, ptr %ccptr) {
2419 ; CHECK-LABEL: test_vfaefs:
2420 ; CHECK: vfaefs %v24, %v24, %v26, 8
2421 ; CHECK: ipm [[REG:%r[0-5]]]
2422 ; CHECK: srl [[REG]], 28
2423 ; CHECK: st [[REG]], 0(%r2)
2425 %call = call {<4 x i32>, i32} @llvm.s390.vfaefs(<4 x i32> %a, <4 x i32> %b,
2427 %res = extractvalue {<4 x i32>, i32} %call, 0
2428 %cc = extractvalue {<4 x i32>, i32} %call, 1
2429 store i32 %cc, ptr %ccptr
2433 ; VFAEZB with !IN !RT.
2434 define <16 x i8> @test_vfaezb_0(<16 x i8> %a, <16 x i8> %b) {
2435 ; CHECK-LABEL: test_vfaezb_0:
2436 ; CHECK: vfaezb %v24, %v24, %v26, 0
2438 %res = call <16 x i8> @llvm.s390.vfaezb(<16 x i8> %a, <16 x i8> %b, i32 0)
2442 ; VFAEZB with !IN RT.
2443 define <16 x i8> @test_vfaezb_4(<16 x i8> %a, <16 x i8> %b) {
2444 ; CHECK-LABEL: test_vfaezb_4:
2445 ; CHECK: vfaezb %v24, %v24, %v26, 4
2447 %res = call <16 x i8> @llvm.s390.vfaezb(<16 x i8> %a, <16 x i8> %b, i32 4)
2451 ; VFAEZB with IN !RT.
2452 define <16 x i8> @test_vfaezb_8(<16 x i8> %a, <16 x i8> %b) {
2453 ; CHECK-LABEL: test_vfaezb_8:
2454 ; CHECK: vfaezb %v24, %v24, %v26, 8
2456 %res = call <16 x i8> @llvm.s390.vfaezb(<16 x i8> %a, <16 x i8> %b, i32 8)
2460 ; VFAEZB with IN RT.
2461 define <16 x i8> @test_vfaezb_12(<16 x i8> %a, <16 x i8> %b) {
2462 ; CHECK-LABEL: test_vfaezb_12:
2463 ; CHECK: vfaezb %v24, %v24, %v26, 12
2465 %res = call <16 x i8> @llvm.s390.vfaezb(<16 x i8> %a, <16 x i8> %b, i32 12)
2469 ; VFAEZB with CS -- should be ignored.
2470 define <16 x i8> @test_vfaezb_1(<16 x i8> %a, <16 x i8> %b) {
2471 ; CHECK-LABEL: test_vfaezb_1:
2472 ; CHECK: vfaezb %v24, %v24, %v26, 0
2474 %res = call <16 x i8> @llvm.s390.vfaezb(<16 x i8> %a, <16 x i8> %b, i32 1)
2479 define <8 x i16> @test_vfaezh(<8 x i16> %a, <8 x i16> %b) {
2480 ; CHECK-LABEL: test_vfaezh:
2481 ; CHECK: vfaezh %v24, %v24, %v26, 4
2483 %res = call <8 x i16> @llvm.s390.vfaezh(<8 x i16> %a, <8 x i16> %b, i32 4)
2488 define <4 x i32> @test_vfaezf(<4 x i32> %a, <4 x i32> %b) {
2489 ; CHECK-LABEL: test_vfaezf:
2490 ; CHECK: vfaezf %v24, %v24, %v26, 8
2492 %res = call <4 x i32> @llvm.s390.vfaezf(<4 x i32> %a, <4 x i32> %b, i32 8)
2497 define <16 x i8> @test_vfaezbs(<16 x i8> %a, <16 x i8> %b, ptr %ccptr) {
2498 ; CHECK-LABEL: test_vfaezbs:
2499 ; CHECK: vfaezbs %v24, %v24, %v26, 0
2500 ; CHECK: ipm [[REG:%r[0-5]]]
2501 ; CHECK: srl [[REG]], 28
2502 ; CHECK: st [[REG]], 0(%r2)
2504 %call = call {<16 x i8>, i32} @llvm.s390.vfaezbs(<16 x i8> %a, <16 x i8> %b,
2506 %res = extractvalue {<16 x i8>, i32} %call, 0
2507 %cc = extractvalue {<16 x i8>, i32} %call, 1
2508 store i32 %cc, ptr %ccptr
2513 define <8 x i16> @test_vfaezhs(<8 x i16> %a, <8 x i16> %b, ptr %ccptr) {
2514 ; CHECK-LABEL: test_vfaezhs:
2515 ; CHECK: vfaezhs %v24, %v24, %v26, 4
2516 ; CHECK: ipm [[REG:%r[0-5]]]
2517 ; CHECK: srl [[REG]], 28
2518 ; CHECK: st [[REG]], 0(%r2)
2520 %call = call {<8 x i16>, i32} @llvm.s390.vfaezhs(<8 x i16> %a, <8 x i16> %b,
2522 %res = extractvalue {<8 x i16>, i32} %call, 0
2523 %cc = extractvalue {<8 x i16>, i32} %call, 1
2524 store i32 %cc, ptr %ccptr
2529 define <4 x i32> @test_vfaezfs(<4 x i32> %a, <4 x i32> %b, ptr %ccptr) {
2530 ; CHECK-LABEL: test_vfaezfs:
2531 ; CHECK: vfaezfs %v24, %v24, %v26, 8
2532 ; CHECK: ipm [[REG:%r[0-5]]]
2533 ; CHECK: srl [[REG]], 28
2534 ; CHECK: st [[REG]], 0(%r2)
2536 %call = call {<4 x i32>, i32} @llvm.s390.vfaezfs(<4 x i32> %a, <4 x i32> %b,
2538 %res = extractvalue {<4 x i32>, i32} %call, 0
2539 %cc = extractvalue {<4 x i32>, i32} %call, 1
2540 store i32 %cc, ptr %ccptr
2545 define <16 x i8> @test_vfeeb_0(<16 x i8> %a, <16 x i8> %b) {
2546 ; CHECK-LABEL: test_vfeeb_0:
2547 ; CHECK: vfeeb %v24, %v24, %v26
2549 %res = call <16 x i8> @llvm.s390.vfeeb(<16 x i8> %a, <16 x i8> %b)
2554 define <8 x i16> @test_vfeeh(<8 x i16> %a, <8 x i16> %b) {
2555 ; CHECK-LABEL: test_vfeeh:
2556 ; CHECK: vfeeh %v24, %v24, %v26
2558 %res = call <8 x i16> @llvm.s390.vfeeh(<8 x i16> %a, <8 x i16> %b)
2563 define <4 x i32> @test_vfeef(<4 x i32> %a, <4 x i32> %b) {
2564 ; CHECK-LABEL: test_vfeef:
2565 ; CHECK: vfeef %v24, %v24, %v26
2567 %res = call <4 x i32> @llvm.s390.vfeef(<4 x i32> %a, <4 x i32> %b)
2572 define <16 x i8> @test_vfeebs(<16 x i8> %a, <16 x i8> %b, ptr %ccptr) {
2573 ; CHECK-LABEL: test_vfeebs:
2574 ; CHECK: vfeebs %v24, %v24, %v26
2575 ; CHECK: ipm [[REG:%r[0-5]]]
2576 ; CHECK: srl [[REG]], 28
2577 ; CHECK: st [[REG]], 0(%r2)
2579 %call = call {<16 x i8>, i32} @llvm.s390.vfeebs(<16 x i8> %a, <16 x i8> %b)
2580 %res = extractvalue {<16 x i8>, i32} %call, 0
2581 %cc = extractvalue {<16 x i8>, i32} %call, 1
2582 store i32 %cc, ptr %ccptr
2587 define <8 x i16> @test_vfeehs(<8 x i16> %a, <8 x i16> %b, ptr %ccptr) {
2588 ; CHECK-LABEL: test_vfeehs:
2589 ; CHECK: vfeehs %v24, %v24, %v26
2590 ; CHECK: ipm [[REG:%r[0-5]]]
2591 ; CHECK: srl [[REG]], 28
2592 ; CHECK: st [[REG]], 0(%r2)
2594 %call = call {<8 x i16>, i32} @llvm.s390.vfeehs(<8 x i16> %a, <8 x i16> %b)
2595 %res = extractvalue {<8 x i16>, i32} %call, 0
2596 %cc = extractvalue {<8 x i16>, i32} %call, 1
2597 store i32 %cc, ptr %ccptr
2602 define <4 x i32> @test_vfeefs(<4 x i32> %a, <4 x i32> %b, ptr %ccptr) {
2603 ; CHECK-LABEL: test_vfeefs:
2604 ; CHECK: vfeefs %v24, %v24, %v26
2605 ; CHECK: ipm [[REG:%r[0-5]]]
2606 ; CHECK: srl [[REG]], 28
2607 ; CHECK: st [[REG]], 0(%r2)
2609 %call = call {<4 x i32>, i32} @llvm.s390.vfeefs(<4 x i32> %a, <4 x i32> %b)
2610 %res = extractvalue {<4 x i32>, i32} %call, 0
2611 %cc = extractvalue {<4 x i32>, i32} %call, 1
2612 store i32 %cc, ptr %ccptr
2617 define <16 x i8> @test_vfeezb(<16 x i8> %a, <16 x i8> %b) {
2618 ; CHECK-LABEL: test_vfeezb:
2619 ; CHECK: vfeezb %v24, %v24, %v26
2621 %res = call <16 x i8> @llvm.s390.vfeezb(<16 x i8> %a, <16 x i8> %b)
2626 define <8 x i16> @test_vfeezh(<8 x i16> %a, <8 x i16> %b) {
2627 ; CHECK-LABEL: test_vfeezh:
2628 ; CHECK: vfeezh %v24, %v24, %v26
2630 %res = call <8 x i16> @llvm.s390.vfeezh(<8 x i16> %a, <8 x i16> %b)
2635 define <4 x i32> @test_vfeezf(<4 x i32> %a, <4 x i32> %b) {
2636 ; CHECK-LABEL: test_vfeezf:
2637 ; CHECK: vfeezf %v24, %v24, %v26
2639 %res = call <4 x i32> @llvm.s390.vfeezf(<4 x i32> %a, <4 x i32> %b)
2644 define <16 x i8> @test_vfeezbs(<16 x i8> %a, <16 x i8> %b, ptr %ccptr) {
2645 ; CHECK-LABEL: test_vfeezbs:
2646 ; CHECK: vfeezbs %v24, %v24, %v26
2647 ; CHECK: ipm [[REG:%r[0-5]]]
2648 ; CHECK: srl [[REG]], 28
2649 ; CHECK: st [[REG]], 0(%r2)
2651 %call = call {<16 x i8>, i32} @llvm.s390.vfeezbs(<16 x i8> %a, <16 x i8> %b)
2652 %res = extractvalue {<16 x i8>, i32} %call, 0
2653 %cc = extractvalue {<16 x i8>, i32} %call, 1
2654 store i32 %cc, ptr %ccptr
2659 define <8 x i16> @test_vfeezhs(<8 x i16> %a, <8 x i16> %b, ptr %ccptr) {
2660 ; CHECK-LABEL: test_vfeezhs:
2661 ; CHECK: vfeezhs %v24, %v24, %v26
2662 ; CHECK: ipm [[REG:%r[0-5]]]
2663 ; CHECK: srl [[REG]], 28
2664 ; CHECK: st [[REG]], 0(%r2)
2666 %call = call {<8 x i16>, i32} @llvm.s390.vfeezhs(<8 x i16> %a, <8 x i16> %b)
2667 %res = extractvalue {<8 x i16>, i32} %call, 0
2668 %cc = extractvalue {<8 x i16>, i32} %call, 1
2669 store i32 %cc, ptr %ccptr
2674 define <4 x i32> @test_vfeezfs(<4 x i32> %a, <4 x i32> %b, ptr %ccptr) {
2675 ; CHECK-LABEL: test_vfeezfs:
2676 ; CHECK: vfeezfs %v24, %v24, %v26
2677 ; CHECK: ipm [[REG:%r[0-5]]]
2678 ; CHECK: srl [[REG]], 28
2679 ; CHECK: st [[REG]], 0(%r2)
2681 %call = call {<4 x i32>, i32} @llvm.s390.vfeezfs(<4 x i32> %a, <4 x i32> %b)
2682 %res = extractvalue {<4 x i32>, i32} %call, 0
2683 %cc = extractvalue {<4 x i32>, i32} %call, 1
2684 store i32 %cc, ptr %ccptr
2689 define <16 x i8> @test_vfeneb_0(<16 x i8> %a, <16 x i8> %b) {
2690 ; CHECK-LABEL: test_vfeneb_0:
2691 ; CHECK: vfeneb %v24, %v24, %v26
2693 %res = call <16 x i8> @llvm.s390.vfeneb(<16 x i8> %a, <16 x i8> %b)
2698 define <8 x i16> @test_vfeneh(<8 x i16> %a, <8 x i16> %b) {
2699 ; CHECK-LABEL: test_vfeneh:
2700 ; CHECK: vfeneh %v24, %v24, %v26
2702 %res = call <8 x i16> @llvm.s390.vfeneh(<8 x i16> %a, <8 x i16> %b)
2707 define <4 x i32> @test_vfenef(<4 x i32> %a, <4 x i32> %b) {
2708 ; CHECK-LABEL: test_vfenef:
2709 ; CHECK: vfenef %v24, %v24, %v26
2711 %res = call <4 x i32> @llvm.s390.vfenef(<4 x i32> %a, <4 x i32> %b)
2716 define <16 x i8> @test_vfenebs(<16 x i8> %a, <16 x i8> %b, ptr %ccptr) {
2717 ; CHECK-LABEL: test_vfenebs:
2718 ; CHECK: vfenebs %v24, %v24, %v26
2719 ; CHECK: ipm [[REG:%r[0-5]]]
2720 ; CHECK: srl [[REG]], 28
2721 ; CHECK: st [[REG]], 0(%r2)
2723 %call = call {<16 x i8>, i32} @llvm.s390.vfenebs(<16 x i8> %a, <16 x i8> %b)
2724 %res = extractvalue {<16 x i8>, i32} %call, 0
2725 %cc = extractvalue {<16 x i8>, i32} %call, 1
2726 store i32 %cc, ptr %ccptr
2731 define <8 x i16> @test_vfenehs(<8 x i16> %a, <8 x i16> %b, ptr %ccptr) {
2732 ; CHECK-LABEL: test_vfenehs:
2733 ; CHECK: vfenehs %v24, %v24, %v26
2734 ; CHECK: ipm [[REG:%r[0-5]]]
2735 ; CHECK: srl [[REG]], 28
2736 ; CHECK: st [[REG]], 0(%r2)
2738 %call = call {<8 x i16>, i32} @llvm.s390.vfenehs(<8 x i16> %a, <8 x i16> %b)
2739 %res = extractvalue {<8 x i16>, i32} %call, 0
2740 %cc = extractvalue {<8 x i16>, i32} %call, 1
2741 store i32 %cc, ptr %ccptr
2746 define <4 x i32> @test_vfenefs(<4 x i32> %a, <4 x i32> %b, ptr %ccptr) {
2747 ; CHECK-LABEL: test_vfenefs:
2748 ; CHECK: vfenefs %v24, %v24, %v26
2749 ; CHECK: ipm [[REG:%r[0-5]]]
2750 ; CHECK: srl [[REG]], 28
2751 ; CHECK: st [[REG]], 0(%r2)
2753 %call = call {<4 x i32>, i32} @llvm.s390.vfenefs(<4 x i32> %a, <4 x i32> %b)
2754 %res = extractvalue {<4 x i32>, i32} %call, 0
2755 %cc = extractvalue {<4 x i32>, i32} %call, 1
2756 store i32 %cc, ptr %ccptr
2761 define <16 x i8> @test_vfenezb(<16 x i8> %a, <16 x i8> %b) {
2762 ; CHECK-LABEL: test_vfenezb:
2763 ; CHECK: vfenezb %v24, %v24, %v26
2765 %res = call <16 x i8> @llvm.s390.vfenezb(<16 x i8> %a, <16 x i8> %b)
2770 define <8 x i16> @test_vfenezh(<8 x i16> %a, <8 x i16> %b) {
2771 ; CHECK-LABEL: test_vfenezh:
2772 ; CHECK: vfenezh %v24, %v24, %v26
2774 %res = call <8 x i16> @llvm.s390.vfenezh(<8 x i16> %a, <8 x i16> %b)
2779 define <4 x i32> @test_vfenezf(<4 x i32> %a, <4 x i32> %b) {
2780 ; CHECK-LABEL: test_vfenezf:
2781 ; CHECK: vfenezf %v24, %v24, %v26
2783 %res = call <4 x i32> @llvm.s390.vfenezf(<4 x i32> %a, <4 x i32> %b)
2788 define <16 x i8> @test_vfenezbs(<16 x i8> %a, <16 x i8> %b, ptr %ccptr) {
2789 ; CHECK-LABEL: test_vfenezbs:
2790 ; CHECK: vfenezbs %v24, %v24, %v26
2791 ; CHECK: ipm [[REG:%r[0-5]]]
2792 ; CHECK: srl [[REG]], 28
2793 ; CHECK: st [[REG]], 0(%r2)
2795 %call = call {<16 x i8>, i32} @llvm.s390.vfenezbs(<16 x i8> %a, <16 x i8> %b)
2796 %res = extractvalue {<16 x i8>, i32} %call, 0
2797 %cc = extractvalue {<16 x i8>, i32} %call, 1
2798 store i32 %cc, ptr %ccptr
2803 define <8 x i16> @test_vfenezhs(<8 x i16> %a, <8 x i16> %b, ptr %ccptr) {
2804 ; CHECK-LABEL: test_vfenezhs:
2805 ; CHECK: vfenezhs %v24, %v24, %v26
2806 ; CHECK: ipm [[REG:%r[0-5]]]
2807 ; CHECK: srl [[REG]], 28
2808 ; CHECK: st [[REG]], 0(%r2)
2810 %call = call {<8 x i16>, i32} @llvm.s390.vfenezhs(<8 x i16> %a, <8 x i16> %b)
2811 %res = extractvalue {<8 x i16>, i32} %call, 0
2812 %cc = extractvalue {<8 x i16>, i32} %call, 1
2813 store i32 %cc, ptr %ccptr
2818 define <4 x i32> @test_vfenezfs(<4 x i32> %a, <4 x i32> %b, ptr %ccptr) {
2819 ; CHECK-LABEL: test_vfenezfs:
2820 ; CHECK: vfenezfs %v24, %v24, %v26
2821 ; CHECK: ipm [[REG:%r[0-5]]]
2822 ; CHECK: srl [[REG]], 28
2823 ; CHECK: st [[REG]], 0(%r2)
2825 %call = call {<4 x i32>, i32} @llvm.s390.vfenezfs(<4 x i32> %a, <4 x i32> %b)
2826 %res = extractvalue {<4 x i32>, i32} %call, 0
2827 %cc = extractvalue {<4 x i32>, i32} %call, 1
2828 store i32 %cc, ptr %ccptr
2833 define <16 x i8> @test_vistrb(<16 x i8> %a) {
2834 ; CHECK-LABEL: test_vistrb:
2835 ; CHECK: vistrb %v24, %v24
2837 %res = call <16 x i8> @llvm.s390.vistrb(<16 x i8> %a)
2842 define <8 x i16> @test_vistrh(<8 x i16> %a) {
2843 ; CHECK-LABEL: test_vistrh:
2844 ; CHECK: vistrh %v24, %v24
2846 %res = call <8 x i16> @llvm.s390.vistrh(<8 x i16> %a)
2851 define <4 x i32> @test_vistrf(<4 x i32> %a) {
2852 ; CHECK-LABEL: test_vistrf:
2853 ; CHECK: vistrf %v24, %v24
2855 %res = call <4 x i32> @llvm.s390.vistrf(<4 x i32> %a)
2860 define <16 x i8> @test_vistrbs(<16 x i8> %a, ptr %ccptr) {
2861 ; CHECK-LABEL: test_vistrbs:
2862 ; CHECK: vistrbs %v24, %v24
2863 ; CHECK: ipm [[REG:%r[0-5]]]
2864 ; CHECK: srl [[REG]], 28
2865 ; CHECK: st [[REG]], 0(%r2)
2867 %call = call {<16 x i8>, i32} @llvm.s390.vistrbs(<16 x i8> %a)
2868 %res = extractvalue {<16 x i8>, i32} %call, 0
2869 %cc = extractvalue {<16 x i8>, i32} %call, 1
2870 store i32 %cc, ptr %ccptr
2875 define <8 x i16> @test_vistrhs(<8 x i16> %a, ptr %ccptr) {
2876 ; CHECK-LABEL: test_vistrhs:
2877 ; CHECK: vistrhs %v24, %v24
2878 ; CHECK: ipm [[REG:%r[0-5]]]
2879 ; CHECK: srl [[REG]], 28
2880 ; CHECK: st [[REG]], 0(%r2)
2882 %call = call {<8 x i16>, i32} @llvm.s390.vistrhs(<8 x i16> %a)
2883 %res = extractvalue {<8 x i16>, i32} %call, 0
2884 %cc = extractvalue {<8 x i16>, i32} %call, 1
2885 store i32 %cc, ptr %ccptr
2890 define <4 x i32> @test_vistrfs(<4 x i32> %a, ptr %ccptr) {
2891 ; CHECK-LABEL: test_vistrfs:
2892 ; CHECK: vistrfs %v24, %v24
2893 ; CHECK: ipm [[REG:%r[0-5]]]
2894 ; CHECK: srl [[REG]], 28
2895 ; CHECK: st [[REG]], 0(%r2)
2897 %call = call {<4 x i32>, i32} @llvm.s390.vistrfs(<4 x i32> %a)
2898 %res = extractvalue {<4 x i32>, i32} %call, 0
2899 %cc = extractvalue {<4 x i32>, i32} %call, 1
2900 store i32 %cc, ptr %ccptr
2904 ; VSTRCB with !IN !RT.
2905 define <16 x i8> @test_vstrcb_0(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {
2906 ; CHECK-LABEL: test_vstrcb_0:
2907 ; CHECK: vstrcb %v24, %v24, %v26, %v28, 0
2909 %res = call <16 x i8> @llvm.s390.vstrcb(<16 x i8> %a, <16 x i8> %b,
2910 <16 x i8> %c, i32 0)
2914 ; VSTRCB with !IN RT.
2915 define <16 x i8> @test_vstrcb_4(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {
2916 ; CHECK-LABEL: test_vstrcb_4:
2917 ; CHECK: vstrcb %v24, %v24, %v26, %v28, 4
2919 %res = call <16 x i8> @llvm.s390.vstrcb(<16 x i8> %a, <16 x i8> %b,
2920 <16 x i8> %c, i32 4)
2924 ; VSTRCB with IN !RT.
2925 define <16 x i8> @test_vstrcb_8(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {
2926 ; CHECK-LABEL: test_vstrcb_8:
2927 ; CHECK: vstrcb %v24, %v24, %v26, %v28, 8
2929 %res = call <16 x i8> @llvm.s390.vstrcb(<16 x i8> %a, <16 x i8> %b,
2930 <16 x i8> %c, i32 8)
2934 ; VSTRCB with IN RT.
2935 define <16 x i8> @test_vstrcb_12(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {
2936 ; CHECK-LABEL: test_vstrcb_12:
2937 ; CHECK: vstrcb %v24, %v24, %v26, %v28, 12
2939 %res = call <16 x i8> @llvm.s390.vstrcb(<16 x i8> %a, <16 x i8> %b,
2940 <16 x i8> %c, i32 12)
2944 ; VSTRCB with CS -- should be ignored.
2945 define <16 x i8> @test_vstrcb_1(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {
2946 ; CHECK-LABEL: test_vstrcb_1:
2947 ; CHECK: vstrcb %v24, %v24, %v26, %v28, 0
2949 %res = call <16 x i8> @llvm.s390.vstrcb(<16 x i8> %a, <16 x i8> %b,
2950 <16 x i8> %c, i32 1)
2955 define <8 x i16> @test_vstrch(<8 x i16> %a, <8 x i16> %b, <8 x i16> %c) {
2956 ; CHECK-LABEL: test_vstrch:
2957 ; CHECK: vstrch %v24, %v24, %v26, %v28, 4
2959 %res = call <8 x i16> @llvm.s390.vstrch(<8 x i16> %a, <8 x i16> %b,
2960 <8 x i16> %c, i32 4)
2965 define <4 x i32> @test_vstrcf(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
2966 ; CHECK-LABEL: test_vstrcf:
2967 ; CHECK: vstrcf %v24, %v24, %v26, %v28, 8
2969 %res = call <4 x i32> @llvm.s390.vstrcf(<4 x i32> %a, <4 x i32> %b,
2970 <4 x i32> %c, i32 8)
2975 define <16 x i8> @test_vstrcbs(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c,
2977 ; CHECK-LABEL: test_vstrcbs:
2978 ; CHECK: vstrcbs %v24, %v24, %v26, %v28, 0
2979 ; CHECK: ipm [[REG:%r[0-5]]]
2980 ; CHECK: srl [[REG]], 28
2981 ; CHECK: st [[REG]], 0(%r2)
2983 %call = call {<16 x i8>, i32} @llvm.s390.vstrcbs(<16 x i8> %a, <16 x i8> %b,
2984 <16 x i8> %c, i32 0)
2985 %res = extractvalue {<16 x i8>, i32} %call, 0
2986 %cc = extractvalue {<16 x i8>, i32} %call, 1
2987 store i32 %cc, ptr %ccptr
2992 define <8 x i16> @test_vstrchs(<8 x i16> %a, <8 x i16> %b, <8 x i16> %c,
2994 ; CHECK-LABEL: test_vstrchs:
2995 ; CHECK: vstrchs %v24, %v24, %v26, %v28, 4
2996 ; CHECK: ipm [[REG:%r[0-5]]]
2997 ; CHECK: srl [[REG]], 28
2998 ; CHECK: st [[REG]], 0(%r2)
3000 %call = call {<8 x i16>, i32} @llvm.s390.vstrchs(<8 x i16> %a, <8 x i16> %b,
3001 <8 x i16> %c, i32 4)
3002 %res = extractvalue {<8 x i16>, i32} %call, 0
3003 %cc = extractvalue {<8 x i16>, i32} %call, 1
3004 store i32 %cc, ptr %ccptr
3009 define <4 x i32> @test_vstrcfs(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c,
3011 ; CHECK-LABEL: test_vstrcfs:
3012 ; CHECK: vstrcfs %v24, %v24, %v26, %v28, 8
3013 ; CHECK: ipm [[REG:%r[0-5]]]
3014 ; CHECK: srl [[REG]], 28
3015 ; CHECK: st [[REG]], 0(%r2)
3017 %call = call {<4 x i32>, i32} @llvm.s390.vstrcfs(<4 x i32> %a, <4 x i32> %b,
3018 <4 x i32> %c, i32 8)
3019 %res = extractvalue {<4 x i32>, i32} %call, 0
3020 %cc = extractvalue {<4 x i32>, i32} %call, 1
3021 store i32 %cc, ptr %ccptr
3025 ; VSTRCZB with !IN !RT.
3026 define <16 x i8> @test_vstrczb_0(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {
3027 ; CHECK-LABEL: test_vstrczb_0:
3028 ; CHECK: vstrczb %v24, %v24, %v26, %v28, 0
3030 %res = call <16 x i8> @llvm.s390.vstrczb(<16 x i8> %a, <16 x i8> %b,
3031 <16 x i8> %c, i32 0)
3035 ; VSTRCZB with !IN RT.
3036 define <16 x i8> @test_vstrczb_4(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {
3037 ; CHECK-LABEL: test_vstrczb_4:
3038 ; CHECK: vstrczb %v24, %v24, %v26, %v28, 4
3040 %res = call <16 x i8> @llvm.s390.vstrczb(<16 x i8> %a, <16 x i8> %b,
3041 <16 x i8> %c, i32 4)
3045 ; VSTRCZB with IN !RT.
3046 define <16 x i8> @test_vstrczb_8(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {
3047 ; CHECK-LABEL: test_vstrczb_8:
3048 ; CHECK: vstrczb %v24, %v24, %v26, %v28, 8
3050 %res = call <16 x i8> @llvm.s390.vstrczb(<16 x i8> %a, <16 x i8> %b,
3051 <16 x i8> %c, i32 8)
3055 ; VSTRCZB with IN RT.
3056 define <16 x i8> @test_vstrczb_12(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {
3057 ; CHECK-LABEL: test_vstrczb_12:
3058 ; CHECK: vstrczb %v24, %v24, %v26, %v28, 12
3060 %res = call <16 x i8> @llvm.s390.vstrczb(<16 x i8> %a, <16 x i8> %b,
3061 <16 x i8> %c, i32 12)
3065 ; VSTRCZB with CS -- should be ignored.
3066 define <16 x i8> @test_vstrczb_1(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {
3067 ; CHECK-LABEL: test_vstrczb_1:
3068 ; CHECK: vstrczb %v24, %v24, %v26, %v28, 0
3070 %res = call <16 x i8> @llvm.s390.vstrczb(<16 x i8> %a, <16 x i8> %b,
3071 <16 x i8> %c, i32 1)
3076 define <8 x i16> @test_vstrczh(<8 x i16> %a, <8 x i16> %b, <8 x i16> %c) {
3077 ; CHECK-LABEL: test_vstrczh:
3078 ; CHECK: vstrczh %v24, %v24, %v26, %v28, 4
3080 %res = call <8 x i16> @llvm.s390.vstrczh(<8 x i16> %a, <8 x i16> %b,
3081 <8 x i16> %c, i32 4)
3086 define <4 x i32> @test_vstrczf(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
3087 ; CHECK-LABEL: test_vstrczf:
3088 ; CHECK: vstrczf %v24, %v24, %v26, %v28, 8
3090 %res = call <4 x i32> @llvm.s390.vstrczf(<4 x i32> %a, <4 x i32> %b,
3091 <4 x i32> %c, i32 8)
3096 define <16 x i8> @test_vstrczbs(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c,
3098 ; CHECK-LABEL: test_vstrczbs:
3099 ; CHECK: vstrczbs %v24, %v24, %v26, %v28, 0
3100 ; CHECK: ipm [[REG:%r[0-5]]]
3101 ; CHECK: srl [[REG]], 28
3102 ; CHECK: st [[REG]], 0(%r2)
3104 %call = call {<16 x i8>, i32} @llvm.s390.vstrczbs(<16 x i8> %a, <16 x i8> %b,
3105 <16 x i8> %c, i32 0)
3106 %res = extractvalue {<16 x i8>, i32} %call, 0
3107 %cc = extractvalue {<16 x i8>, i32} %call, 1
3108 store i32 %cc, ptr %ccptr
3113 define <8 x i16> @test_vstrczhs(<8 x i16> %a, <8 x i16> %b, <8 x i16> %c,
3115 ; CHECK-LABEL: test_vstrczhs:
3116 ; CHECK: vstrczhs %v24, %v24, %v26, %v28, 4
3117 ; CHECK: ipm [[REG:%r[0-5]]]
3118 ; CHECK: srl [[REG]], 28
3119 ; CHECK: st [[REG]], 0(%r2)
3121 %call = call {<8 x i16>, i32} @llvm.s390.vstrczhs(<8 x i16> %a, <8 x i16> %b,
3122 <8 x i16> %c, i32 4)
3123 %res = extractvalue {<8 x i16>, i32} %call, 0
3124 %cc = extractvalue {<8 x i16>, i32} %call, 1
3125 store i32 %cc, ptr %ccptr
3130 define <4 x i32> @test_vstrczfs(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c,
3132 ; CHECK-LABEL: test_vstrczfs:
3133 ; CHECK: vstrczfs %v24, %v24, %v26, %v28, 8
3134 ; CHECK: ipm [[REG:%r[0-5]]]
3135 ; CHECK: srl [[REG]], 28
3136 ; CHECK: st [[REG]], 0(%r2)
3138 %call = call {<4 x i32>, i32} @llvm.s390.vstrczfs(<4 x i32> %a, <4 x i32> %b,
3139 <4 x i32> %c, i32 8)
3140 %res = extractvalue {<4 x i32>, i32} %call, 0
3141 %cc = extractvalue {<4 x i32>, i32} %call, 1
3142 store i32 %cc, ptr %ccptr
3146 ; VFCEDBS with no processing of the result.
3147 define i32 @test_vfcedbs(<2 x double> %a, <2 x double> %b) {
3148 ; CHECK-LABEL: test_vfcedbs:
3149 ; CHECK: vfcedbs {{%v[0-9]+}}, %v24, %v26
3151 ; CHECK: srl %r2, 28
3153 %call = call {<2 x i64>, i32} @llvm.s390.vfcedbs(<2 x double> %a,
3155 %res = extractvalue {<2 x i64>, i32} %call, 1
3159 ; VFCEDBS, returning 1 if any elements are equal (CC != 3).
3160 define i32 @test_vfcedbs_any_bool(<2 x double> %a, <2 x double> %b) {
3161 ; CHECK-LABEL: test_vfcedbs_any_bool:
3162 ; CHECK: vfcedbs {{%v[0-9]+}}, %v24, %v26
3164 ; CHECK: lochile %r2, 1
3166 %call = call {<2 x i64>, i32} @llvm.s390.vfcedbs(<2 x double> %a,
3168 %res = extractvalue {<2 x i64>, i32} %call, 1
3169 %cmp = icmp ne i32 %res, 3
3170 %ext = zext i1 %cmp to i32
3174 ; VFCEDBS, storing to %ptr if any elements are equal.
3175 define <2 x i64> @test_vfcedbs_any_store(<2 x double> %a, <2 x double> %b,
3177 ; CHECK-LABEL: test_vfcedbs_any_store:
3179 ; CHECK: vfcedbs %v24, %v24, %v26
3180 ; CHECK-NEXT: {{bor|bnler}} %r14
3181 ; CHECK: mvhi 0(%r2), 0
3183 %call = call {<2 x i64>, i32} @llvm.s390.vfcedbs(<2 x double> %a,
3185 %res = extractvalue {<2 x i64>, i32} %call, 0
3186 %cc = extractvalue {<2 x i64>, i32} %call, 1
3187 %cmp = icmp ule i32 %cc, 2
3188 br i1 %cmp, label %store, label %exit
3191 store i32 0, ptr %ptr
3198 ; VFCHDBS with no processing of the result.
3199 define i32 @test_vfchdbs(<2 x double> %a, <2 x double> %b) {
3200 ; CHECK-LABEL: test_vfchdbs:
3201 ; CHECK: vfchdbs {{%v[0-9]+}}, %v24, %v26
3203 ; CHECK: srl %r2, 28
3205 %call = call {<2 x i64>, i32} @llvm.s390.vfchdbs(<2 x double> %a,
3207 %res = extractvalue {<2 x i64>, i32} %call, 1
3211 ; VFCHDBS, returning 1 if not all elements are higher.
3212 define i32 @test_vfchdbs_notall_bool(<2 x double> %a, <2 x double> %b) {
3213 ; CHECK-LABEL: test_vfchdbs_notall_bool:
3214 ; CHECK: vfchdbs {{%v[0-9]+}}, %v24, %v26
3216 ; CHECK: lochinhe %r2, 1
3218 %call = call {<2 x i64>, i32} @llvm.s390.vfchdbs(<2 x double> %a,
3220 %res = extractvalue {<2 x i64>, i32} %call, 1
3221 %cmp = icmp sge i32 %res, 1
3222 %ext = zext i1 %cmp to i32
3226 ; VFCHDBS, storing to %ptr if not all elements are higher.
3227 define <2 x i64> @test_vfchdbs_notall_store(<2 x double> %a, <2 x double> %b,
3229 ; CHECK-LABEL: test_vfchdbs_notall_store:
3231 ; CHECK: vfchdbs %v24, %v24, %v26
3232 ; CHECK-NEXT: {{bher|ber}} %r14
3233 ; CHECK: mvhi 0(%r2), 0
3235 %call = call {<2 x i64>, i32} @llvm.s390.vfchdbs(<2 x double> %a,
3237 %res = extractvalue {<2 x i64>, i32} %call, 0
3238 %cc = extractvalue {<2 x i64>, i32} %call, 1
3239 %cmp = icmp ugt i32 %cc, 0
3240 br i1 %cmp, label %store, label %exit
3243 store i32 0, ptr %ptr
3250 ; VFCHEDBS with no processing of the result.
3251 define i32 @test_vfchedbs(<2 x double> %a, <2 x double> %b) {
3252 ; CHECK-LABEL: test_vfchedbs:
3253 ; CHECK: vfchedbs {{%v[0-9]+}}, %v24, %v26
3255 ; CHECK: srl %r2, 28
3257 %call = call {<2 x i64>, i32} @llvm.s390.vfchedbs(<2 x double> %a,
3259 %res = extractvalue {<2 x i64>, i32} %call, 1
3263 ; VFCHEDBS, returning 1 if neither element is higher or equal.
3264 define i32 @test_vfchedbs_none_bool(<2 x double> %a, <2 x double> %b) {
3265 ; CHECK-LABEL: test_vfchedbs_none_bool:
3266 ; CHECK: vfchedbs {{%v[0-9]+}}, %v24, %v26
3268 ; CHECK: lochio %r2, 1
3270 %call = call {<2 x i64>, i32} @llvm.s390.vfchedbs(<2 x double> %a,
3272 %res = extractvalue {<2 x i64>, i32} %call, 1
3273 %cmp = icmp eq i32 %res, 3
3274 %ext = zext i1 %cmp to i32
3278 ; VFCHEDBS, storing to %ptr if neither element is higher or equal.
3279 define <2 x i64> @test_vfchedbs_none_store(<2 x double> %a, <2 x double> %b,
3281 ; CHECK-LABEL: test_vfchedbs_none_store:
3283 ; CHECK: vfchedbs %v24, %v24, %v26
3284 ; CHECK-NEXT: {{bnor|bler}} %r14
3285 ; CHECK: mvhi 0(%r2), 0
3287 %call = call {<2 x i64>, i32} @llvm.s390.vfchedbs(<2 x double> %a,
3289 %res = extractvalue {<2 x i64>, i32} %call, 0
3290 %cc = extractvalue {<2 x i64>, i32} %call, 1
3291 %cmp = icmp uge i32 %cc, 3
3292 br i1 %cmp, label %store, label %exit
3295 store i32 0, ptr %ptr
3302 ; VFTCIDB with the lowest useful class selector and no processing of the result.
3303 define i32 @test_vftcidb(<2 x double> %a) {
3304 ; CHECK-LABEL: test_vftcidb:
3305 ; CHECK: vftcidb {{%v[0-9]+}}, %v24, 1
3307 ; CHECK: srl %r2, 28
3309 %call = call {<2 x i64>, i32} @llvm.s390.vftcidb(<2 x double> %a, i32 1)
3310 %res = extractvalue {<2 x i64>, i32} %call, 1
3314 ; VFTCIDB with the highest useful class selector, returning 1 if all elements
3315 ; have the right class (CC == 0).
3316 define i32 @test_vftcidb_all_bool(<2 x double> %a) {
3317 ; CHECK-LABEL: test_vftcidb_all_bool:
3318 ; CHECK: vftcidb {{%v[0-9]+}}, %v24, 4094
3320 ; CHECK: lochie %r2, 1
3322 %call = call {<2 x i64>, i32} @llvm.s390.vftcidb(<2 x double> %a, i32 4094)
3323 %res = extractvalue {<2 x i64>, i32} %call, 1
3324 %cmp = icmp eq i32 %res, 0
3325 %ext = zext i1 %cmp to i32
3329 ; VFIDB with a rounding mode not usable via standard intrinsics.
3330 define <2 x double> @test_vfidb_0_4(<2 x double> %a) {
3331 ; CHECK-LABEL: test_vfidb_0_4:
3332 ; CHECK: vfidb %v24, %v24, 0, 4
3334 %res = call <2 x double> @llvm.s390.vfidb(<2 x double> %a, i32 0, i32 4)
3335 ret <2 x double> %res
3338 ; VFIDB with IEEE-inexact exception suppressed.
3339 define <2 x double> @test_vfidb_4_0(<2 x double> %a) {
3340 ; CHECK-LABEL: test_vfidb_4_0:
3341 ; CHECK: vfidb %v24, %v24, 4, 0
3343 %res = call <2 x double> @llvm.s390.vfidb(<2 x double> %a, i32 4, i32 0)
3344 ret <2 x double> %res