Skip to content

Commit bb6fe51

Browse files
committed
[RISCV] Pre-commit test
1 parent 1db03ca commit bb6fe51

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

llvm/test/CodeGen/RISCV/rv32xtheadbb.ll

+32
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,38 @@ define i64 @no_sexth_i64(i64 %a) nounwind {
401401
ret i64 %shr
402402
}
403403

404+
define i32 @sext_sextinreg_sra(i16 %a) nounwind {
405+
; RV32I-LABEL: sext_sextinreg_sra:
406+
; RV32I: # %bb.0:
407+
; RV32I-NEXT: slli a0, a0, 16
408+
; RV32I-NEXT: srai a0, a0, 26
409+
; RV32I-NEXT: ret
410+
;
411+
; RV32XTHEADBB-LABEL: sext_sextinreg_sra:
412+
; RV32XTHEADBB: # %bb.0:
413+
; RV32XTHEADBB-NEXT: th.ext a0, a0, 15, 10
414+
; RV32XTHEADBB-NEXT: ret
415+
%sext = sext i16 %a to i32
416+
%shr = ashr exact i32 %sext, 10
417+
ret i32 %shr
418+
}
419+
420+
define i32 @sext_sextinreg_sra_2(i16 %a) nounwind {
421+
; RV32I-LABEL: sext_sextinreg_sra_2:
422+
; RV32I: # %bb.0:
423+
; RV32I-NEXT: slli a0, a0, 16
424+
; RV32I-NEXT: srai a0, a0, 31
425+
; RV32I-NEXT: ret
426+
;
427+
; RV32XTHEADBB-LABEL: sext_sextinreg_sra_2:
428+
; RV32XTHEADBB: # %bb.0:
429+
; RV32XTHEADBB-NEXT: th.ext a0, a0, 15, 24
430+
; RV32XTHEADBB-NEXT: ret
431+
%sext = sext i16 %a to i32
432+
%shr = ashr exact i32 %sext, 24
433+
ret i32 %shr
434+
}
435+
404436
define i32 @zexth_i32(i32 %a) nounwind {
405437
; RV32I-LABEL: zexth_i32:
406438
; RV32I: # %bb.0:

0 commit comments

Comments
 (0)