1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 < %s | FileCheck %s --check-prefixes=RV32
3 ; RUN: llc -mtriple=riscv64 < %s | FileCheck %s --check-prefixes=RV64
4 ; RUN: llc -mtriple=riscv32 -mattr=+m < %s | FileCheck %s --check-prefixes=RV32M
5 ; RUN: llc -mtriple=riscv64 -mattr=+m < %s | FileCheck %s --check-prefixes=RV64M
6 ; RUN: llc -mtriple=riscv32 -mattr=+m,+experimental-v -riscv-v-vector-bits-min=128 < %s | FileCheck %s --check-prefixes=RV32MV
7 ; RUN: llc -mtriple=riscv64 -mattr=+m,+experimental-v -riscv-v-vector-bits-min=128 < %s | FileCheck %s --check-prefixes=RV64MV
9 define i1 @test_srem_odd(i29 %X) nounwind {
10 ; RV32-LABEL: test_srem_odd:
12 ; RV32-NEXT: addi sp, sp, -16
13 ; RV32-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
14 ; RV32-NEXT: lui a1, 128424
15 ; RV32-NEXT: addi a1, a1, 331
16 ; RV32-NEXT: call __mulsi3@plt
17 ; RV32-NEXT: lui a1, 662
18 ; RV32-NEXT: addi a1, a1, -83
19 ; RV32-NEXT: add a0, a0, a1
20 ; RV32-NEXT: lui a1, 131072
21 ; RV32-NEXT: addi a1, a1, -1
22 ; RV32-NEXT: and a0, a0, a1
23 ; RV32-NEXT: lui a1, 1324
24 ; RV32-NEXT: addi a1, a1, -165
25 ; RV32-NEXT: sltu a0, a0, a1
26 ; RV32-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
27 ; RV32-NEXT: addi sp, sp, 16
30 ; RV64-LABEL: test_srem_odd:
32 ; RV64-NEXT: addi sp, sp, -16
33 ; RV64-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
34 ; RV64-NEXT: lui a1, 128424
35 ; RV64-NEXT: addiw a1, a1, 331
36 ; RV64-NEXT: call __muldi3@plt
37 ; RV64-NEXT: lui a1, 662
38 ; RV64-NEXT: addiw a1, a1, -83
39 ; RV64-NEXT: add a0, a0, a1
40 ; RV64-NEXT: lui a1, 131072
41 ; RV64-NEXT: addiw a1, a1, -1
42 ; RV64-NEXT: and a0, a0, a1
43 ; RV64-NEXT: lui a1, 1324
44 ; RV64-NEXT: addiw a1, a1, -165
45 ; RV64-NEXT: sltu a0, a0, a1
46 ; RV64-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
47 ; RV64-NEXT: addi sp, sp, 16
50 ; RV32M-LABEL: test_srem_odd:
52 ; RV32M-NEXT: lui a1, 128424
53 ; RV32M-NEXT: addi a1, a1, 331
54 ; RV32M-NEXT: mul a0, a0, a1
55 ; RV32M-NEXT: lui a1, 662
56 ; RV32M-NEXT: addi a1, a1, -83
57 ; RV32M-NEXT: add a0, a0, a1
58 ; RV32M-NEXT: lui a1, 131072
59 ; RV32M-NEXT: addi a1, a1, -1
60 ; RV32M-NEXT: and a0, a0, a1
61 ; RV32M-NEXT: lui a1, 1324
62 ; RV32M-NEXT: addi a1, a1, -165
63 ; RV32M-NEXT: sltu a0, a0, a1
66 ; RV64M-LABEL: test_srem_odd:
68 ; RV64M-NEXT: lui a1, 128424
69 ; RV64M-NEXT: addiw a1, a1, 331
70 ; RV64M-NEXT: mul a0, a0, a1
71 ; RV64M-NEXT: lui a1, 662
72 ; RV64M-NEXT: addiw a1, a1, -83
73 ; RV64M-NEXT: add a0, a0, a1
74 ; RV64M-NEXT: lui a1, 131072
75 ; RV64M-NEXT: addiw a1, a1, -1
76 ; RV64M-NEXT: and a0, a0, a1
77 ; RV64M-NEXT: lui a1, 1324
78 ; RV64M-NEXT: addiw a1, a1, -165
79 ; RV64M-NEXT: sltu a0, a0, a1
82 ; RV32MV-LABEL: test_srem_odd:
84 ; RV32MV-NEXT: lui a1, 128424
85 ; RV32MV-NEXT: addi a1, a1, 331
86 ; RV32MV-NEXT: mul a0, a0, a1
87 ; RV32MV-NEXT: lui a1, 662
88 ; RV32MV-NEXT: addi a1, a1, -83
89 ; RV32MV-NEXT: add a0, a0, a1
90 ; RV32MV-NEXT: lui a1, 131072
91 ; RV32MV-NEXT: addi a1, a1, -1
92 ; RV32MV-NEXT: and a0, a0, a1
93 ; RV32MV-NEXT: lui a1, 1324
94 ; RV32MV-NEXT: addi a1, a1, -165
95 ; RV32MV-NEXT: sltu a0, a0, a1
98 ; RV64MV-LABEL: test_srem_odd:
100 ; RV64MV-NEXT: lui a1, 128424
101 ; RV64MV-NEXT: addiw a1, a1, 331
102 ; RV64MV-NEXT: mul a0, a0, a1
103 ; RV64MV-NEXT: lui a1, 662
104 ; RV64MV-NEXT: addiw a1, a1, -83
105 ; RV64MV-NEXT: add a0, a0, a1
106 ; RV64MV-NEXT: lui a1, 131072
107 ; RV64MV-NEXT: addiw a1, a1, -1
108 ; RV64MV-NEXT: and a0, a0, a1
109 ; RV64MV-NEXT: lui a1, 1324
110 ; RV64MV-NEXT: addiw a1, a1, -165
111 ; RV64MV-NEXT: sltu a0, a0, a1
113 %srem = srem i29 %X, 99
114 %cmp = icmp eq i29 %srem, 0
118 define i1 @test_srem_even(i4 %X) nounwind {
119 ; RV32-LABEL: test_srem_even:
121 ; RV32-NEXT: addi sp, sp, -16
122 ; RV32-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
123 ; RV32-NEXT: slli a0, a0, 28
124 ; RV32-NEXT: srai a0, a0, 28
125 ; RV32-NEXT: addi a1, zero, 6
126 ; RV32-NEXT: call __modsi3@plt
127 ; RV32-NEXT: addi a0, a0, -1
128 ; RV32-NEXT: seqz a0, a0
129 ; RV32-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
130 ; RV32-NEXT: addi sp, sp, 16
133 ; RV64-LABEL: test_srem_even:
135 ; RV64-NEXT: addi sp, sp, -16
136 ; RV64-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
137 ; RV64-NEXT: slli a0, a0, 60
138 ; RV64-NEXT: srai a0, a0, 60
139 ; RV64-NEXT: addi a1, zero, 6
140 ; RV64-NEXT: call __moddi3@plt
141 ; RV64-NEXT: addi a0, a0, -1
142 ; RV64-NEXT: seqz a0, a0
143 ; RV64-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
144 ; RV64-NEXT: addi sp, sp, 16
147 ; RV32M-LABEL: test_srem_even:
149 ; RV32M-NEXT: slli a0, a0, 28
150 ; RV32M-NEXT: srai a0, a0, 28
151 ; RV32M-NEXT: lui a1, 174763
152 ; RV32M-NEXT: addi a1, a1, -1365
153 ; RV32M-NEXT: mulh a1, a0, a1
154 ; RV32M-NEXT: srli a2, a1, 31
155 ; RV32M-NEXT: add a1, a1, a2
156 ; RV32M-NEXT: addi a2, zero, 6
157 ; RV32M-NEXT: mul a1, a1, a2
158 ; RV32M-NEXT: sub a0, a0, a1
159 ; RV32M-NEXT: addi a0, a0, -1
160 ; RV32M-NEXT: seqz a0, a0
163 ; RV64M-LABEL: test_srem_even:
165 ; RV64M-NEXT: slli a0, a0, 60
166 ; RV64M-NEXT: srai a0, a0, 60
167 ; RV64M-NEXT: lui a1, 10923
168 ; RV64M-NEXT: addiw a1, a1, -1365
169 ; RV64M-NEXT: slli a1, a1, 12
170 ; RV64M-NEXT: addi a1, a1, -1365
171 ; RV64M-NEXT: slli a1, a1, 12
172 ; RV64M-NEXT: addi a1, a1, -1365
173 ; RV64M-NEXT: slli a1, a1, 12
174 ; RV64M-NEXT: addi a1, a1, -1365
175 ; RV64M-NEXT: mulh a1, a0, a1
176 ; RV64M-NEXT: srli a2, a1, 63
177 ; RV64M-NEXT: add a1, a1, a2
178 ; RV64M-NEXT: addi a2, zero, 6
179 ; RV64M-NEXT: mul a1, a1, a2
180 ; RV64M-NEXT: sub a0, a0, a1
181 ; RV64M-NEXT: addi a0, a0, -1
182 ; RV64M-NEXT: seqz a0, a0
185 ; RV32MV-LABEL: test_srem_even:
187 ; RV32MV-NEXT: slli a0, a0, 28
188 ; RV32MV-NEXT: srai a0, a0, 28
189 ; RV32MV-NEXT: lui a1, 174763
190 ; RV32MV-NEXT: addi a1, a1, -1365
191 ; RV32MV-NEXT: mulh a1, a0, a1
192 ; RV32MV-NEXT: srli a2, a1, 31
193 ; RV32MV-NEXT: add a1, a1, a2
194 ; RV32MV-NEXT: addi a2, zero, 6
195 ; RV32MV-NEXT: mul a1, a1, a2
196 ; RV32MV-NEXT: sub a0, a0, a1
197 ; RV32MV-NEXT: addi a0, a0, -1
198 ; RV32MV-NEXT: seqz a0, a0
201 ; RV64MV-LABEL: test_srem_even:
203 ; RV64MV-NEXT: slli a0, a0, 60
204 ; RV64MV-NEXT: srai a0, a0, 60
205 ; RV64MV-NEXT: lui a1, 10923
206 ; RV64MV-NEXT: addiw a1, a1, -1365
207 ; RV64MV-NEXT: slli a1, a1, 12
208 ; RV64MV-NEXT: addi a1, a1, -1365
209 ; RV64MV-NEXT: slli a1, a1, 12
210 ; RV64MV-NEXT: addi a1, a1, -1365
211 ; RV64MV-NEXT: slli a1, a1, 12
212 ; RV64MV-NEXT: addi a1, a1, -1365
213 ; RV64MV-NEXT: mulh a1, a0, a1
214 ; RV64MV-NEXT: srli a2, a1, 63
215 ; RV64MV-NEXT: add a1, a1, a2
216 ; RV64MV-NEXT: addi a2, zero, 6
217 ; RV64MV-NEXT: mul a1, a1, a2
218 ; RV64MV-NEXT: sub a0, a0, a1
219 ; RV64MV-NEXT: addi a0, a0, -1
220 ; RV64MV-NEXT: seqz a0, a0
222 %srem = srem i4 %X, 6
223 %cmp = icmp eq i4 %srem, 1
227 define i1 @test_srem_pow2_setne(i6 %X) nounwind {
228 ; RV32-LABEL: test_srem_pow2_setne:
230 ; RV32-NEXT: slli a1, a0, 26
231 ; RV32-NEXT: srai a1, a1, 26
232 ; RV32-NEXT: srli a1, a1, 9
233 ; RV32-NEXT: andi a1, a1, 3
234 ; RV32-NEXT: add a1, a0, a1
235 ; RV32-NEXT: andi a1, a1, 60
236 ; RV32-NEXT: sub a0, a0, a1
237 ; RV32-NEXT: andi a0, a0, 63
238 ; RV32-NEXT: snez a0, a0
241 ; RV64-LABEL: test_srem_pow2_setne:
243 ; RV64-NEXT: slli a1, a0, 58
244 ; RV64-NEXT: srai a1, a1, 58
245 ; RV64-NEXT: srli a1, a1, 9
246 ; RV64-NEXT: andi a1, a1, 3
247 ; RV64-NEXT: add a1, a0, a1
248 ; RV64-NEXT: andi a1, a1, 60
249 ; RV64-NEXT: sub a0, a0, a1
250 ; RV64-NEXT: andi a0, a0, 63
251 ; RV64-NEXT: snez a0, a0
254 ; RV32M-LABEL: test_srem_pow2_setne:
256 ; RV32M-NEXT: slli a1, a0, 26
257 ; RV32M-NEXT: srai a1, a1, 26
258 ; RV32M-NEXT: srli a1, a1, 9
259 ; RV32M-NEXT: andi a1, a1, 3
260 ; RV32M-NEXT: add a1, a0, a1
261 ; RV32M-NEXT: andi a1, a1, 60
262 ; RV32M-NEXT: sub a0, a0, a1
263 ; RV32M-NEXT: andi a0, a0, 63
264 ; RV32M-NEXT: snez a0, a0
267 ; RV64M-LABEL: test_srem_pow2_setne:
269 ; RV64M-NEXT: slli a1, a0, 58
270 ; RV64M-NEXT: srai a1, a1, 58
271 ; RV64M-NEXT: srli a1, a1, 9
272 ; RV64M-NEXT: andi a1, a1, 3
273 ; RV64M-NEXT: add a1, a0, a1
274 ; RV64M-NEXT: andi a1, a1, 60
275 ; RV64M-NEXT: sub a0, a0, a1
276 ; RV64M-NEXT: andi a0, a0, 63
277 ; RV64M-NEXT: snez a0, a0
280 ; RV32MV-LABEL: test_srem_pow2_setne:
282 ; RV32MV-NEXT: slli a1, a0, 26
283 ; RV32MV-NEXT: srai a1, a1, 26
284 ; RV32MV-NEXT: srli a1, a1, 9
285 ; RV32MV-NEXT: andi a1, a1, 3
286 ; RV32MV-NEXT: add a1, a0, a1
287 ; RV32MV-NEXT: andi a1, a1, 60
288 ; RV32MV-NEXT: sub a0, a0, a1
289 ; RV32MV-NEXT: andi a0, a0, 63
290 ; RV32MV-NEXT: snez a0, a0
293 ; RV64MV-LABEL: test_srem_pow2_setne:
295 ; RV64MV-NEXT: slli a1, a0, 58
296 ; RV64MV-NEXT: srai a1, a1, 58
297 ; RV64MV-NEXT: srli a1, a1, 9
298 ; RV64MV-NEXT: andi a1, a1, 3
299 ; RV64MV-NEXT: add a1, a0, a1
300 ; RV64MV-NEXT: andi a1, a1, 60
301 ; RV64MV-NEXT: sub a0, a0, a1
302 ; RV64MV-NEXT: andi a0, a0, 63
303 ; RV64MV-NEXT: snez a0, a0
305 %srem = srem i6 %X, 4
306 %cmp = icmp ne i6 %srem, 0
310 define void @test_srem_vec(<3 x i33>* %X) nounwind {
311 ; RV32-LABEL: test_srem_vec:
313 ; RV32-NEXT: addi sp, sp, -32
314 ; RV32-NEXT: sw ra, 28(sp) # 4-byte Folded Spill
315 ; RV32-NEXT: sw s0, 24(sp) # 4-byte Folded Spill
316 ; RV32-NEXT: sw s1, 20(sp) # 4-byte Folded Spill
317 ; RV32-NEXT: sw s2, 16(sp) # 4-byte Folded Spill
318 ; RV32-NEXT: sw s3, 12(sp) # 4-byte Folded Spill
319 ; RV32-NEXT: sw s4, 8(sp) # 4-byte Folded Spill
320 ; RV32-NEXT: sw s5, 4(sp) # 4-byte Folded Spill
321 ; RV32-NEXT: sw s6, 0(sp) # 4-byte Folded Spill
322 ; RV32-NEXT: mv s0, a0
323 ; RV32-NEXT: lw a0, 4(a0)
324 ; RV32-NEXT: lbu a1, 12(s0)
325 ; RV32-NEXT: lw a2, 8(s0)
326 ; RV32-NEXT: andi a3, a0, 1
327 ; RV32-NEXT: neg s2, a3
328 ; RV32-NEXT: slli a3, a1, 30
329 ; RV32-NEXT: srli a4, a2, 2
330 ; RV32-NEXT: or s3, a4, a3
331 ; RV32-NEXT: srli a1, a1, 2
332 ; RV32-NEXT: andi a1, a1, 1
333 ; RV32-NEXT: neg s1, a1
334 ; RV32-NEXT: slli a1, a2, 31
335 ; RV32-NEXT: srli a0, a0, 1
336 ; RV32-NEXT: or a0, a0, a1
337 ; RV32-NEXT: lw s4, 0(s0)
338 ; RV32-NEXT: srli a1, a2, 1
339 ; RV32-NEXT: andi a1, a1, 1
340 ; RV32-NEXT: neg a1, a1
341 ; RV32-NEXT: addi a2, zero, 7
342 ; RV32-NEXT: mv a3, zero
343 ; RV32-NEXT: call __moddi3@plt
344 ; RV32-NEXT: mv s5, a0
345 ; RV32-NEXT: mv s6, a1
346 ; RV32-NEXT: addi a2, zero, -5
347 ; RV32-NEXT: addi a3, zero, -1
348 ; RV32-NEXT: mv a0, s3
349 ; RV32-NEXT: mv a1, s1
350 ; RV32-NEXT: call __moddi3@plt
351 ; RV32-NEXT: mv s1, a0
352 ; RV32-NEXT: mv s3, a1
353 ; RV32-NEXT: addi a2, zero, 6
354 ; RV32-NEXT: mv a0, s4
355 ; RV32-NEXT: mv a1, s2
356 ; RV32-NEXT: mv a3, zero
357 ; RV32-NEXT: call __moddi3@plt
358 ; RV32-NEXT: xori a2, s1, 2
359 ; RV32-NEXT: or a2, a2, s3
360 ; RV32-NEXT: snez a2, a2
361 ; RV32-NEXT: xori a3, s5, 1
362 ; RV32-NEXT: or a3, a3, s6
363 ; RV32-NEXT: snez a3, a3
364 ; RV32-NEXT: or a0, a0, a1
365 ; RV32-NEXT: snez a0, a0
366 ; RV32-NEXT: neg a1, a3
367 ; RV32-NEXT: neg a4, a2
368 ; RV32-NEXT: neg a5, a0
369 ; RV32-NEXT: sw a5, 0(s0)
370 ; RV32-NEXT: slli a3, a3, 1
371 ; RV32-NEXT: sub a0, a0, a3
372 ; RV32-NEXT: sw a0, 4(s0)
373 ; RV32-NEXT: slli a0, a2, 2
374 ; RV32-NEXT: srli a2, a4, 30
375 ; RV32-NEXT: sub a2, a2, a0
376 ; RV32-NEXT: andi a2, a2, 7
377 ; RV32-NEXT: sb a2, 12(s0)
378 ; RV32-NEXT: srli a2, a1, 31
379 ; RV32-NEXT: andi a1, a1, 1
380 ; RV32-NEXT: slli a1, a1, 1
381 ; RV32-NEXT: or a1, a2, a1
382 ; RV32-NEXT: sub a0, a1, a0
383 ; RV32-NEXT: sw a0, 8(s0)
384 ; RV32-NEXT: lw s6, 0(sp) # 4-byte Folded Reload
385 ; RV32-NEXT: lw s5, 4(sp) # 4-byte Folded Reload
386 ; RV32-NEXT: lw s4, 8(sp) # 4-byte Folded Reload
387 ; RV32-NEXT: lw s3, 12(sp) # 4-byte Folded Reload
388 ; RV32-NEXT: lw s2, 16(sp) # 4-byte Folded Reload
389 ; RV32-NEXT: lw s1, 20(sp) # 4-byte Folded Reload
390 ; RV32-NEXT: lw s0, 24(sp) # 4-byte Folded Reload
391 ; RV32-NEXT: lw ra, 28(sp) # 4-byte Folded Reload
392 ; RV32-NEXT: addi sp, sp, 32
395 ; RV64-LABEL: test_srem_vec:
397 ; RV64-NEXT: addi sp, sp, -64
398 ; RV64-NEXT: sd ra, 56(sp) # 8-byte Folded Spill
399 ; RV64-NEXT: sd s0, 48(sp) # 8-byte Folded Spill
400 ; RV64-NEXT: sd s1, 40(sp) # 8-byte Folded Spill
401 ; RV64-NEXT: sd s2, 32(sp) # 8-byte Folded Spill
402 ; RV64-NEXT: sd s3, 24(sp) # 8-byte Folded Spill
403 ; RV64-NEXT: sd s4, 16(sp) # 8-byte Folded Spill
404 ; RV64-NEXT: sd s5, 8(sp) # 8-byte Folded Spill
405 ; RV64-NEXT: mv s0, a0
406 ; RV64-NEXT: lb a0, 12(a0)
407 ; RV64-NEXT: lwu a1, 8(s0)
408 ; RV64-NEXT: slli a0, a0, 32
409 ; RV64-NEXT: or a0, a1, a0
410 ; RV64-NEXT: addi s4, zero, -1
411 ; RV64-NEXT: srli a1, s4, 24
412 ; RV64-NEXT: and a0, a0, a1
413 ; RV64-NEXT: ld a1, 0(s0)
414 ; RV64-NEXT: slli a2, a0, 29
415 ; RV64-NEXT: srai s1, a2, 31
416 ; RV64-NEXT: slli a0, a0, 31
417 ; RV64-NEXT: srli a2, a1, 33
418 ; RV64-NEXT: or a0, a2, a0
419 ; RV64-NEXT: slli a0, a0, 31
420 ; RV64-NEXT: srai a0, a0, 31
421 ; RV64-NEXT: slli a1, a1, 31
422 ; RV64-NEXT: srai s2, a1, 31
423 ; RV64-NEXT: addi a1, zero, 7
424 ; RV64-NEXT: addi s5, zero, 7
425 ; RV64-NEXT: call __moddi3@plt
426 ; RV64-NEXT: mv s3, a0
427 ; RV64-NEXT: addi a1, zero, -5
428 ; RV64-NEXT: mv a0, s1
429 ; RV64-NEXT: call __moddi3@plt
430 ; RV64-NEXT: mv s1, a0
431 ; RV64-NEXT: lui a0, 1026731
432 ; RV64-NEXT: addiw a0, a0, -1365
433 ; RV64-NEXT: slli a0, a0, 12
434 ; RV64-NEXT: addi a0, a0, -1365
435 ; RV64-NEXT: slli a0, a0, 12
436 ; RV64-NEXT: addi a0, a0, -1365
437 ; RV64-NEXT: slli a0, a0, 12
438 ; RV64-NEXT: addi a1, a0, -1365
439 ; RV64-NEXT: mv a0, s2
440 ; RV64-NEXT: call __muldi3@plt
441 ; RV64-NEXT: lui a1, 10923
442 ; RV64-NEXT: addiw a1, a1, -1365
443 ; RV64-NEXT: slli a1, a1, 12
444 ; RV64-NEXT: addi a1, a1, -1365
445 ; RV64-NEXT: slli a1, a1, 12
446 ; RV64-NEXT: addi a1, a1, -1365
447 ; RV64-NEXT: slli a1, a1, 12
448 ; RV64-NEXT: addi a1, a1, -1366
449 ; RV64-NEXT: add a0, a0, a1
450 ; RV64-NEXT: slli a2, a0, 63
451 ; RV64-NEXT: srli a0, a0, 1
452 ; RV64-NEXT: or a0, a0, a2
453 ; RV64-NEXT: sltu a0, a1, a0
454 ; RV64-NEXT: addi a1, s1, -2
455 ; RV64-NEXT: snez a1, a1
456 ; RV64-NEXT: addi a2, s3, -1
457 ; RV64-NEXT: snez a2, a2
458 ; RV64-NEXT: neg a0, a0
459 ; RV64-NEXT: neg a2, a2
460 ; RV64-NEXT: neg a3, a1
461 ; RV64-NEXT: slli a4, s5, 32
462 ; RV64-NEXT: and a3, a3, a4
463 ; RV64-NEXT: srli a3, a3, 32
464 ; RV64-NEXT: sb a3, 12(s0)
465 ; RV64-NEXT: slliw a1, a1, 2
466 ; RV64-NEXT: srli a3, s4, 31
467 ; RV64-NEXT: and a2, a2, a3
468 ; RV64-NEXT: srli a4, a2, 31
469 ; RV64-NEXT: subw a1, a4, a1
470 ; RV64-NEXT: sw a1, 8(s0)
471 ; RV64-NEXT: and a0, a0, a3
472 ; RV64-NEXT: slli a1, a2, 33
473 ; RV64-NEXT: or a0, a0, a1
474 ; RV64-NEXT: sd a0, 0(s0)
475 ; RV64-NEXT: ld s5, 8(sp) # 8-byte Folded Reload
476 ; RV64-NEXT: ld s4, 16(sp) # 8-byte Folded Reload
477 ; RV64-NEXT: ld s3, 24(sp) # 8-byte Folded Reload
478 ; RV64-NEXT: ld s2, 32(sp) # 8-byte Folded Reload
479 ; RV64-NEXT: ld s1, 40(sp) # 8-byte Folded Reload
480 ; RV64-NEXT: ld s0, 48(sp) # 8-byte Folded Reload
481 ; RV64-NEXT: ld ra, 56(sp) # 8-byte Folded Reload
482 ; RV64-NEXT: addi sp, sp, 64
485 ; RV32M-LABEL: test_srem_vec:
487 ; RV32M-NEXT: addi sp, sp, -32
488 ; RV32M-NEXT: sw ra, 28(sp) # 4-byte Folded Spill
489 ; RV32M-NEXT: sw s0, 24(sp) # 4-byte Folded Spill
490 ; RV32M-NEXT: sw s1, 20(sp) # 4-byte Folded Spill
491 ; RV32M-NEXT: sw s2, 16(sp) # 4-byte Folded Spill
492 ; RV32M-NEXT: sw s3, 12(sp) # 4-byte Folded Spill
493 ; RV32M-NEXT: sw s4, 8(sp) # 4-byte Folded Spill
494 ; RV32M-NEXT: sw s5, 4(sp) # 4-byte Folded Spill
495 ; RV32M-NEXT: sw s6, 0(sp) # 4-byte Folded Spill
496 ; RV32M-NEXT: mv s0, a0
497 ; RV32M-NEXT: lw a0, 4(a0)
498 ; RV32M-NEXT: lbu a1, 12(s0)
499 ; RV32M-NEXT: lw a2, 8(s0)
500 ; RV32M-NEXT: andi a3, a0, 1
501 ; RV32M-NEXT: neg s2, a3
502 ; RV32M-NEXT: slli a3, a1, 30
503 ; RV32M-NEXT: srli a4, a2, 2
504 ; RV32M-NEXT: or s3, a4, a3
505 ; RV32M-NEXT: srli a1, a1, 2
506 ; RV32M-NEXT: andi a1, a1, 1
507 ; RV32M-NEXT: neg s1, a1
508 ; RV32M-NEXT: slli a1, a2, 31
509 ; RV32M-NEXT: srli a0, a0, 1
510 ; RV32M-NEXT: or a0, a0, a1
511 ; RV32M-NEXT: lw s4, 0(s0)
512 ; RV32M-NEXT: srli a1, a2, 1
513 ; RV32M-NEXT: andi a1, a1, 1
514 ; RV32M-NEXT: neg a1, a1
515 ; RV32M-NEXT: addi a2, zero, 7
516 ; RV32M-NEXT: mv a3, zero
517 ; RV32M-NEXT: call __moddi3@plt
518 ; RV32M-NEXT: mv s5, a0
519 ; RV32M-NEXT: mv s6, a1
520 ; RV32M-NEXT: addi a2, zero, -5
521 ; RV32M-NEXT: addi a3, zero, -1
522 ; RV32M-NEXT: mv a0, s3
523 ; RV32M-NEXT: mv a1, s1
524 ; RV32M-NEXT: call __moddi3@plt
525 ; RV32M-NEXT: mv s1, a0
526 ; RV32M-NEXT: mv s3, a1
527 ; RV32M-NEXT: addi a2, zero, 6
528 ; RV32M-NEXT: mv a0, s4
529 ; RV32M-NEXT: mv a1, s2
530 ; RV32M-NEXT: mv a3, zero
531 ; RV32M-NEXT: call __moddi3@plt
532 ; RV32M-NEXT: xori a2, s1, 2
533 ; RV32M-NEXT: or a2, a2, s3
534 ; RV32M-NEXT: snez a2, a2
535 ; RV32M-NEXT: xori a3, s5, 1
536 ; RV32M-NEXT: or a3, a3, s6
537 ; RV32M-NEXT: snez a3, a3
538 ; RV32M-NEXT: or a0, a0, a1
539 ; RV32M-NEXT: snez a0, a0
540 ; RV32M-NEXT: neg a1, a3
541 ; RV32M-NEXT: neg a4, a2
542 ; RV32M-NEXT: neg a5, a0
543 ; RV32M-NEXT: sw a5, 0(s0)
544 ; RV32M-NEXT: slli a3, a3, 1
545 ; RV32M-NEXT: sub a0, a0, a3
546 ; RV32M-NEXT: sw a0, 4(s0)
547 ; RV32M-NEXT: slli a0, a2, 2
548 ; RV32M-NEXT: srli a2, a4, 30
549 ; RV32M-NEXT: sub a2, a2, a0
550 ; RV32M-NEXT: andi a2, a2, 7
551 ; RV32M-NEXT: sb a2, 12(s0)
552 ; RV32M-NEXT: srli a2, a1, 31
553 ; RV32M-NEXT: andi a1, a1, 1
554 ; RV32M-NEXT: slli a1, a1, 1
555 ; RV32M-NEXT: or a1, a2, a1
556 ; RV32M-NEXT: sub a0, a1, a0
557 ; RV32M-NEXT: sw a0, 8(s0)
558 ; RV32M-NEXT: lw s6, 0(sp) # 4-byte Folded Reload
559 ; RV32M-NEXT: lw s5, 4(sp) # 4-byte Folded Reload
560 ; RV32M-NEXT: lw s4, 8(sp) # 4-byte Folded Reload
561 ; RV32M-NEXT: lw s3, 12(sp) # 4-byte Folded Reload
562 ; RV32M-NEXT: lw s2, 16(sp) # 4-byte Folded Reload
563 ; RV32M-NEXT: lw s1, 20(sp) # 4-byte Folded Reload
564 ; RV32M-NEXT: lw s0, 24(sp) # 4-byte Folded Reload
565 ; RV32M-NEXT: lw ra, 28(sp) # 4-byte Folded Reload
566 ; RV32M-NEXT: addi sp, sp, 32
569 ; RV64M-LABEL: test_srem_vec:
571 ; RV64M-NEXT: lb a1, 12(a0)
572 ; RV64M-NEXT: lwu a2, 8(a0)
573 ; RV64M-NEXT: slli a1, a1, 32
574 ; RV64M-NEXT: or a2, a2, a1
575 ; RV64M-NEXT: addi a6, zero, -1
576 ; RV64M-NEXT: srli a3, a6, 24
577 ; RV64M-NEXT: and a2, a2, a3
578 ; RV64M-NEXT: ld a3, 0(a0)
579 ; RV64M-NEXT: slli a4, a2, 29
580 ; RV64M-NEXT: srai a4, a4, 31
581 ; RV64M-NEXT: slli a2, a2, 31
582 ; RV64M-NEXT: srli a5, a3, 33
583 ; RV64M-NEXT: or a2, a5, a2
584 ; RV64M-NEXT: slli a2, a2, 31
585 ; RV64M-NEXT: srai a2, a2, 31
586 ; RV64M-NEXT: slli a3, a3, 31
587 ; RV64M-NEXT: srai a3, a3, 31
588 ; RV64M-NEXT: lui a5, 18725
589 ; RV64M-NEXT: addiw a5, a5, -1755
590 ; RV64M-NEXT: slli a5, a5, 12
591 ; RV64M-NEXT: addi a5, a5, -1755
592 ; RV64M-NEXT: slli a5, a5, 12
593 ; RV64M-NEXT: addi a5, a5, -1755
594 ; RV64M-NEXT: slli a5, a5, 12
595 ; RV64M-NEXT: addi a5, a5, -1755
596 ; RV64M-NEXT: mulh a5, a2, a5
597 ; RV64M-NEXT: srli a1, a5, 63
598 ; RV64M-NEXT: srai a5, a5, 1
599 ; RV64M-NEXT: add a1, a5, a1
600 ; RV64M-NEXT: slli a5, a1, 3
601 ; RV64M-NEXT: sub a1, a1, a5
602 ; RV64M-NEXT: add a1, a2, a1
603 ; RV64M-NEXT: lui a2, 1035469
604 ; RV64M-NEXT: addiw a2, a2, -819
605 ; RV64M-NEXT: slli a2, a2, 12
606 ; RV64M-NEXT: addi a2, a2, -819
607 ; RV64M-NEXT: slli a2, a2, 12
608 ; RV64M-NEXT: addi a2, a2, -819
609 ; RV64M-NEXT: slli a2, a2, 13
610 ; RV64M-NEXT: addi a2, a2, -1639
611 ; RV64M-NEXT: mulh a2, a4, a2
612 ; RV64M-NEXT: srli a5, a2, 63
613 ; RV64M-NEXT: srai a2, a2, 1
614 ; RV64M-NEXT: add a2, a2, a5
615 ; RV64M-NEXT: slli a5, a2, 2
616 ; RV64M-NEXT: add a2, a5, a2
617 ; RV64M-NEXT: add a2, a4, a2
618 ; RV64M-NEXT: addi a2, a2, -2
619 ; RV64M-NEXT: snez a2, a2
620 ; RV64M-NEXT: addi a1, a1, -1
621 ; RV64M-NEXT: snez a1, a1
622 ; RV64M-NEXT: lui a4, 1026731
623 ; RV64M-NEXT: addiw a4, a4, -1365
624 ; RV64M-NEXT: slli a4, a4, 12
625 ; RV64M-NEXT: addi a4, a4, -1365
626 ; RV64M-NEXT: slli a4, a4, 12
627 ; RV64M-NEXT: addi a4, a4, -1365
628 ; RV64M-NEXT: slli a4, a4, 12
629 ; RV64M-NEXT: addi a4, a4, -1365
630 ; RV64M-NEXT: mul a3, a3, a4
631 ; RV64M-NEXT: lui a4, 10923
632 ; RV64M-NEXT: addiw a4, a4, -1365
633 ; RV64M-NEXT: slli a4, a4, 12
634 ; RV64M-NEXT: addi a4, a4, -1365
635 ; RV64M-NEXT: slli a4, a4, 12
636 ; RV64M-NEXT: addi a4, a4, -1365
637 ; RV64M-NEXT: slli a4, a4, 12
638 ; RV64M-NEXT: addi a4, a4, -1366
639 ; RV64M-NEXT: add a3, a3, a4
640 ; RV64M-NEXT: slli a5, a3, 63
641 ; RV64M-NEXT: srli a3, a3, 1
642 ; RV64M-NEXT: or a3, a3, a5
643 ; RV64M-NEXT: sltu a3, a4, a3
644 ; RV64M-NEXT: neg a1, a1
645 ; RV64M-NEXT: neg a4, a2
646 ; RV64M-NEXT: neg a3, a3
647 ; RV64M-NEXT: addi a5, zero, 7
648 ; RV64M-NEXT: slli a5, a5, 32
649 ; RV64M-NEXT: and a4, a4, a5
650 ; RV64M-NEXT: srli a4, a4, 32
651 ; RV64M-NEXT: sb a4, 12(a0)
652 ; RV64M-NEXT: slliw a2, a2, 2
653 ; RV64M-NEXT: srli a4, a6, 31
654 ; RV64M-NEXT: and a1, a1, a4
655 ; RV64M-NEXT: srli a5, a1, 31
656 ; RV64M-NEXT: subw a2, a5, a2
657 ; RV64M-NEXT: sw a2, 8(a0)
658 ; RV64M-NEXT: slli a1, a1, 33
659 ; RV64M-NEXT: and a2, a3, a4
660 ; RV64M-NEXT: or a1, a2, a1
661 ; RV64M-NEXT: sd a1, 0(a0)
664 ; RV32MV-LABEL: test_srem_vec:
666 ; RV32MV-NEXT: addi sp, sp, -96
667 ; RV32MV-NEXT: sw ra, 92(sp) # 4-byte Folded Spill
668 ; RV32MV-NEXT: sw s0, 88(sp) # 4-byte Folded Spill
669 ; RV32MV-NEXT: sw s1, 84(sp) # 4-byte Folded Spill
670 ; RV32MV-NEXT: sw s2, 80(sp) # 4-byte Folded Spill
671 ; RV32MV-NEXT: sw s3, 76(sp) # 4-byte Folded Spill
672 ; RV32MV-NEXT: sw s4, 72(sp) # 4-byte Folded Spill
673 ; RV32MV-NEXT: sw s5, 68(sp) # 4-byte Folded Spill
674 ; RV32MV-NEXT: addi s0, sp, 96
675 ; RV32MV-NEXT: andi sp, sp, -32
676 ; RV32MV-NEXT: mv s1, a0
677 ; RV32MV-NEXT: lw a0, 8(a0)
678 ; RV32MV-NEXT: lw a1, 4(s1)
679 ; RV32MV-NEXT: slli a2, a0, 31
680 ; RV32MV-NEXT: srli a3, a1, 1
681 ; RV32MV-NEXT: or s2, a3, a2
682 ; RV32MV-NEXT: lbu a2, 12(s1)
683 ; RV32MV-NEXT: srli a3, a0, 1
684 ; RV32MV-NEXT: andi a3, a3, 1
685 ; RV32MV-NEXT: neg s3, a3
686 ; RV32MV-NEXT: slli a3, a2, 30
687 ; RV32MV-NEXT: srli a0, a0, 2
688 ; RV32MV-NEXT: or s4, a0, a3
689 ; RV32MV-NEXT: srli a0, a2, 2
690 ; RV32MV-NEXT: andi a2, a0, 1
691 ; RV32MV-NEXT: lw a0, 0(s1)
692 ; RV32MV-NEXT: neg s5, a2
693 ; RV32MV-NEXT: andi a1, a1, 1
694 ; RV32MV-NEXT: neg a1, a1
695 ; RV32MV-NEXT: addi a2, zero, 6
696 ; RV32MV-NEXT: mv a3, zero
697 ; RV32MV-NEXT: call __moddi3@plt
698 ; RV32MV-NEXT: sw a1, 36(sp)
699 ; RV32MV-NEXT: sw a0, 32(sp)
700 ; RV32MV-NEXT: addi a2, zero, -5
701 ; RV32MV-NEXT: addi a3, zero, -1
702 ; RV32MV-NEXT: mv a0, s4
703 ; RV32MV-NEXT: mv a1, s5
704 ; RV32MV-NEXT: call __moddi3@plt
705 ; RV32MV-NEXT: sw a1, 52(sp)
706 ; RV32MV-NEXT: sw a0, 48(sp)
707 ; RV32MV-NEXT: addi a2, zero, 7
708 ; RV32MV-NEXT: mv a0, s2
709 ; RV32MV-NEXT: mv a1, s3
710 ; RV32MV-NEXT: mv a3, zero
711 ; RV32MV-NEXT: call __moddi3@plt
712 ; RV32MV-NEXT: sw a1, 44(sp)
713 ; RV32MV-NEXT: sw a0, 40(sp)
714 ; RV32MV-NEXT: addi a0, zero, 85
715 ; RV32MV-NEXT: vsetivli zero, 1, e8, mf8, ta, mu
716 ; RV32MV-NEXT: vmv.s.x v0, a0
717 ; RV32MV-NEXT: vsetivli zero, 8, e32, m2, ta, mu
718 ; RV32MV-NEXT: vmv.v.i v26, 1
719 ; RV32MV-NEXT: addi a0, sp, 32
720 ; RV32MV-NEXT: vle32.v v28, (a0)
721 ; RV32MV-NEXT: lui a0, %hi(.LCPI3_0)
722 ; RV32MV-NEXT: addi a0, a0, %lo(.LCPI3_0)
723 ; RV32MV-NEXT: vle32.v v30, (a0)
724 ; RV32MV-NEXT: vmerge.vim v26, v26, -1, v0
725 ; RV32MV-NEXT: vand.vv v26, v28, v26
726 ; RV32MV-NEXT: vsetivli zero, 4, e64, m2, ta, mu
727 ; RV32MV-NEXT: vmsne.vv v0, v26, v30
728 ; RV32MV-NEXT: vmv.v.i v26, 0
729 ; RV32MV-NEXT: vmerge.vim v26, v26, -1, v0
730 ; RV32MV-NEXT: vsetivli zero, 0, e32, m2, ta, mu
731 ; RV32MV-NEXT: vmv.x.s a0, v26
732 ; RV32MV-NEXT: sw a0, 0(s1)
733 ; RV32MV-NEXT: vsetivli zero, 1, e32, m2, ta, mu
734 ; RV32MV-NEXT: vslidedown.vi v28, v26, 1
735 ; RV32MV-NEXT: vmv.x.s a0, v28
736 ; RV32MV-NEXT: vslidedown.vi v28, v26, 2
737 ; RV32MV-NEXT: vmv.x.s a1, v28
738 ; RV32MV-NEXT: slli a2, a1, 1
739 ; RV32MV-NEXT: sub a0, a2, a0
740 ; RV32MV-NEXT: sw a0, 4(s1)
741 ; RV32MV-NEXT: vslidedown.vi v28, v26, 4
742 ; RV32MV-NEXT: vmv.x.s a0, v28
743 ; RV32MV-NEXT: srli a2, a0, 30
744 ; RV32MV-NEXT: vslidedown.vi v28, v26, 5
745 ; RV32MV-NEXT: vmv.x.s a3, v28
746 ; RV32MV-NEXT: slli a3, a3, 2
747 ; RV32MV-NEXT: or a2, a3, a2
748 ; RV32MV-NEXT: andi a2, a2, 7
749 ; RV32MV-NEXT: sb a2, 12(s1)
750 ; RV32MV-NEXT: srli a1, a1, 31
751 ; RV32MV-NEXT: vslidedown.vi v26, v26, 3
752 ; RV32MV-NEXT: vmv.x.s a2, v26
753 ; RV32MV-NEXT: andi a2, a2, 1
754 ; RV32MV-NEXT: slli a2, a2, 1
755 ; RV32MV-NEXT: or a1, a1, a2
756 ; RV32MV-NEXT: slli a0, a0, 2
757 ; RV32MV-NEXT: or a0, a1, a0
758 ; RV32MV-NEXT: sw a0, 8(s1)
759 ; RV32MV-NEXT: addi sp, s0, -96
760 ; RV32MV-NEXT: lw s5, 68(sp) # 4-byte Folded Reload
761 ; RV32MV-NEXT: lw s4, 72(sp) # 4-byte Folded Reload
762 ; RV32MV-NEXT: lw s3, 76(sp) # 4-byte Folded Reload
763 ; RV32MV-NEXT: lw s2, 80(sp) # 4-byte Folded Reload
764 ; RV32MV-NEXT: lw s1, 84(sp) # 4-byte Folded Reload
765 ; RV32MV-NEXT: lw s0, 88(sp) # 4-byte Folded Reload
766 ; RV32MV-NEXT: lw ra, 92(sp) # 4-byte Folded Reload
767 ; RV32MV-NEXT: addi sp, sp, 96
770 ; RV64MV-LABEL: test_srem_vec:
772 ; RV64MV-NEXT: addi sp, sp, -96
773 ; RV64MV-NEXT: sd ra, 88(sp) # 8-byte Folded Spill
774 ; RV64MV-NEXT: sd s0, 80(sp) # 8-byte Folded Spill
775 ; RV64MV-NEXT: addi s0, sp, 96
776 ; RV64MV-NEXT: andi sp, sp, -32
777 ; RV64MV-NEXT: lb a1, 12(a0)
778 ; RV64MV-NEXT: lwu a2, 8(a0)
779 ; RV64MV-NEXT: slli a1, a1, 32
780 ; RV64MV-NEXT: or a2, a2, a1
781 ; RV64MV-NEXT: addi a6, zero, -1
782 ; RV64MV-NEXT: ld a3, 0(a0)
783 ; RV64MV-NEXT: srli a4, a6, 24
784 ; RV64MV-NEXT: and a2, a2, a4
785 ; RV64MV-NEXT: slli a4, a2, 31
786 ; RV64MV-NEXT: srli a5, a3, 33
787 ; RV64MV-NEXT: or a4, a5, a4
788 ; RV64MV-NEXT: slli a4, a4, 31
789 ; RV64MV-NEXT: srai a4, a4, 31
790 ; RV64MV-NEXT: slli a2, a2, 29
791 ; RV64MV-NEXT: srai a2, a2, 31
792 ; RV64MV-NEXT: slli a3, a3, 31
793 ; RV64MV-NEXT: srai a3, a3, 31
794 ; RV64MV-NEXT: lui a5, 10923
795 ; RV64MV-NEXT: addiw a5, a5, -1365
796 ; RV64MV-NEXT: slli a5, a5, 12
797 ; RV64MV-NEXT: addi a5, a5, -1365
798 ; RV64MV-NEXT: slli a5, a5, 12
799 ; RV64MV-NEXT: addi a5, a5, -1365
800 ; RV64MV-NEXT: slli a5, a5, 12
801 ; RV64MV-NEXT: addi a5, a5, -1365
802 ; RV64MV-NEXT: mulh a5, a3, a5
803 ; RV64MV-NEXT: srli a1, a5, 63
804 ; RV64MV-NEXT: add a1, a5, a1
805 ; RV64MV-NEXT: addi a5, zero, 6
806 ; RV64MV-NEXT: mul a1, a1, a5
807 ; RV64MV-NEXT: sub a1, a3, a1
808 ; RV64MV-NEXT: sd a1, 32(sp)
809 ; RV64MV-NEXT: lui a1, 1035469
810 ; RV64MV-NEXT: addiw a1, a1, -819
811 ; RV64MV-NEXT: slli a1, a1, 12
812 ; RV64MV-NEXT: addi a1, a1, -819
813 ; RV64MV-NEXT: slli a1, a1, 12
814 ; RV64MV-NEXT: addi a1, a1, -819
815 ; RV64MV-NEXT: slli a1, a1, 13
816 ; RV64MV-NEXT: addi a1, a1, -1639
817 ; RV64MV-NEXT: mulh a1, a2, a1
818 ; RV64MV-NEXT: srli a3, a1, 63
819 ; RV64MV-NEXT: srai a1, a1, 1
820 ; RV64MV-NEXT: add a1, a1, a3
821 ; RV64MV-NEXT: slli a3, a1, 2
822 ; RV64MV-NEXT: add a1, a3, a1
823 ; RV64MV-NEXT: add a1, a2, a1
824 ; RV64MV-NEXT: sd a1, 48(sp)
825 ; RV64MV-NEXT: lui a1, 18725
826 ; RV64MV-NEXT: addiw a1, a1, -1755
827 ; RV64MV-NEXT: slli a1, a1, 12
828 ; RV64MV-NEXT: addi a1, a1, -1755
829 ; RV64MV-NEXT: slli a1, a1, 12
830 ; RV64MV-NEXT: addi a1, a1, -1755
831 ; RV64MV-NEXT: slli a1, a1, 12
832 ; RV64MV-NEXT: addi a1, a1, -1755
833 ; RV64MV-NEXT: mulh a1, a4, a1
834 ; RV64MV-NEXT: srli a2, a1, 63
835 ; RV64MV-NEXT: srai a1, a1, 1
836 ; RV64MV-NEXT: add a1, a1, a2
837 ; RV64MV-NEXT: slli a2, a1, 3
838 ; RV64MV-NEXT: sub a1, a1, a2
839 ; RV64MV-NEXT: add a1, a4, a1
840 ; RV64MV-NEXT: sd a1, 40(sp)
841 ; RV64MV-NEXT: vsetivli zero, 4, e64, m2, ta, mu
842 ; RV64MV-NEXT: addi a1, sp, 32
843 ; RV64MV-NEXT: vle64.v v26, (a1)
844 ; RV64MV-NEXT: lui a1, %hi(.LCPI3_0)
845 ; RV64MV-NEXT: addi a1, a1, %lo(.LCPI3_0)
846 ; RV64MV-NEXT: vle64.v v28, (a1)
847 ; RV64MV-NEXT: srli a1, a6, 31
848 ; RV64MV-NEXT: vand.vx v26, v26, a1
849 ; RV64MV-NEXT: vmsne.vv v0, v26, v28
850 ; RV64MV-NEXT: vmv.v.i v26, 0
851 ; RV64MV-NEXT: vmerge.vim v26, v26, -1, v0
852 ; RV64MV-NEXT: vsetivli zero, 1, e64, m2, ta, mu
853 ; RV64MV-NEXT: vslidedown.vi v28, v26, 2
854 ; RV64MV-NEXT: vmv.x.s a2, v28
855 ; RV64MV-NEXT: srli a3, a2, 30
856 ; RV64MV-NEXT: andi a3, a3, 7
857 ; RV64MV-NEXT: sb a3, 12(a0)
858 ; RV64MV-NEXT: slli a2, a2, 2
859 ; RV64MV-NEXT: vslidedown.vi v28, v26, 1
860 ; RV64MV-NEXT: vmv.x.s a3, v28
861 ; RV64MV-NEXT: and a3, a3, a1
862 ; RV64MV-NEXT: srli a4, a3, 31
863 ; RV64MV-NEXT: or a2, a4, a2
864 ; RV64MV-NEXT: sw a2, 8(a0)
865 ; RV64MV-NEXT: vmv.x.s a2, v26
866 ; RV64MV-NEXT: and a1, a2, a1
867 ; RV64MV-NEXT: slli a2, a3, 33
868 ; RV64MV-NEXT: or a1, a1, a2
869 ; RV64MV-NEXT: sd a1, 0(a0)
870 ; RV64MV-NEXT: addi sp, s0, -96
871 ; RV64MV-NEXT: ld s0, 80(sp) # 8-byte Folded Reload
872 ; RV64MV-NEXT: ld ra, 88(sp) # 8-byte Folded Reload
873 ; RV64MV-NEXT: addi sp, sp, 96
875 %ld = load <3 x i33>, <3 x i33>* %X
876 %srem = srem <3 x i33> %ld, <i33 6, i33 7, i33 -5>
877 %cmp = icmp ne <3 x i33> %srem, <i33 0, i33 1, i33 2>
878 %ext = sext <3 x i1> %cmp to <3 x i33>
879 store <3 x i33> %ext, <3 x i33>* %X