1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=thumbv8.1m.main -mattr=+mve -verify-machineinstrs -o - %s | FileCheck %s
4 define arm_aapcs_vfpcc <8 x i16> @test_vbicq_n_u16_sh0(<8 x i16> %a) {
5 ; CHECK-LABEL: test_vbicq_n_u16_sh0:
6 ; CHECK: @ %bb.0: @ %entry
7 ; CHECK-NEXT: vbic.i16 q0, #0x64
10 %0 = and <8 x i16> %a, <i16 -101, i16 -101, i16 -101, i16 -101, i16 -101, i16 -101, i16 -101, i16 -101>
14 define arm_aapcs_vfpcc <8 x i16> @test_vbicq_n_u16_sh8(<8 x i16> %a) {
15 ; CHECK-LABEL: test_vbicq_n_u16_sh8:
16 ; CHECK: @ %bb.0: @ %entry
17 ; CHECK-NEXT: vbic.i16 q0, #0x6400
20 %0 = and <8 x i16> %a, <i16 -25601, i16 -25601, i16 -25601, i16 -25601, i16 -25601, i16 -25601, i16 -25601, i16 -25601>
24 define arm_aapcs_vfpcc <4 x i32> @test_vbicq_n_u32_sh0(<4 x i32> %a) {
25 ; CHECK-LABEL: test_vbicq_n_u32_sh0:
26 ; CHECK: @ %bb.0: @ %entry
27 ; CHECK-NEXT: vbic.i32 q0, #0x64
30 %0 = and <4 x i32> %a, <i32 -101, i32 -101, i32 -101, i32 -101>
34 define arm_aapcs_vfpcc <4 x i32> @test_vbicq_n_u32_sh8(<4 x i32> %a) {
35 ; CHECK-LABEL: test_vbicq_n_u32_sh8:
36 ; CHECK: @ %bb.0: @ %entry
37 ; CHECK-NEXT: vbic.i32 q0, #0x6400
40 %0 = and <4 x i32> %a, <i32 -25601, i32 -25601, i32 -25601, i32 -25601>
44 define arm_aapcs_vfpcc <4 x i32> @test_vbicq_n_u32_sh16(<4 x i32> %a) {
45 ; CHECK-LABEL: test_vbicq_n_u32_sh16:
46 ; CHECK: @ %bb.0: @ %entry
47 ; CHECK-NEXT: vbic.i32 q0, #0x640000
50 %0 = and <4 x i32> %a, <i32 -6553601, i32 -6553601, i32 -6553601, i32 -6553601>
54 define arm_aapcs_vfpcc <4 x i32> @test_vbicq_n_u32_sh24(<4 x i32> %a) {
55 ; CHECK-LABEL: test_vbicq_n_u32_sh24:
56 ; CHECK: @ %bb.0: @ %entry
57 ; CHECK-NEXT: vbic.i32 q0, #0x64000000
60 %0 = and <4 x i32> %a, <i32 -1677721601, i32 -1677721601, i32 -1677721601, i32 -1677721601>
64 ; The immediate in this case is legal for a VMVN but not for a VBIC,
65 ; so in this case we expect to see the constant being prepared in
67 define arm_aapcs_vfpcc <4 x i32> @test_vbicq_n_u32_illegal(<4 x i32> %a) {
68 ; CHECK-LABEL: test_vbicq_n_u32_illegal:
69 ; CHECK: @ %bb.0: @ %entry
70 ; CHECK-NEXT: vmvn.i32 q1, #0x54ff
71 ; CHECK-NEXT: vand q0, q0, q1
74 %0 = and <4 x i32> %a, <i32 -21760, i32 -21760, i32 -21760, i32 -21760>
78 define arm_aapcs_vfpcc <8 x i16> @test_vorrq_n_u16_sh0(<8 x i16> %a) {
79 ; CHECK-LABEL: test_vorrq_n_u16_sh0:
80 ; CHECK: @ %bb.0: @ %entry
81 ; CHECK-NEXT: vorr.i16 q0, #0x64
84 %0 = or <8 x i16> %a, <i16 100, i16 100, i16 100, i16 100, i16 100, i16 100, i16 100, i16 100>
88 define arm_aapcs_vfpcc <8 x i16> @test_vorrq_n_u16_sh8(<8 x i16> %a) {
89 ; CHECK-LABEL: test_vorrq_n_u16_sh8:
90 ; CHECK: @ %bb.0: @ %entry
91 ; CHECK-NEXT: vorr.i16 q0, #0x6400
94 %0 = or <8 x i16> %a, <i16 25600, i16 25600, i16 25600, i16 25600, i16 25600, i16 25600, i16 25600, i16 25600>
98 define arm_aapcs_vfpcc <4 x i32> @test_vorrq_n_u32_sh0(<4 x i32> %a) {
99 ; CHECK-LABEL: test_vorrq_n_u32_sh0:
100 ; CHECK: @ %bb.0: @ %entry
101 ; CHECK-NEXT: vorr.i32 q0, #0x64
104 %0 = or <4 x i32> %a, <i32 100, i32 100, i32 100, i32 100>
108 define arm_aapcs_vfpcc <4 x i32> @test_vorrq_n_u32_sh8(<4 x i32> %a) {
109 ; CHECK-LABEL: test_vorrq_n_u32_sh8:
110 ; CHECK: @ %bb.0: @ %entry
111 ; CHECK-NEXT: vorr.i32 q0, #0x6400
114 %0 = or <4 x i32> %a, <i32 25600, i32 25600, i32 25600, i32 25600>
118 define arm_aapcs_vfpcc <4 x i32> @test_vorrq_n_u32_sh16(<4 x i32> %a) {
119 ; CHECK-LABEL: test_vorrq_n_u32_sh16:
120 ; CHECK: @ %bb.0: @ %entry
121 ; CHECK-NEXT: vorr.i32 q0, #0x640000
124 %0 = or <4 x i32> %a, <i32 6553600, i32 6553600, i32 6553600, i32 6553600>
128 define arm_aapcs_vfpcc <4 x i32> @test_vorrq_n_u32_sh24(<4 x i32> %a) {
129 ; CHECK-LABEL: test_vorrq_n_u32_sh24:
130 ; CHECK: @ %bb.0: @ %entry
131 ; CHECK-NEXT: vorr.i32 q0, #0x64000000
134 %0 = or <4 x i32> %a, <i32 1677721600, i32 1677721600, i32 1677721600, i32 1677721600>
138 define arm_aapcs_vfpcc <8 x i16> @test_vbicq_m_n_u16_sh0(<8 x i16> %a, i16 zeroext %p) {
139 ; CHECK-LABEL: test_vbicq_m_n_u16_sh0:
140 ; CHECK: @ %bb.0: @ %entry
141 ; CHECK-NEXT: vmsr p0, r0
143 ; CHECK-NEXT: vbict.i16 q0, #0x64
146 %0 = zext i16 %p to i32
147 %1 = tail call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 %0)
148 %2 = and <8 x i16> %a, <i16 -101, i16 -101, i16 -101, i16 -101, i16 -101, i16 -101, i16 -101, i16 -101>
149 %3 = select <8 x i1> %1, <8 x i16> %2, <8 x i16> %a
153 define arm_aapcs_vfpcc <8 x i16> @test_vbicq_m_n_u16_sh8(<8 x i16> %a, i16 zeroext %p) {
154 ; CHECK-LABEL: test_vbicq_m_n_u16_sh8:
155 ; CHECK: @ %bb.0: @ %entry
156 ; CHECK-NEXT: vmsr p0, r0
158 ; CHECK-NEXT: vbict.i16 q0, #0x6400
161 %0 = zext i16 %p to i32
162 %1 = tail call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 %0)
163 %2 = and <8 x i16> %a, <i16 -25601, i16 -25601, i16 -25601, i16 -25601, i16 -25601, i16 -25601, i16 -25601, i16 -25601>
164 %3 = select <8 x i1> %1, <8 x i16> %2, <8 x i16> %a
168 define arm_aapcs_vfpcc <4 x i32> @test_vbicq_m_n_u32_sh0(<4 x i32> %a, i16 zeroext %p) {
169 ; CHECK-LABEL: test_vbicq_m_n_u32_sh0:
170 ; CHECK: @ %bb.0: @ %entry
171 ; CHECK-NEXT: vmsr p0, r0
173 ; CHECK-NEXT: vbict.i32 q0, #0x64
176 %0 = zext i16 %p to i32
177 %1 = tail call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 %0)
178 %2 = and <4 x i32> %a, <i32 -101, i32 -101, i32 -101, i32 -101>
179 %3 = select <4 x i1> %1, <4 x i32> %2, <4 x i32> %a
183 define arm_aapcs_vfpcc <4 x i32> @test_vbicq_m_n_u32_sh8(<4 x i32> %a, i16 zeroext %p) {
184 ; CHECK-LABEL: test_vbicq_m_n_u32_sh8:
185 ; CHECK: @ %bb.0: @ %entry
186 ; CHECK-NEXT: vmsr p0, r0
188 ; CHECK-NEXT: vbict.i32 q0, #0x6400
191 %0 = zext i16 %p to i32
192 %1 = tail call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 %0)
193 %2 = and <4 x i32> %a, <i32 -25601, i32 -25601, i32 -25601, i32 -25601>
194 %3 = select <4 x i1> %1, <4 x i32> %2, <4 x i32> %a
198 define arm_aapcs_vfpcc <4 x i32> @test_vbicq_m_n_u32_sh16(<4 x i32> %a, i16 zeroext %p) {
199 ; CHECK-LABEL: test_vbicq_m_n_u32_sh16:
200 ; CHECK: @ %bb.0: @ %entry
201 ; CHECK-NEXT: vmsr p0, r0
203 ; CHECK-NEXT: vbict.i32 q0, #0x640000
206 %0 = zext i16 %p to i32
207 %1 = tail call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 %0)
208 %2 = and <4 x i32> %a, <i32 -6553601, i32 -6553601, i32 -6553601, i32 -6553601>
209 %3 = select <4 x i1> %1, <4 x i32> %2, <4 x i32> %a
213 define arm_aapcs_vfpcc <4 x i32> @test_vbicq_m_n_u32_sh24(<4 x i32> %a, i16 zeroext %p) {
214 ; CHECK-LABEL: test_vbicq_m_n_u32_sh24:
215 ; CHECK: @ %bb.0: @ %entry
216 ; CHECK-NEXT: vmsr p0, r0
218 ; CHECK-NEXT: vbict.i32 q0, #0x64000000
221 %0 = zext i16 %p to i32
222 %1 = tail call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 %0)
223 %2 = and <4 x i32> %a, <i32 -1677721601, i32 -1677721601, i32 -1677721601, i32 -1677721601>
224 %3 = select <4 x i1> %1, <4 x i32> %2, <4 x i32> %a
228 define arm_aapcs_vfpcc <8 x i16> @test_vorrq_m_n_u16_sh0(<8 x i16> %a, i16 zeroext %p) {
229 ; CHECK-LABEL: test_vorrq_m_n_u16_sh0:
230 ; CHECK: @ %bb.0: @ %entry
231 ; CHECK-NEXT: vmsr p0, r0
233 ; CHECK-NEXT: vorrt.i16 q0, #0x64
236 %0 = zext i16 %p to i32
237 %1 = tail call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 %0)
238 %2 = or <8 x i16> %a, <i16 100, i16 100, i16 100, i16 100, i16 100, i16 100, i16 100, i16 100>
239 %3 = select <8 x i1> %1, <8 x i16> %2, <8 x i16> %a
243 define arm_aapcs_vfpcc <8 x i16> @test_vorrq_m_n_u16_sh8(<8 x i16> %a, i16 zeroext %p) {
244 ; CHECK-LABEL: test_vorrq_m_n_u16_sh8:
245 ; CHECK: @ %bb.0: @ %entry
246 ; CHECK-NEXT: vmsr p0, r0
248 ; CHECK-NEXT: vorrt.i16 q0, #0x6400
251 %0 = zext i16 %p to i32
252 %1 = tail call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 %0)
253 %2 = or <8 x i16> %a, <i16 25600, i16 25600, i16 25600, i16 25600, i16 25600, i16 25600, i16 25600, i16 25600>
254 %3 = select <8 x i1> %1, <8 x i16> %2, <8 x i16> %a
258 define arm_aapcs_vfpcc <4 x i32> @test_vorrq_m_n_u32_sh0(<4 x i32> %a, i16 zeroext %p) {
259 ; CHECK-LABEL: test_vorrq_m_n_u32_sh0:
260 ; CHECK: @ %bb.0: @ %entry
261 ; CHECK-NEXT: vmsr p0, r0
263 ; CHECK-NEXT: vorrt.i32 q0, #0x64
266 %0 = zext i16 %p to i32
267 %1 = tail call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 %0)
268 %2 = or <4 x i32> %a, <i32 100, i32 100, i32 100, i32 100>
269 %3 = select <4 x i1> %1, <4 x i32> %2, <4 x i32> %a
273 define arm_aapcs_vfpcc <4 x i32> @test_vorrq_m_n_u32_sh8(<4 x i32> %a, i16 zeroext %p) {
274 ; CHECK-LABEL: test_vorrq_m_n_u32_sh8:
275 ; CHECK: @ %bb.0: @ %entry
276 ; CHECK-NEXT: vmsr p0, r0
278 ; CHECK-NEXT: vorrt.i32 q0, #0x6400
281 %0 = zext i16 %p to i32
282 %1 = tail call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 %0)
283 %2 = or <4 x i32> %a, <i32 25600, i32 25600, i32 25600, i32 25600>
284 %3 = select <4 x i1> %1, <4 x i32> %2, <4 x i32> %a
288 define arm_aapcs_vfpcc <4 x i32> @test_vorrq_m_n_u32_sh16(<4 x i32> %a, i16 zeroext %p) {
289 ; CHECK-LABEL: test_vorrq_m_n_u32_sh16:
290 ; CHECK: @ %bb.0: @ %entry
291 ; CHECK-NEXT: vmsr p0, r0
293 ; CHECK-NEXT: vorrt.i32 q0, #0x640000
296 %0 = zext i16 %p to i32
297 %1 = tail call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 %0)
298 %2 = or <4 x i32> %a, <i32 6553600, i32 6553600, i32 6553600, i32 6553600>
299 %3 = select <4 x i1> %1, <4 x i32> %2, <4 x i32> %a
303 define arm_aapcs_vfpcc <4 x i32> @test_vorrq_m_n_u32_sh24(<4 x i32> %a, i16 zeroext %p) {
304 ; CHECK-LABEL: test_vorrq_m_n_u32_sh24:
305 ; CHECK: @ %bb.0: @ %entry
306 ; CHECK-NEXT: vmsr p0, r0
308 ; CHECK-NEXT: vorrt.i32 q0, #0x64000000
311 %0 = zext i16 %p to i32
312 %1 = tail call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 %0)
313 %2 = or <4 x i32> %a, <i32 1677721600, i32 1677721600, i32 1677721600, i32 1677721600>
314 %3 = select <4 x i1> %1, <4 x i32> %2, <4 x i32> %a
318 define arm_aapcs_vfpcc <8 x i16> @test_vmvnq_n_u16() {
319 ; CHECK-LABEL: test_vmvnq_n_u16:
320 ; CHECK: @ %bb.0: @ %entry
321 ; CHECK-NEXT: vmvn.i16 q0, #0xaa00
324 ret <8 x i16> <i16 -43521, i16 -43521, i16 -43521, i16 -43521, i16 -43521, i16 -43521, i16 -43521, i16 -43521>
327 define arm_aapcs_vfpcc <4 x i32> @test_vmvnq_n_u32() {
328 ; CHECK-LABEL: test_vmvnq_n_u32:
329 ; CHECK: @ %bb.0: @ %entry
330 ; CHECK-NEXT: vmvn.i32 q0, #0xaa00
333 ret <4 x i32> <i32 -43521, i32 -43521, i32 -43521, i32 -43521>
336 define arm_aapcs_vfpcc <8 x i16> @test_vmvnq_m_n_u16(<8 x i16> %inactive, i16 zeroext %p) {
337 ; CHECK-LABEL: test_vmvnq_m_n_u16:
338 ; CHECK: @ %bb.0: @ %entry
339 ; CHECK-NEXT: vmsr p0, r0
341 ; CHECK-NEXT: vmvnt.i16 q0, #0xaa00
344 %0 = zext i16 %p to i32
345 %1 = tail call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 %0)
346 %2 = select <8 x i1> %1, <8 x i16> <i16 -43521, i16 -43521, i16 -43521, i16 -43521, i16 -43521, i16 -43521, i16 -43521, i16 -43521>, <8 x i16> %inactive
350 define arm_aapcs_vfpcc <4 x i32> @test_vmvnq_m_n_u32(<4 x i32> %inactive, i16 zeroext %p) {
351 ; CHECK-LABEL: test_vmvnq_m_n_u32:
352 ; CHECK: @ %bb.0: @ %entry
353 ; CHECK-NEXT: vmsr p0, r0
355 ; CHECK-NEXT: vmvnt.i32 q0, #0xaa00
358 %0 = zext i16 %p to i32
359 %1 = tail call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 %0)
360 %2 = select <4 x i1> %1, <4 x i32> <i32 -43521, i32 -43521, i32 -43521, i32 -43521>, <4 x i32> %inactive
364 declare <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32)
365 declare <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32)