1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=aarch64-unknown-linux-gnu < %s | FileCheck %s
5 define <4 x i32> @test_urem_odd_even(<4 x i32> %X) nounwind {
6 ; CHECK-LABEL: test_urem_odd_even:
8 ; CHECK-NEXT: adrp x8, .LCPI0_0
9 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI0_0]
10 ; CHECK-NEXT: adrp x8, .LCPI0_1
11 ; CHECK-NEXT: ldr q2, [x8, :lo12:.LCPI0_1]
12 ; CHECK-NEXT: adrp x8, .LCPI0_2
13 ; CHECK-NEXT: ldr q3, [x8, :lo12:.LCPI0_2]
14 ; CHECK-NEXT: adrp x8, .LCPI0_3
15 ; CHECK-NEXT: mul v0.4s, v0.4s, v1.4s
16 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI0_3]
17 ; CHECK-NEXT: ushl v2.4s, v0.4s, v2.4s
18 ; CHECK-NEXT: ushl v0.4s, v0.4s, v3.4s
19 ; CHECK-NEXT: orr v0.16b, v0.16b, v2.16b
20 ; CHECK-NEXT: cmhs v0.4s, v1.4s, v0.4s
21 ; CHECK-NEXT: movi v1.4s, #1
22 ; CHECK-NEXT: and v0.16b, v0.16b, v1.16b
24 %urem = urem <4 x i32> %X, <i32 5, i32 14, i32 25, i32 100>
25 %cmp = icmp eq <4 x i32> %urem, <i32 0, i32 0, i32 0, i32 0>
26 %ret = zext <4 x i1> %cmp to <4 x i32>
30 ;==============================================================================;
32 ; One all-ones divisor in odd divisor
33 define <4 x i32> @test_urem_odd_allones_eq(<4 x i32> %X) nounwind {
34 ; CHECK-LABEL: test_urem_odd_allones_eq:
36 ; CHECK-NEXT: adrp x8, .LCPI1_0
37 ; CHECK-NEXT: adrp x9, .LCPI1_1
38 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI1_0]
39 ; CHECK-NEXT: ldr q2, [x9, :lo12:.LCPI1_1]
40 ; CHECK-NEXT: mul v0.4s, v0.4s, v1.4s
41 ; CHECK-NEXT: cmhs v0.4s, v2.4s, v0.4s
42 ; CHECK-NEXT: movi v1.4s, #1
43 ; CHECK-NEXT: and v0.16b, v0.16b, v1.16b
45 %urem = urem <4 x i32> %X, <i32 5, i32 5, i32 4294967295, i32 5>
46 %cmp = icmp eq <4 x i32> %urem, <i32 0, i32 0, i32 0, i32 0>
47 %ret = zext <4 x i1> %cmp to <4 x i32>
50 define <4 x i32> @test_urem_odd_allones_ne(<4 x i32> %X) nounwind {
51 ; CHECK-LABEL: test_urem_odd_allones_ne:
53 ; CHECK-NEXT: adrp x8, .LCPI2_0
54 ; CHECK-NEXT: adrp x9, .LCPI2_1
55 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI2_0]
56 ; CHECK-NEXT: ldr q2, [x9, :lo12:.LCPI2_1]
57 ; CHECK-NEXT: mul v0.4s, v0.4s, v1.4s
58 ; CHECK-NEXT: cmhi v0.4s, v0.4s, v2.4s
59 ; CHECK-NEXT: movi v1.4s, #1
60 ; CHECK-NEXT: and v0.16b, v0.16b, v1.16b
62 %urem = urem <4 x i32> %X, <i32 5, i32 5, i32 4294967295, i32 5>
63 %cmp = icmp ne <4 x i32> %urem, <i32 0, i32 0, i32 0, i32 0>
64 %ret = zext <4 x i1> %cmp to <4 x i32>
68 ; One all-ones divisor in even divisor
69 define <4 x i32> @test_urem_even_allones_eq(<4 x i32> %X) nounwind {
70 ; CHECK-LABEL: test_urem_even_allones_eq:
72 ; CHECK-NEXT: adrp x8, .LCPI3_0
73 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI3_0]
74 ; CHECK-NEXT: adrp x8, .LCPI3_1
75 ; CHECK-NEXT: ldr q2, [x8, :lo12:.LCPI3_1]
76 ; CHECK-NEXT: adrp x8, .LCPI3_2
77 ; CHECK-NEXT: ldr q3, [x8, :lo12:.LCPI3_2]
78 ; CHECK-NEXT: adrp x8, .LCPI3_3
79 ; CHECK-NEXT: mul v0.4s, v0.4s, v1.4s
80 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI3_3]
81 ; CHECK-NEXT: ushl v2.4s, v0.4s, v2.4s
82 ; CHECK-NEXT: ushl v0.4s, v0.4s, v3.4s
83 ; CHECK-NEXT: orr v0.16b, v0.16b, v2.16b
84 ; CHECK-NEXT: cmhs v0.4s, v1.4s, v0.4s
85 ; CHECK-NEXT: movi v1.4s, #1
86 ; CHECK-NEXT: and v0.16b, v0.16b, v1.16b
88 %urem = urem <4 x i32> %X, <i32 14, i32 14, i32 4294967295, i32 14>
89 %cmp = icmp eq <4 x i32> %urem, <i32 0, i32 0, i32 0, i32 0>
90 %ret = zext <4 x i1> %cmp to <4 x i32>
93 define <4 x i32> @test_urem_even_allones_ne(<4 x i32> %X) nounwind {
94 ; CHECK-LABEL: test_urem_even_allones_ne:
96 ; CHECK-NEXT: adrp x8, .LCPI4_0
97 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI4_0]
98 ; CHECK-NEXT: adrp x8, .LCPI4_1
99 ; CHECK-NEXT: ldr q2, [x8, :lo12:.LCPI4_1]
100 ; CHECK-NEXT: adrp x8, .LCPI4_2
101 ; CHECK-NEXT: ldr q3, [x8, :lo12:.LCPI4_2]
102 ; CHECK-NEXT: adrp x8, .LCPI4_3
103 ; CHECK-NEXT: mul v0.4s, v0.4s, v1.4s
104 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI4_3]
105 ; CHECK-NEXT: ushl v2.4s, v0.4s, v2.4s
106 ; CHECK-NEXT: ushl v0.4s, v0.4s, v3.4s
107 ; CHECK-NEXT: orr v0.16b, v0.16b, v2.16b
108 ; CHECK-NEXT: cmhi v0.4s, v0.4s, v1.4s
109 ; CHECK-NEXT: movi v1.4s, #1
110 ; CHECK-NEXT: and v0.16b, v0.16b, v1.16b
112 %urem = urem <4 x i32> %X, <i32 14, i32 14, i32 4294967295, i32 14>
113 %cmp = icmp ne <4 x i32> %urem, <i32 0, i32 0, i32 0, i32 0>
114 %ret = zext <4 x i1> %cmp to <4 x i32>
118 ; One all-ones divisor in odd+even divisor
119 define <4 x i32> @test_urem_odd_even_allones_eq(<4 x i32> %X) nounwind {
120 ; CHECK-LABEL: test_urem_odd_even_allones_eq:
122 ; CHECK-NEXT: adrp x8, .LCPI5_0
123 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI5_0]
124 ; CHECK-NEXT: adrp x8, .LCPI5_1
125 ; CHECK-NEXT: ldr q2, [x8, :lo12:.LCPI5_1]
126 ; CHECK-NEXT: adrp x8, .LCPI5_2
127 ; CHECK-NEXT: ldr q3, [x8, :lo12:.LCPI5_2]
128 ; CHECK-NEXT: adrp x8, .LCPI5_3
129 ; CHECK-NEXT: mul v0.4s, v0.4s, v1.4s
130 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI5_3]
131 ; CHECK-NEXT: ushl v2.4s, v0.4s, v2.4s
132 ; CHECK-NEXT: ushl v0.4s, v0.4s, v3.4s
133 ; CHECK-NEXT: orr v0.16b, v0.16b, v2.16b
134 ; CHECK-NEXT: cmhs v0.4s, v1.4s, v0.4s
135 ; CHECK-NEXT: movi v1.4s, #1
136 ; CHECK-NEXT: and v0.16b, v0.16b, v1.16b
138 %urem = urem <4 x i32> %X, <i32 5, i32 14, i32 4294967295, i32 100>
139 %cmp = icmp eq <4 x i32> %urem, <i32 0, i32 0, i32 0, i32 0>
140 %ret = zext <4 x i1> %cmp to <4 x i32>
143 define <4 x i32> @test_urem_odd_even_allones_ne(<4 x i32> %X) nounwind {
144 ; CHECK-LABEL: test_urem_odd_even_allones_ne:
146 ; CHECK-NEXT: adrp x8, .LCPI6_0
147 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI6_0]
148 ; CHECK-NEXT: adrp x8, .LCPI6_1
149 ; CHECK-NEXT: ldr q2, [x8, :lo12:.LCPI6_1]
150 ; CHECK-NEXT: adrp x8, .LCPI6_2
151 ; CHECK-NEXT: ldr q3, [x8, :lo12:.LCPI6_2]
152 ; CHECK-NEXT: adrp x8, .LCPI6_3
153 ; CHECK-NEXT: mul v0.4s, v0.4s, v1.4s
154 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI6_3]
155 ; CHECK-NEXT: ushl v2.4s, v0.4s, v2.4s
156 ; CHECK-NEXT: ushl v0.4s, v0.4s, v3.4s
157 ; CHECK-NEXT: orr v0.16b, v0.16b, v2.16b
158 ; CHECK-NEXT: cmhi v0.4s, v0.4s, v1.4s
159 ; CHECK-NEXT: movi v1.4s, #1
160 ; CHECK-NEXT: and v0.16b, v0.16b, v1.16b
162 %urem = urem <4 x i32> %X, <i32 5, i32 14, i32 4294967295, i32 100>
163 %cmp = icmp ne <4 x i32> %urem, <i32 0, i32 0, i32 0, i32 0>
164 %ret = zext <4 x i1> %cmp to <4 x i32>
168 ;------------------------------------------------------------------------------;
170 ; One power-of-two divisor in odd divisor
171 define <4 x i32> @test_urem_odd_poweroftwo(<4 x i32> %X) nounwind {
172 ; CHECK-LABEL: test_urem_odd_poweroftwo:
174 ; CHECK-NEXT: adrp x8, .LCPI7_0
175 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI7_0]
176 ; CHECK-NEXT: adrp x8, .LCPI7_1
177 ; CHECK-NEXT: ldr q2, [x8, :lo12:.LCPI7_1]
178 ; CHECK-NEXT: adrp x8, .LCPI7_2
179 ; CHECK-NEXT: ldr q3, [x8, :lo12:.LCPI7_2]
180 ; CHECK-NEXT: adrp x8, .LCPI7_3
181 ; CHECK-NEXT: mul v0.4s, v0.4s, v1.4s
182 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI7_3]
183 ; CHECK-NEXT: ushl v2.4s, v0.4s, v2.4s
184 ; CHECK-NEXT: ushl v0.4s, v0.4s, v3.4s
185 ; CHECK-NEXT: orr v0.16b, v0.16b, v2.16b
186 ; CHECK-NEXT: cmhs v0.4s, v1.4s, v0.4s
187 ; CHECK-NEXT: movi v1.4s, #1
188 ; CHECK-NEXT: and v0.16b, v0.16b, v1.16b
190 %urem = urem <4 x i32> %X, <i32 5, i32 5, i32 16, i32 5>
191 %cmp = icmp eq <4 x i32> %urem, <i32 0, i32 0, i32 0, i32 0>
192 %ret = zext <4 x i1> %cmp to <4 x i32>
196 ; One power-of-two divisor in even divisor
197 define <4 x i32> @test_urem_even_poweroftwo(<4 x i32> %X) nounwind {
198 ; CHECK-LABEL: test_urem_even_poweroftwo:
200 ; CHECK-NEXT: adrp x8, .LCPI8_0
201 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI8_0]
202 ; CHECK-NEXT: adrp x8, .LCPI8_1
203 ; CHECK-NEXT: ldr q2, [x8, :lo12:.LCPI8_1]
204 ; CHECK-NEXT: adrp x8, .LCPI8_2
205 ; CHECK-NEXT: ldr q3, [x8, :lo12:.LCPI8_2]
206 ; CHECK-NEXT: adrp x8, .LCPI8_3
207 ; CHECK-NEXT: mul v0.4s, v0.4s, v1.4s
208 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI8_3]
209 ; CHECK-NEXT: ushl v2.4s, v0.4s, v2.4s
210 ; CHECK-NEXT: ushl v0.4s, v0.4s, v3.4s
211 ; CHECK-NEXT: orr v0.16b, v0.16b, v2.16b
212 ; CHECK-NEXT: cmhs v0.4s, v1.4s, v0.4s
213 ; CHECK-NEXT: movi v1.4s, #1
214 ; CHECK-NEXT: and v0.16b, v0.16b, v1.16b
216 %urem = urem <4 x i32> %X, <i32 14, i32 14, i32 16, i32 14>
217 %cmp = icmp eq <4 x i32> %urem, <i32 0, i32 0, i32 0, i32 0>
218 %ret = zext <4 x i1> %cmp to <4 x i32>
222 ; One power-of-two divisor in odd+even divisor
223 define <4 x i32> @test_urem_odd_even_poweroftwo(<4 x i32> %X) nounwind {
224 ; CHECK-LABEL: test_urem_odd_even_poweroftwo:
226 ; CHECK-NEXT: adrp x8, .LCPI9_0
227 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI9_0]
228 ; CHECK-NEXT: adrp x8, .LCPI9_1
229 ; CHECK-NEXT: ldr q2, [x8, :lo12:.LCPI9_1]
230 ; CHECK-NEXT: adrp x8, .LCPI9_2
231 ; CHECK-NEXT: ldr q3, [x8, :lo12:.LCPI9_2]
232 ; CHECK-NEXT: adrp x8, .LCPI9_3
233 ; CHECK-NEXT: mul v0.4s, v0.4s, v1.4s
234 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI9_3]
235 ; CHECK-NEXT: ushl v2.4s, v0.4s, v2.4s
236 ; CHECK-NEXT: ushl v0.4s, v0.4s, v3.4s
237 ; CHECK-NEXT: orr v0.16b, v0.16b, v2.16b
238 ; CHECK-NEXT: cmhs v0.4s, v1.4s, v0.4s
239 ; CHECK-NEXT: movi v1.4s, #1
240 ; CHECK-NEXT: and v0.16b, v0.16b, v1.16b
242 %urem = urem <4 x i32> %X, <i32 5, i32 14, i32 16, i32 100>
243 %cmp = icmp eq <4 x i32> %urem, <i32 0, i32 0, i32 0, i32 0>
244 %ret = zext <4 x i1> %cmp to <4 x i32>
248 ;------------------------------------------------------------------------------;
250 ; One one divisor in odd divisor
251 define <4 x i32> @test_urem_odd_one(<4 x i32> %X) nounwind {
252 ; CHECK-LABEL: test_urem_odd_one:
254 ; CHECK-NEXT: adrp x8, .LCPI10_0
255 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI10_0]
256 ; CHECK-NEXT: mov w8, #52429
257 ; CHECK-NEXT: movk w8, #52428, lsl #16
258 ; CHECK-NEXT: dup v2.4s, w8
259 ; CHECK-NEXT: mul v0.4s, v0.4s, v2.4s
260 ; CHECK-NEXT: cmhs v0.4s, v1.4s, v0.4s
261 ; CHECK-NEXT: movi v1.4s, #1
262 ; CHECK-NEXT: and v0.16b, v0.16b, v1.16b
264 %urem = urem <4 x i32> %X, <i32 5, i32 5, i32 1, i32 5>
265 %cmp = icmp eq <4 x i32> %urem, <i32 0, i32 0, i32 0, i32 0>
266 %ret = zext <4 x i1> %cmp to <4 x i32>
270 ; One one divisor in even divisor
271 define <4 x i32> @test_urem_even_one(<4 x i32> %X) nounwind {
272 ; CHECK-LABEL: test_urem_even_one:
274 ; CHECK-NEXT: mov w8, #28087
275 ; CHECK-NEXT: movk w8, #46811, lsl #16
276 ; CHECK-NEXT: adrp x9, .LCPI11_0
277 ; CHECK-NEXT: dup v1.4s, w8
278 ; CHECK-NEXT: ldr q2, [x9, :lo12:.LCPI11_0]
279 ; CHECK-NEXT: mul v0.4s, v0.4s, v1.4s
280 ; CHECK-NEXT: shl v1.4s, v0.4s, #31
281 ; CHECK-NEXT: ushr v0.4s, v0.4s, #1
282 ; CHECK-NEXT: orr v0.16b, v0.16b, v1.16b
283 ; CHECK-NEXT: cmhs v0.4s, v2.4s, v0.4s
284 ; CHECK-NEXT: movi v1.4s, #1
285 ; CHECK-NEXT: and v0.16b, v0.16b, v1.16b
287 %urem = urem <4 x i32> %X, <i32 14, i32 14, i32 1, i32 14>
288 %cmp = icmp eq <4 x i32> %urem, <i32 0, i32 0, i32 0, i32 0>
289 %ret = zext <4 x i1> %cmp to <4 x i32>
293 ; One one divisor in odd+even divisor
294 define <4 x i32> @test_urem_odd_even_one(<4 x i32> %X) nounwind {
295 ; CHECK-LABEL: test_urem_odd_even_one:
297 ; CHECK-NEXT: adrp x8, .LCPI12_0
298 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI12_0]
299 ; CHECK-NEXT: adrp x8, .LCPI12_1
300 ; CHECK-NEXT: ldr q2, [x8, :lo12:.LCPI12_1]
301 ; CHECK-NEXT: adrp x8, .LCPI12_2
302 ; CHECK-NEXT: ldr q3, [x8, :lo12:.LCPI12_2]
303 ; CHECK-NEXT: adrp x8, .LCPI12_3
304 ; CHECK-NEXT: mul v0.4s, v0.4s, v1.4s
305 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI12_3]
306 ; CHECK-NEXT: ushl v2.4s, v0.4s, v2.4s
307 ; CHECK-NEXT: ushl v0.4s, v0.4s, v3.4s
308 ; CHECK-NEXT: orr v0.16b, v0.16b, v2.16b
309 ; CHECK-NEXT: cmhs v0.4s, v1.4s, v0.4s
310 ; CHECK-NEXT: movi v1.4s, #1
311 ; CHECK-NEXT: and v0.16b, v0.16b, v1.16b
313 %urem = urem <4 x i32> %X, <i32 5, i32 14, i32 1, i32 100>
314 %cmp = icmp eq <4 x i32> %urem, <i32 0, i32 0, i32 0, i32 0>
315 %ret = zext <4 x i1> %cmp to <4 x i32>
319 ;------------------------------------------------------------------------------;
321 ; One INT_MIN divisor in odd divisor
322 define <4 x i32> @test_urem_odd_INT_MIN(<4 x i32> %X) nounwind {
323 ; CHECK-LABEL: test_urem_odd_INT_MIN:
325 ; CHECK-NEXT: adrp x8, .LCPI13_0
326 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI13_0]
327 ; CHECK-NEXT: adrp x8, .LCPI13_1
328 ; CHECK-NEXT: ldr q2, [x8, :lo12:.LCPI13_1]
329 ; CHECK-NEXT: adrp x8, .LCPI13_2
330 ; CHECK-NEXT: ldr q3, [x8, :lo12:.LCPI13_2]
331 ; CHECK-NEXT: adrp x8, .LCPI13_3
332 ; CHECK-NEXT: mul v0.4s, v0.4s, v1.4s
333 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI13_3]
334 ; CHECK-NEXT: ushl v2.4s, v0.4s, v2.4s
335 ; CHECK-NEXT: ushl v0.4s, v0.4s, v3.4s
336 ; CHECK-NEXT: orr v0.16b, v0.16b, v2.16b
337 ; CHECK-NEXT: cmhs v0.4s, v1.4s, v0.4s
338 ; CHECK-NEXT: movi v1.4s, #1
339 ; CHECK-NEXT: and v0.16b, v0.16b, v1.16b
341 %urem = urem <4 x i32> %X, <i32 5, i32 5, i32 2147483648, i32 5>
342 %cmp = icmp eq <4 x i32> %urem, <i32 0, i32 0, i32 0, i32 0>
343 %ret = zext <4 x i1> %cmp to <4 x i32>
347 ; One INT_MIN divisor in even divisor
348 define <4 x i32> @test_urem_even_INT_MIN(<4 x i32> %X) nounwind {
349 ; CHECK-LABEL: test_urem_even_INT_MIN:
351 ; CHECK-NEXT: adrp x8, .LCPI14_0
352 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI14_0]
353 ; CHECK-NEXT: adrp x8, .LCPI14_1
354 ; CHECK-NEXT: ldr q2, [x8, :lo12:.LCPI14_1]
355 ; CHECK-NEXT: adrp x8, .LCPI14_2
356 ; CHECK-NEXT: ldr q3, [x8, :lo12:.LCPI14_2]
357 ; CHECK-NEXT: adrp x8, .LCPI14_3
358 ; CHECK-NEXT: mul v0.4s, v0.4s, v1.4s
359 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI14_3]
360 ; CHECK-NEXT: ushl v2.4s, v0.4s, v2.4s
361 ; CHECK-NEXT: ushl v0.4s, v0.4s, v3.4s
362 ; CHECK-NEXT: orr v0.16b, v0.16b, v2.16b
363 ; CHECK-NEXT: cmhs v0.4s, v1.4s, v0.4s
364 ; CHECK-NEXT: movi v1.4s, #1
365 ; CHECK-NEXT: and v0.16b, v0.16b, v1.16b
367 %urem = urem <4 x i32> %X, <i32 14, i32 14, i32 2147483648, i32 14>
368 %cmp = icmp eq <4 x i32> %urem, <i32 0, i32 0, i32 0, i32 0>
369 %ret = zext <4 x i1> %cmp to <4 x i32>
373 ; One INT_MIN divisor in odd+even divisor
374 define <4 x i32> @test_urem_odd_even_INT_MIN(<4 x i32> %X) nounwind {
375 ; CHECK-LABEL: test_urem_odd_even_INT_MIN:
377 ; CHECK-NEXT: adrp x8, .LCPI15_0
378 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI15_0]
379 ; CHECK-NEXT: adrp x8, .LCPI15_1
380 ; CHECK-NEXT: ldr q2, [x8, :lo12:.LCPI15_1]
381 ; CHECK-NEXT: adrp x8, .LCPI15_2
382 ; CHECK-NEXT: ldr q3, [x8, :lo12:.LCPI15_2]
383 ; CHECK-NEXT: adrp x8, .LCPI15_3
384 ; CHECK-NEXT: mul v0.4s, v0.4s, v1.4s
385 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI15_3]
386 ; CHECK-NEXT: ushl v2.4s, v0.4s, v2.4s
387 ; CHECK-NEXT: ushl v0.4s, v0.4s, v3.4s
388 ; CHECK-NEXT: orr v0.16b, v0.16b, v2.16b
389 ; CHECK-NEXT: cmhs v0.4s, v1.4s, v0.4s
390 ; CHECK-NEXT: movi v1.4s, #1
391 ; CHECK-NEXT: and v0.16b, v0.16b, v1.16b
393 %urem = urem <4 x i32> %X, <i32 5, i32 14, i32 2147483648, i32 100>
394 %cmp = icmp eq <4 x i32> %urem, <i32 0, i32 0, i32 0, i32 0>
395 %ret = zext <4 x i1> %cmp to <4 x i32>
399 ;==============================================================================;
401 ; One all-ones divisor and power-of-two divisor divisor in odd divisor
402 define <4 x i32> @test_urem_odd_allones_and_poweroftwo(<4 x i32> %X) nounwind {
403 ; CHECK-LABEL: test_urem_odd_allones_and_poweroftwo:
405 ; CHECK-NEXT: adrp x8, .LCPI16_0
406 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI16_0]
407 ; CHECK-NEXT: adrp x8, .LCPI16_1
408 ; CHECK-NEXT: ldr q2, [x8, :lo12:.LCPI16_1]
409 ; CHECK-NEXT: adrp x8, .LCPI16_2
410 ; CHECK-NEXT: ldr q3, [x8, :lo12:.LCPI16_2]
411 ; CHECK-NEXT: adrp x8, .LCPI16_3
412 ; CHECK-NEXT: mul v0.4s, v0.4s, v1.4s
413 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI16_3]
414 ; CHECK-NEXT: ushl v2.4s, v0.4s, v2.4s
415 ; CHECK-NEXT: ushl v0.4s, v0.4s, v3.4s
416 ; CHECK-NEXT: orr v0.16b, v0.16b, v2.16b
417 ; CHECK-NEXT: cmhs v0.4s, v1.4s, v0.4s
418 ; CHECK-NEXT: movi v1.4s, #1
419 ; CHECK-NEXT: and v0.16b, v0.16b, v1.16b
421 %urem = urem <4 x i32> %X, <i32 5, i32 4294967295, i32 16, i32 5>
422 %cmp = icmp eq <4 x i32> %urem, <i32 0, i32 0, i32 0, i32 0>
423 %ret = zext <4 x i1> %cmp to <4 x i32>
427 ; One all-ones divisor and power-of-two divisor divisor in even divisor
428 define <4 x i32> @test_urem_even_allones_and_poweroftwo(<4 x i32> %X) nounwind {
429 ; CHECK-LABEL: test_urem_even_allones_and_poweroftwo:
431 ; CHECK-NEXT: adrp x8, .LCPI17_0
432 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI17_0]
433 ; CHECK-NEXT: adrp x8, .LCPI17_1
434 ; CHECK-NEXT: ldr q2, [x8, :lo12:.LCPI17_1]
435 ; CHECK-NEXT: adrp x8, .LCPI17_2
436 ; CHECK-NEXT: ldr q3, [x8, :lo12:.LCPI17_2]
437 ; CHECK-NEXT: adrp x8, .LCPI17_3
438 ; CHECK-NEXT: mul v0.4s, v0.4s, v1.4s
439 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI17_3]
440 ; CHECK-NEXT: ushl v2.4s, v0.4s, v2.4s
441 ; CHECK-NEXT: ushl v0.4s, v0.4s, v3.4s
442 ; CHECK-NEXT: orr v0.16b, v0.16b, v2.16b
443 ; CHECK-NEXT: cmhs v0.4s, v1.4s, v0.4s
444 ; CHECK-NEXT: movi v1.4s, #1
445 ; CHECK-NEXT: and v0.16b, v0.16b, v1.16b
447 %urem = urem <4 x i32> %X, <i32 14, i32 4294967295, i32 16, i32 14>
448 %cmp = icmp eq <4 x i32> %urem, <i32 0, i32 0, i32 0, i32 0>
449 %ret = zext <4 x i1> %cmp to <4 x i32>
453 ; One all-ones divisor and power-of-two divisor divisor in odd+even divisor
454 define <4 x i32> @test_urem_odd_even_allones_and_poweroftwo(<4 x i32> %X) nounwind {
455 ; CHECK-LABEL: test_urem_odd_even_allones_and_poweroftwo:
457 ; CHECK-NEXT: adrp x8, .LCPI18_0
458 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI18_0]
459 ; CHECK-NEXT: adrp x8, .LCPI18_1
460 ; CHECK-NEXT: ldr q2, [x8, :lo12:.LCPI18_1]
461 ; CHECK-NEXT: adrp x8, .LCPI18_2
462 ; CHECK-NEXT: ldr q3, [x8, :lo12:.LCPI18_2]
463 ; CHECK-NEXT: adrp x8, .LCPI18_3
464 ; CHECK-NEXT: mul v0.4s, v0.4s, v1.4s
465 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI18_3]
466 ; CHECK-NEXT: ushl v2.4s, v0.4s, v2.4s
467 ; CHECK-NEXT: ushl v0.4s, v0.4s, v3.4s
468 ; CHECK-NEXT: orr v0.16b, v0.16b, v2.16b
469 ; CHECK-NEXT: cmhs v0.4s, v1.4s, v0.4s
470 ; CHECK-NEXT: movi v1.4s, #1
471 ; CHECK-NEXT: and v0.16b, v0.16b, v1.16b
473 %urem = urem <4 x i32> %X, <i32 5, i32 4294967295, i32 16, i32 100>
474 %cmp = icmp eq <4 x i32> %urem, <i32 0, i32 0, i32 0, i32 0>
475 %ret = zext <4 x i1> %cmp to <4 x i32>
479 ;------------------------------------------------------------------------------;
481 ; One all-ones divisor and one one divisor in odd divisor
482 define <4 x i32> @test_urem_odd_allones_and_one(<4 x i32> %X) nounwind {
483 ; CHECK-LABEL: test_urem_odd_allones_and_one:
485 ; CHECK-NEXT: adrp x8, .LCPI19_0
486 ; CHECK-NEXT: adrp x9, .LCPI19_1
487 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI19_0]
488 ; CHECK-NEXT: ldr q2, [x9, :lo12:.LCPI19_1]
489 ; CHECK-NEXT: mul v0.4s, v0.4s, v1.4s
490 ; CHECK-NEXT: cmhs v0.4s, v2.4s, v0.4s
491 ; CHECK-NEXT: movi v1.4s, #1
492 ; CHECK-NEXT: and v0.16b, v0.16b, v1.16b
494 %urem = urem <4 x i32> %X, <i32 5, i32 4294967295, i32 1, i32 5>
495 %cmp = icmp eq <4 x i32> %urem, <i32 0, i32 0, i32 0, i32 0>
496 %ret = zext <4 x i1> %cmp to <4 x i32>
500 ; One all-ones divisor and one one divisor in even divisor
501 define <4 x i32> @test_urem_even_allones_and_one(<4 x i32> %X) nounwind {
502 ; CHECK-LABEL: test_urem_even_allones_and_one:
504 ; CHECK-NEXT: adrp x8, .LCPI20_0
505 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI20_0]
506 ; CHECK-NEXT: adrp x8, .LCPI20_1
507 ; CHECK-NEXT: ldr q2, [x8, :lo12:.LCPI20_1]
508 ; CHECK-NEXT: adrp x8, .LCPI20_2
509 ; CHECK-NEXT: ldr q3, [x8, :lo12:.LCPI20_2]
510 ; CHECK-NEXT: adrp x8, .LCPI20_3
511 ; CHECK-NEXT: mul v0.4s, v0.4s, v1.4s
512 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI20_3]
513 ; CHECK-NEXT: ushl v2.4s, v0.4s, v2.4s
514 ; CHECK-NEXT: ushl v0.4s, v0.4s, v3.4s
515 ; CHECK-NEXT: orr v0.16b, v0.16b, v2.16b
516 ; CHECK-NEXT: cmhs v0.4s, v1.4s, v0.4s
517 ; CHECK-NEXT: movi v1.4s, #1
518 ; CHECK-NEXT: and v0.16b, v0.16b, v1.16b
520 %urem = urem <4 x i32> %X, <i32 14, i32 4294967295, i32 1, i32 14>
521 %cmp = icmp eq <4 x i32> %urem, <i32 0, i32 0, i32 0, i32 0>
522 %ret = zext <4 x i1> %cmp to <4 x i32>
526 ; One all-ones divisor and one one divisor in odd+even divisor
527 define <4 x i32> @test_urem_odd_even_allones_and_one(<4 x i32> %X) nounwind {
528 ; CHECK-LABEL: test_urem_odd_even_allones_and_one:
530 ; CHECK-NEXT: adrp x8, .LCPI21_0
531 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI21_0]
532 ; CHECK-NEXT: adrp x8, .LCPI21_1
533 ; CHECK-NEXT: ldr q2, [x8, :lo12:.LCPI21_1]
534 ; CHECK-NEXT: adrp x8, .LCPI21_2
535 ; CHECK-NEXT: ldr q3, [x8, :lo12:.LCPI21_2]
536 ; CHECK-NEXT: adrp x8, .LCPI21_3
537 ; CHECK-NEXT: mul v0.4s, v0.4s, v1.4s
538 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI21_3]
539 ; CHECK-NEXT: ushl v2.4s, v0.4s, v2.4s
540 ; CHECK-NEXT: ushl v0.4s, v0.4s, v3.4s
541 ; CHECK-NEXT: orr v0.16b, v0.16b, v2.16b
542 ; CHECK-NEXT: cmhs v0.4s, v1.4s, v0.4s
543 ; CHECK-NEXT: movi v1.4s, #1
544 ; CHECK-NEXT: and v0.16b, v0.16b, v1.16b
546 %urem = urem <4 x i32> %X, <i32 5, i32 4294967295, i32 1, i32 100>
547 %cmp = icmp eq <4 x i32> %urem, <i32 0, i32 0, i32 0, i32 0>
548 %ret = zext <4 x i1> %cmp to <4 x i32>
552 ;------------------------------------------------------------------------------;
554 ; One power-of-two divisor divisor and one divisor in odd divisor
555 define <4 x i32> @test_urem_odd_poweroftwo_and_one(<4 x i32> %X) nounwind {
556 ; CHECK-LABEL: test_urem_odd_poweroftwo_and_one:
558 ; CHECK-NEXT: adrp x8, .LCPI22_0
559 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI22_0]
560 ; CHECK-NEXT: adrp x8, .LCPI22_1
561 ; CHECK-NEXT: ldr q2, [x8, :lo12:.LCPI22_1]
562 ; CHECK-NEXT: adrp x8, .LCPI22_2
563 ; CHECK-NEXT: ldr q3, [x8, :lo12:.LCPI22_2]
564 ; CHECK-NEXT: adrp x8, .LCPI22_3
565 ; CHECK-NEXT: mul v0.4s, v0.4s, v1.4s
566 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI22_3]
567 ; CHECK-NEXT: ushl v2.4s, v0.4s, v2.4s
568 ; CHECK-NEXT: ushl v0.4s, v0.4s, v3.4s
569 ; CHECK-NEXT: orr v0.16b, v0.16b, v2.16b
570 ; CHECK-NEXT: cmhs v0.4s, v1.4s, v0.4s
571 ; CHECK-NEXT: movi v1.4s, #1
572 ; CHECK-NEXT: and v0.16b, v0.16b, v1.16b
574 %urem = urem <4 x i32> %X, <i32 5, i32 16, i32 1, i32 5>
575 %cmp = icmp eq <4 x i32> %urem, <i32 0, i32 0, i32 0, i32 0>
576 %ret = zext <4 x i1> %cmp to <4 x i32>
580 ; One power-of-two divisor divisor and one divisor in even divisor
581 define <4 x i32> @test_urem_even_poweroftwo_and_one(<4 x i32> %X) nounwind {
582 ; CHECK-LABEL: test_urem_even_poweroftwo_and_one:
584 ; CHECK-NEXT: adrp x8, .LCPI23_0
585 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI23_0]
586 ; CHECK-NEXT: adrp x8, .LCPI23_1
587 ; CHECK-NEXT: ldr q2, [x8, :lo12:.LCPI23_1]
588 ; CHECK-NEXT: adrp x8, .LCPI23_2
589 ; CHECK-NEXT: ldr q3, [x8, :lo12:.LCPI23_2]
590 ; CHECK-NEXT: adrp x8, .LCPI23_3
591 ; CHECK-NEXT: mul v0.4s, v0.4s, v1.4s
592 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI23_3]
593 ; CHECK-NEXT: ushl v2.4s, v0.4s, v2.4s
594 ; CHECK-NEXT: ushl v0.4s, v0.4s, v3.4s
595 ; CHECK-NEXT: orr v0.16b, v0.16b, v2.16b
596 ; CHECK-NEXT: cmhs v0.4s, v1.4s, v0.4s
597 ; CHECK-NEXT: movi v1.4s, #1
598 ; CHECK-NEXT: and v0.16b, v0.16b, v1.16b
600 %urem = urem <4 x i32> %X, <i32 14, i32 16, i32 1, i32 14>
601 %cmp = icmp eq <4 x i32> %urem, <i32 0, i32 0, i32 0, i32 0>
602 %ret = zext <4 x i1> %cmp to <4 x i32>
606 ; One power-of-two divisor divisor and one divisor in odd+even divisor
607 define <4 x i32> @test_urem_odd_even_poweroftwo_and_one(<4 x i32> %X) nounwind {
608 ; CHECK-LABEL: test_urem_odd_even_poweroftwo_and_one:
610 ; CHECK-NEXT: adrp x8, .LCPI24_0
611 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI24_0]
612 ; CHECK-NEXT: adrp x8, .LCPI24_1
613 ; CHECK-NEXT: ldr q2, [x8, :lo12:.LCPI24_1]
614 ; CHECK-NEXT: adrp x8, .LCPI24_2
615 ; CHECK-NEXT: ldr q3, [x8, :lo12:.LCPI24_2]
616 ; CHECK-NEXT: adrp x8, .LCPI24_3
617 ; CHECK-NEXT: mul v0.4s, v0.4s, v1.4s
618 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI24_3]
619 ; CHECK-NEXT: ushl v2.4s, v0.4s, v2.4s
620 ; CHECK-NEXT: ushl v0.4s, v0.4s, v3.4s
621 ; CHECK-NEXT: orr v0.16b, v0.16b, v2.16b
622 ; CHECK-NEXT: cmhs v0.4s, v1.4s, v0.4s
623 ; CHECK-NEXT: movi v1.4s, #1
624 ; CHECK-NEXT: and v0.16b, v0.16b, v1.16b
626 %urem = urem <4 x i32> %X, <i32 5, i32 16, i32 1, i32 100>
627 %cmp = icmp eq <4 x i32> %urem, <i32 0, i32 0, i32 0, i32 0>
628 %ret = zext <4 x i1> %cmp to <4 x i32>
632 ;------------------------------------------------------------------------------;
634 define <4 x i32> @test_urem_odd_allones_and_poweroftwo_and_one(<4 x i32> %X) nounwind {
635 ; CHECK-LABEL: test_urem_odd_allones_and_poweroftwo_and_one:
637 ; CHECK-NEXT: adrp x8, .LCPI25_0
638 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI25_0]
639 ; CHECK-NEXT: adrp x8, .LCPI25_1
640 ; CHECK-NEXT: ldr q2, [x8, :lo12:.LCPI25_1]
641 ; CHECK-NEXT: adrp x8, .LCPI25_2
642 ; CHECK-NEXT: ldr q3, [x8, :lo12:.LCPI25_2]
643 ; CHECK-NEXT: adrp x8, .LCPI25_3
644 ; CHECK-NEXT: mul v0.4s, v0.4s, v1.4s
645 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI25_3]
646 ; CHECK-NEXT: ushl v2.4s, v0.4s, v2.4s
647 ; CHECK-NEXT: ushl v0.4s, v0.4s, v3.4s
648 ; CHECK-NEXT: orr v0.16b, v0.16b, v2.16b
649 ; CHECK-NEXT: cmhs v0.4s, v1.4s, v0.4s
650 ; CHECK-NEXT: movi v1.4s, #1
651 ; CHECK-NEXT: and v0.16b, v0.16b, v1.16b
653 %urem = urem <4 x i32> %X, <i32 5, i32 4294967295, i32 16, i32 1>
654 %cmp = icmp eq <4 x i32> %urem, <i32 0, i32 0, i32 0, i32 0>
655 %ret = zext <4 x i1> %cmp to <4 x i32>
659 define <4 x i32> @test_urem_even_allones_and_poweroftwo_and_one(<4 x i32> %X) nounwind {
660 ; CHECK-LABEL: test_urem_even_allones_and_poweroftwo_and_one:
662 ; CHECK-NEXT: adrp x8, .LCPI26_0
663 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI26_0]
664 ; CHECK-NEXT: adrp x8, .LCPI26_1
665 ; CHECK-NEXT: ldr q2, [x8, :lo12:.LCPI26_1]
666 ; CHECK-NEXT: adrp x8, .LCPI26_2
667 ; CHECK-NEXT: ldr q3, [x8, :lo12:.LCPI26_2]
668 ; CHECK-NEXT: adrp x8, .LCPI26_3
669 ; CHECK-NEXT: mul v0.4s, v0.4s, v1.4s
670 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI26_3]
671 ; CHECK-NEXT: ushl v2.4s, v0.4s, v2.4s
672 ; CHECK-NEXT: ushl v0.4s, v0.4s, v3.4s
673 ; CHECK-NEXT: orr v0.16b, v0.16b, v2.16b
674 ; CHECK-NEXT: cmhs v0.4s, v1.4s, v0.4s
675 ; CHECK-NEXT: movi v1.4s, #1
676 ; CHECK-NEXT: and v0.16b, v0.16b, v1.16b
678 %urem = urem <4 x i32> %X, <i32 14, i32 4294967295, i32 16, i32 1>
679 %cmp = icmp eq <4 x i32> %urem, <i32 0, i32 0, i32 0, i32 0>
680 %ret = zext <4 x i1> %cmp to <4 x i32>