Skip to content

Commit

Permalink
[RISCV] Add test coverage for mul (zext), 2^N + 2/4/8 [nfc]
Browse files Browse the repository at this point in the history
  • Loading branch information
preames committed Apr 23, 2024
1 parent 03c8a29 commit c793f4a
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions llvm/test/CodeGen/RISCV/rv64zba.ll
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,25 @@ define i64 @mul288(i64 %a) {
ret i64 %c
}

define i64 @zext_mul68(i32 signext %a) {
; RV64I-LABEL: zext_mul68:
; RV64I: # %bb.0:
; RV64I-NEXT: li a1, 17
; RV64I-NEXT: slli a1, a1, 34
; RV64I-NEXT: slli a0, a0, 32
; RV64I-NEXT: mulhu a0, a0, a1
; RV64I-NEXT: ret
;
; RV64ZBA-LABEL: zext_mul68:
; RV64ZBA: # %bb.0:
; RV64ZBA-NEXT: slli.uw a1, a0, 6
; RV64ZBA-NEXT: sh2add.uw a0, a0, a1
; RV64ZBA-NEXT: ret
%b = zext i32 %a to i64
%c = mul i64 %b, 68
ret i64 %c
}

define i64 @zext_mul96(i32 signext %a) {
; RV64I-LABEL: zext_mul96:
; RV64I: # %bb.0:
Expand Down

0 comments on commit c793f4a

Please sign in to comment.