1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv64 -verify-machineinstrs < %s \
3 ; RUN: | FileCheck %s -check-prefix=RV64I
4 ; RUN: llc -mtriple=riscv64 -mattr=+experimental-b -verify-machineinstrs < %s \
5 ; RUN: | FileCheck %s -check-prefix=RV64B
6 ; RUN: llc -mtriple=riscv64 -mattr=+experimental-zbb -verify-machineinstrs < %s \
7 ; RUN: | FileCheck %s -check-prefix=RV64ZBB
8 ; RUN: llc -mtriple=riscv64 -mattr=+experimental-zbp -verify-machineinstrs < %s \
9 ; RUN: | FileCheck %s -check-prefix=RV64ZBP
11 define signext i32 @andn_i32(i32 signext %a, i32 signext %b) nounwind {
12 ; RV64I-LABEL: andn_i32:
14 ; RV64I-NEXT: not a1, a1
15 ; RV64I-NEXT: and a0, a1, a0
18 ; RV64B-LABEL: andn_i32:
20 ; RV64B-NEXT: andn a0, a0, a1
23 ; RV64ZBB-LABEL: andn_i32:
25 ; RV64ZBB-NEXT: andn a0, a0, a1
28 ; RV64ZBP-LABEL: andn_i32:
30 ; RV64ZBP-NEXT: andn a0, a0, a1
33 %and = and i32 %neg, %a
37 define i64 @andn_i64(i64 %a, i64 %b) nounwind {
38 ; RV64I-LABEL: andn_i64:
40 ; RV64I-NEXT: not a1, a1
41 ; RV64I-NEXT: and a0, a1, a0
44 ; RV64B-LABEL: andn_i64:
46 ; RV64B-NEXT: andn a0, a0, a1
49 ; RV64ZBB-LABEL: andn_i64:
51 ; RV64ZBB-NEXT: andn a0, a0, a1
54 ; RV64ZBP-LABEL: andn_i64:
56 ; RV64ZBP-NEXT: andn a0, a0, a1
59 %and = and i64 %neg, %a
63 define signext i32 @orn_i32(i32 signext %a, i32 signext %b) nounwind {
64 ; RV64I-LABEL: orn_i32:
66 ; RV64I-NEXT: not a1, a1
67 ; RV64I-NEXT: or a0, a1, a0
70 ; RV64B-LABEL: orn_i32:
72 ; RV64B-NEXT: orn a0, a0, a1
75 ; RV64ZBB-LABEL: orn_i32:
77 ; RV64ZBB-NEXT: orn a0, a0, a1
80 ; RV64ZBP-LABEL: orn_i32:
82 ; RV64ZBP-NEXT: orn a0, a0, a1
89 define i64 @orn_i64(i64 %a, i64 %b) nounwind {
90 ; RV64I-LABEL: orn_i64:
92 ; RV64I-NEXT: not a1, a1
93 ; RV64I-NEXT: or a0, a1, a0
96 ; RV64B-LABEL: orn_i64:
98 ; RV64B-NEXT: orn a0, a0, a1
101 ; RV64ZBB-LABEL: orn_i64:
103 ; RV64ZBB-NEXT: orn a0, a0, a1
106 ; RV64ZBP-LABEL: orn_i64:
108 ; RV64ZBP-NEXT: orn a0, a0, a1
110 %neg = xor i64 %b, -1
111 %or = or i64 %neg, %a
115 define signext i32 @xnor_i32(i32 signext %a, i32 signext %b) nounwind {
116 ; RV64I-LABEL: xnor_i32:
118 ; RV64I-NEXT: xor a0, a0, a1
119 ; RV64I-NEXT: not a0, a0
122 ; RV64B-LABEL: xnor_i32:
124 ; RV64B-NEXT: xnor a0, a0, a1
127 ; RV64ZBB-LABEL: xnor_i32:
129 ; RV64ZBB-NEXT: xnor a0, a0, a1
132 ; RV64ZBP-LABEL: xnor_i32:
134 ; RV64ZBP-NEXT: xnor a0, a0, a1
136 %neg = xor i32 %a, -1
137 %xor = xor i32 %neg, %b
141 define i64 @xnor_i64(i64 %a, i64 %b) nounwind {
142 ; RV64I-LABEL: xnor_i64:
144 ; RV64I-NEXT: xor a0, a0, a1
145 ; RV64I-NEXT: not a0, a0
148 ; RV64B-LABEL: xnor_i64:
150 ; RV64B-NEXT: xnor a0, a0, a1
153 ; RV64ZBB-LABEL: xnor_i64:
155 ; RV64ZBB-NEXT: xnor a0, a0, a1
158 ; RV64ZBP-LABEL: xnor_i64:
160 ; RV64ZBP-NEXT: xnor a0, a0, a1
162 %neg = xor i64 %a, -1
163 %xor = xor i64 %neg, %b
167 declare i32 @llvm.fshl.i32(i32, i32, i32)
169 define signext i32 @rol_i32(i32 signext %a, i32 signext %b) nounwind {
170 ; RV64I-LABEL: rol_i32:
172 ; RV64I-NEXT: sllw a2, a0, a1
173 ; RV64I-NEXT: negw a1, a1
174 ; RV64I-NEXT: srlw a0, a0, a1
175 ; RV64I-NEXT: or a0, a2, a0
178 ; RV64B-LABEL: rol_i32:
180 ; RV64B-NEXT: rolw a0, a0, a1
183 ; RV64ZBB-LABEL: rol_i32:
185 ; RV64ZBB-NEXT: rolw a0, a0, a1
188 ; RV64ZBP-LABEL: rol_i32:
190 ; RV64ZBP-NEXT: rolw a0, a0, a1
192 %1 = tail call i32 @llvm.fshl.i32(i32 %a, i32 %a, i32 %b)
196 ; Similar to rol_i32, but doesn't sign extend the result.
197 define void @rol_i32_nosext(i32 signext %a, i32 signext %b, i32* %x) nounwind {
198 ; RV64I-LABEL: rol_i32_nosext:
200 ; RV64I-NEXT: sllw a3, a0, a1
201 ; RV64I-NEXT: negw a1, a1
202 ; RV64I-NEXT: srlw a0, a0, a1
203 ; RV64I-NEXT: or a0, a3, a0
204 ; RV64I-NEXT: sw a0, 0(a2)
207 ; RV64B-LABEL: rol_i32_nosext:
209 ; RV64B-NEXT: rolw a0, a0, a1
210 ; RV64B-NEXT: sw a0, 0(a2)
213 ; RV64ZBB-LABEL: rol_i32_nosext:
215 ; RV64ZBB-NEXT: rolw a0, a0, a1
216 ; RV64ZBB-NEXT: sw a0, 0(a2)
219 ; RV64ZBP-LABEL: rol_i32_nosext:
221 ; RV64ZBP-NEXT: rolw a0, a0, a1
222 ; RV64ZBP-NEXT: sw a0, 0(a2)
224 %1 = tail call i32 @llvm.fshl.i32(i32 %a, i32 %a, i32 %b)
225 store i32 %1, i32* %x
229 define signext i32 @rol_i32_neg_constant_rhs(i32 signext %a) nounwind {
230 ; RV64I-LABEL: rol_i32_neg_constant_rhs:
232 ; RV64I-NEXT: addi a1, zero, -2
233 ; RV64I-NEXT: sllw a2, a1, a0
234 ; RV64I-NEXT: negw a0, a0
235 ; RV64I-NEXT: srlw a0, a1, a0
236 ; RV64I-NEXT: or a0, a2, a0
239 ; RV64B-LABEL: rol_i32_neg_constant_rhs:
241 ; RV64B-NEXT: addi a1, zero, -2
242 ; RV64B-NEXT: rolw a0, a1, a0
245 ; RV64ZBB-LABEL: rol_i32_neg_constant_rhs:
247 ; RV64ZBB-NEXT: addi a1, zero, -2
248 ; RV64ZBB-NEXT: rolw a0, a1, a0
251 ; RV64ZBP-LABEL: rol_i32_neg_constant_rhs:
253 ; RV64ZBP-NEXT: addi a1, zero, -2
254 ; RV64ZBP-NEXT: rolw a0, a1, a0
256 %1 = tail call i32 @llvm.fshl.i32(i32 -2, i32 -2, i32 %a)
260 declare i64 @llvm.fshl.i64(i64, i64, i64)
262 define i64 @rol_i64(i64 %a, i64 %b) nounwind {
263 ; RV64I-LABEL: rol_i64:
265 ; RV64I-NEXT: sll a2, a0, a1
266 ; RV64I-NEXT: neg a1, a1
267 ; RV64I-NEXT: srl a0, a0, a1
268 ; RV64I-NEXT: or a0, a2, a0
271 ; RV64B-LABEL: rol_i64:
273 ; RV64B-NEXT: rol a0, a0, a1
276 ; RV64ZBB-LABEL: rol_i64:
278 ; RV64ZBB-NEXT: rol a0, a0, a1
281 ; RV64ZBP-LABEL: rol_i64:
283 ; RV64ZBP-NEXT: rol a0, a0, a1
285 %or = tail call i64 @llvm.fshl.i64(i64 %a, i64 %a, i64 %b)
289 declare i32 @llvm.fshr.i32(i32, i32, i32)
291 define signext i32 @ror_i32(i32 signext %a, i32 signext %b) nounwind {
292 ; RV64I-LABEL: ror_i32:
294 ; RV64I-NEXT: srlw a2, a0, a1
295 ; RV64I-NEXT: negw a1, a1
296 ; RV64I-NEXT: sllw a0, a0, a1
297 ; RV64I-NEXT: or a0, a2, a0
300 ; RV64B-LABEL: ror_i32:
302 ; RV64B-NEXT: rorw a0, a0, a1
305 ; RV64ZBB-LABEL: ror_i32:
307 ; RV64ZBB-NEXT: rorw a0, a0, a1
310 ; RV64ZBP-LABEL: ror_i32:
312 ; RV64ZBP-NEXT: rorw a0, a0, a1
314 %1 = tail call i32 @llvm.fshr.i32(i32 %a, i32 %a, i32 %b)
318 ; Similar to ror_i32, but doesn't sign extend the result.
319 define void @ror_i32_nosext(i32 signext %a, i32 signext %b, i32* %x) nounwind {
320 ; RV64I-LABEL: ror_i32_nosext:
322 ; RV64I-NEXT: srlw a3, a0, a1
323 ; RV64I-NEXT: negw a1, a1
324 ; RV64I-NEXT: sllw a0, a0, a1
325 ; RV64I-NEXT: or a0, a3, a0
326 ; RV64I-NEXT: sw a0, 0(a2)
329 ; RV64B-LABEL: ror_i32_nosext:
331 ; RV64B-NEXT: rorw a0, a0, a1
332 ; RV64B-NEXT: sw a0, 0(a2)
335 ; RV64ZBB-LABEL: ror_i32_nosext:
337 ; RV64ZBB-NEXT: rorw a0, a0, a1
338 ; RV64ZBB-NEXT: sw a0, 0(a2)
341 ; RV64ZBP-LABEL: ror_i32_nosext:
343 ; RV64ZBP-NEXT: rorw a0, a0, a1
344 ; RV64ZBP-NEXT: sw a0, 0(a2)
346 %1 = tail call i32 @llvm.fshr.i32(i32 %a, i32 %a, i32 %b)
347 store i32 %1, i32* %x
351 define signext i32 @ror_i32_neg_constant_rhs(i32 signext %a) nounwind {
352 ; RV64I-LABEL: ror_i32_neg_constant_rhs:
354 ; RV64I-NEXT: addi a1, zero, -2
355 ; RV64I-NEXT: srlw a2, a1, a0
356 ; RV64I-NEXT: negw a0, a0
357 ; RV64I-NEXT: sllw a0, a1, a0
358 ; RV64I-NEXT: or a0, a2, a0
361 ; RV64B-LABEL: ror_i32_neg_constant_rhs:
363 ; RV64B-NEXT: addi a1, zero, -2
364 ; RV64B-NEXT: rorw a0, a1, a0
367 ; RV64ZBB-LABEL: ror_i32_neg_constant_rhs:
369 ; RV64ZBB-NEXT: addi a1, zero, -2
370 ; RV64ZBB-NEXT: rorw a0, a1, a0
373 ; RV64ZBP-LABEL: ror_i32_neg_constant_rhs:
375 ; RV64ZBP-NEXT: addi a1, zero, -2
376 ; RV64ZBP-NEXT: rorw a0, a1, a0
378 %1 = tail call i32 @llvm.fshr.i32(i32 -2, i32 -2, i32 %a)
382 declare i64 @llvm.fshr.i64(i64, i64, i64)
384 define i64 @ror_i64(i64 %a, i64 %b) nounwind {
385 ; RV64I-LABEL: ror_i64:
387 ; RV64I-NEXT: srl a2, a0, a1
388 ; RV64I-NEXT: neg a1, a1
389 ; RV64I-NEXT: sll a0, a0, a1
390 ; RV64I-NEXT: or a0, a2, a0
393 ; RV64B-LABEL: ror_i64:
395 ; RV64B-NEXT: ror a0, a0, a1
398 ; RV64ZBB-LABEL: ror_i64:
400 ; RV64ZBB-NEXT: ror a0, a0, a1
403 ; RV64ZBP-LABEL: ror_i64:
405 ; RV64ZBP-NEXT: ror a0, a0, a1
407 %or = tail call i64 @llvm.fshr.i64(i64 %a, i64 %a, i64 %b)
411 define signext i32 @rori_i32_fshl(i32 signext %a) nounwind {
412 ; RV64I-LABEL: rori_i32_fshl:
414 ; RV64I-NEXT: srliw a1, a0, 1
415 ; RV64I-NEXT: slli a0, a0, 31
416 ; RV64I-NEXT: or a0, a0, a1
417 ; RV64I-NEXT: sext.w a0, a0
420 ; RV64B-LABEL: rori_i32_fshl:
422 ; RV64B-NEXT: roriw a0, a0, 1
425 ; RV64ZBB-LABEL: rori_i32_fshl:
427 ; RV64ZBB-NEXT: roriw a0, a0, 1
430 ; RV64ZBP-LABEL: rori_i32_fshl:
432 ; RV64ZBP-NEXT: roriw a0, a0, 1
434 %1 = tail call i32 @llvm.fshl.i32(i32 %a, i32 %a, i32 31)
438 ; Similar to rori_i32_fshl, but doesn't sign extend the result.
439 define void @rori_i32_fshl_nosext(i32 signext %a, i32* %x) nounwind {
440 ; RV64I-LABEL: rori_i32_fshl_nosext:
442 ; RV64I-NEXT: srliw a2, a0, 1
443 ; RV64I-NEXT: slli a0, a0, 31
444 ; RV64I-NEXT: or a0, a0, a2
445 ; RV64I-NEXT: sw a0, 0(a1)
448 ; RV64B-LABEL: rori_i32_fshl_nosext:
450 ; RV64B-NEXT: roriw a0, a0, 1
451 ; RV64B-NEXT: sw a0, 0(a1)
454 ; RV64ZBB-LABEL: rori_i32_fshl_nosext:
456 ; RV64ZBB-NEXT: roriw a0, a0, 1
457 ; RV64ZBB-NEXT: sw a0, 0(a1)
460 ; RV64ZBP-LABEL: rori_i32_fshl_nosext:
462 ; RV64ZBP-NEXT: roriw a0, a0, 1
463 ; RV64ZBP-NEXT: sw a0, 0(a1)
465 %1 = tail call i32 @llvm.fshl.i32(i32 %a, i32 %a, i32 31)
466 store i32 %1, i32* %x
470 define signext i32 @rori_i32_fshr(i32 signext %a) nounwind {
471 ; RV64I-LABEL: rori_i32_fshr:
473 ; RV64I-NEXT: slli a1, a0, 1
474 ; RV64I-NEXT: srliw a0, a0, 31
475 ; RV64I-NEXT: or a0, a0, a1
476 ; RV64I-NEXT: sext.w a0, a0
479 ; RV64B-LABEL: rori_i32_fshr:
481 ; RV64B-NEXT: roriw a0, a0, 31
484 ; RV64ZBB-LABEL: rori_i32_fshr:
486 ; RV64ZBB-NEXT: roriw a0, a0, 31
489 ; RV64ZBP-LABEL: rori_i32_fshr:
491 ; RV64ZBP-NEXT: roriw a0, a0, 31
493 %1 = tail call i32 @llvm.fshr.i32(i32 %a, i32 %a, i32 31)
497 ; Similar to rori_i32_fshr, but doesn't sign extend the result.
498 define void @rori_i32_fshr_nosext(i32 signext %a, i32* %x) nounwind {
499 ; RV64I-LABEL: rori_i32_fshr_nosext:
501 ; RV64I-NEXT: slli a2, a0, 1
502 ; RV64I-NEXT: srliw a0, a0, 31
503 ; RV64I-NEXT: or a0, a0, a2
504 ; RV64I-NEXT: sw a0, 0(a1)
507 ; RV64B-LABEL: rori_i32_fshr_nosext:
509 ; RV64B-NEXT: roriw a0, a0, 31
510 ; RV64B-NEXT: sw a0, 0(a1)
513 ; RV64ZBB-LABEL: rori_i32_fshr_nosext:
515 ; RV64ZBB-NEXT: roriw a0, a0, 31
516 ; RV64ZBB-NEXT: sw a0, 0(a1)
519 ; RV64ZBP-LABEL: rori_i32_fshr_nosext:
521 ; RV64ZBP-NEXT: roriw a0, a0, 31
522 ; RV64ZBP-NEXT: sw a0, 0(a1)
524 %1 = tail call i32 @llvm.fshr.i32(i32 %a, i32 %a, i32 31)
525 store i32 %1, i32* %x
529 ; This test is similar to the type legalized version of the fshl/fshr tests, but
530 ; instead of having the same input to both shifts it has different inputs. Make
531 ; sure we don't match it as a roriw.
532 define signext i32 @not_rori_i32(i32 signext %x, i32 signext %y) nounwind {
533 ; RV64I-LABEL: not_rori_i32:
535 ; RV64I-NEXT: slli a0, a0, 31
536 ; RV64I-NEXT: srliw a1, a1, 1
537 ; RV64I-NEXT: or a0, a0, a1
538 ; RV64I-NEXT: sext.w a0, a0
541 ; RV64B-LABEL: not_rori_i32:
543 ; RV64B-NEXT: slli a0, a0, 31
544 ; RV64B-NEXT: srliw a1, a1, 1
545 ; RV64B-NEXT: or a0, a0, a1
546 ; RV64B-NEXT: sext.w a0, a0
549 ; RV64ZBB-LABEL: not_rori_i32:
551 ; RV64ZBB-NEXT: slli a0, a0, 31
552 ; RV64ZBB-NEXT: srliw a1, a1, 1
553 ; RV64ZBB-NEXT: or a0, a0, a1
554 ; RV64ZBB-NEXT: sext.w a0, a0
557 ; RV64ZBP-LABEL: not_rori_i32:
559 ; RV64ZBP-NEXT: slli a0, a0, 31
560 ; RV64ZBP-NEXT: srliw a1, a1, 1
561 ; RV64ZBP-NEXT: or a0, a0, a1
562 ; RV64ZBP-NEXT: sext.w a0, a0
570 ; This is similar to the type legalized roriw pattern, but the and mask is more
571 ; than 32 bits so the lshr doesn't shift zeroes into the lower 32 bits. Make
572 ; sure we don't match it to roriw.
573 define i64 @roriw_bug(i64 %x) nounwind {
574 ; RV64I-LABEL: roriw_bug:
576 ; RV64I-NEXT: slli a1, a0, 31
577 ; RV64I-NEXT: andi a0, a0, -2
578 ; RV64I-NEXT: srli a2, a0, 1
579 ; RV64I-NEXT: or a1, a1, a2
580 ; RV64I-NEXT: sext.w a1, a1
581 ; RV64I-NEXT: xor a0, a0, a1
584 ; RV64B-LABEL: roriw_bug:
586 ; RV64B-NEXT: slli a1, a0, 31
587 ; RV64B-NEXT: andi a0, a0, -2
588 ; RV64B-NEXT: srli a2, a0, 1
589 ; RV64B-NEXT: or a1, a1, a2
590 ; RV64B-NEXT: sext.w a1, a1
591 ; RV64B-NEXT: xor a0, a0, a1
594 ; RV64ZBB-LABEL: roriw_bug:
596 ; RV64ZBB-NEXT: slli a1, a0, 31
597 ; RV64ZBB-NEXT: andi a0, a0, -2
598 ; RV64ZBB-NEXT: srli a2, a0, 1
599 ; RV64ZBB-NEXT: or a1, a1, a2
600 ; RV64ZBB-NEXT: sext.w a1, a1
601 ; RV64ZBB-NEXT: xor a0, a0, a1
604 ; RV64ZBP-LABEL: roriw_bug:
606 ; RV64ZBP-NEXT: slli a1, a0, 31
607 ; RV64ZBP-NEXT: andi a0, a0, -2
608 ; RV64ZBP-NEXT: srli a2, a0, 1
609 ; RV64ZBP-NEXT: or a1, a1, a2
610 ; RV64ZBP-NEXT: sext.w a1, a1
611 ; RV64ZBP-NEXT: xor a0, a0, a1
614 %b = and i64 %x, 18446744073709551614
619 %g = xor i64 %b, %f ; to increase the use count on %b to disable SimplifyDemandedBits.
623 define i64 @rori_i64_fshl(i64 %a) nounwind {
624 ; RV64I-LABEL: rori_i64_fshl:
626 ; RV64I-NEXT: srli a1, a0, 1
627 ; RV64I-NEXT: slli a0, a0, 63
628 ; RV64I-NEXT: or a0, a0, a1
631 ; RV64B-LABEL: rori_i64_fshl:
633 ; RV64B-NEXT: rori a0, a0, 1
636 ; RV64ZBB-LABEL: rori_i64_fshl:
638 ; RV64ZBB-NEXT: rori a0, a0, 1
641 ; RV64ZBP-LABEL: rori_i64_fshl:
643 ; RV64ZBP-NEXT: rori a0, a0, 1
645 %1 = tail call i64 @llvm.fshl.i64(i64 %a, i64 %a, i64 63)
649 define i64 @rori_i64_fshr(i64 %a) nounwind {
650 ; RV64I-LABEL: rori_i64_fshr:
652 ; RV64I-NEXT: slli a1, a0, 1
653 ; RV64I-NEXT: srli a0, a0, 63
654 ; RV64I-NEXT: or a0, a0, a1
657 ; RV64B-LABEL: rori_i64_fshr:
659 ; RV64B-NEXT: rori a0, a0, 63
662 ; RV64ZBB-LABEL: rori_i64_fshr:
664 ; RV64ZBB-NEXT: rori a0, a0, 63
667 ; RV64ZBP-LABEL: rori_i64_fshr:
669 ; RV64ZBP-NEXT: rori a0, a0, 63
671 %1 = tail call i64 @llvm.fshr.i64(i64 %a, i64 %a, i64 63)
675 define i8 @srli_i8(i8 %a) nounwind {
676 ; RV64I-LABEL: srli_i8:
678 ; RV64I-NEXT: andi a0, a0, 192
679 ; RV64I-NEXT: srli a0, a0, 6
682 ; RV64B-LABEL: srli_i8:
684 ; RV64B-NEXT: andi a0, a0, 192
685 ; RV64B-NEXT: srli a0, a0, 6
688 ; RV64ZBB-LABEL: srli_i8:
690 ; RV64ZBB-NEXT: andi a0, a0, 192
691 ; RV64ZBB-NEXT: srli a0, a0, 6
694 ; RV64ZBP-LABEL: srli_i8:
696 ; RV64ZBP-NEXT: andi a0, a0, 192
697 ; RV64ZBP-NEXT: srli a0, a0, 6
703 define i8 @srai_i8(i8 %a) nounwind {
704 ; RV64I-LABEL: srai_i8:
706 ; RV64I-NEXT: slli a0, a0, 56
707 ; RV64I-NEXT: srai a0, a0, 61
710 ; RV64B-LABEL: srai_i8:
712 ; RV64B-NEXT: sext.b a0, a0
713 ; RV64B-NEXT: srai a0, a0, 5
716 ; RV64ZBB-LABEL: srai_i8:
718 ; RV64ZBB-NEXT: sext.b a0, a0
719 ; RV64ZBB-NEXT: srai a0, a0, 5
722 ; RV64ZBP-LABEL: srai_i8:
724 ; RV64ZBP-NEXT: slli a0, a0, 56
725 ; RV64ZBP-NEXT: srai a0, a0, 61
731 define i16 @srli_i16(i16 %a) nounwind {
732 ; RV64I-LABEL: srli_i16:
734 ; RV64I-NEXT: slli a0, a0, 48
735 ; RV64I-NEXT: srli a0, a0, 54
738 ; RV64B-LABEL: srli_i16:
740 ; RV64B-NEXT: zext.h a0, a0
741 ; RV64B-NEXT: srli a0, a0, 6
744 ; RV64ZBB-LABEL: srli_i16:
746 ; RV64ZBB-NEXT: zext.h a0, a0
747 ; RV64ZBB-NEXT: srli a0, a0, 6
750 ; RV64ZBP-LABEL: srli_i16:
752 ; RV64ZBP-NEXT: zext.h a0, a0
753 ; RV64ZBP-NEXT: srli a0, a0, 6
759 define i16 @srai_i16(i16 %a) nounwind {
760 ; RV64I-LABEL: srai_i16:
762 ; RV64I-NEXT: slli a0, a0, 48
763 ; RV64I-NEXT: srai a0, a0, 57
766 ; RV64B-LABEL: srai_i16:
768 ; RV64B-NEXT: sext.h a0, a0
769 ; RV64B-NEXT: srai a0, a0, 9
772 ; RV64ZBB-LABEL: srai_i16:
774 ; RV64ZBB-NEXT: sext.h a0, a0
775 ; RV64ZBB-NEXT: srai a0, a0, 9
778 ; RV64ZBP-LABEL: srai_i16:
780 ; RV64ZBP-NEXT: slli a0, a0, 48
781 ; RV64ZBP-NEXT: srai a0, a0, 57