diff options
Diffstat (limited to 'llvm/test/CodeGen/RISCV/rv64zbb-zbp.ll')
-rw-r--r-- | llvm/test/CodeGen/RISCV/rv64zbb-zbp.ll | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/llvm/test/CodeGen/RISCV/rv64zbb-zbp.ll b/llvm/test/CodeGen/RISCV/rv64zbb-zbp.ll index 23efb3bf9ebc..79a91979f2bd 100644 --- a/llvm/test/CodeGen/RISCV/rv64zbb-zbp.ll +++ b/llvm/test/CodeGen/RISCV/rv64zbb-zbp.ll @@ -563,6 +563,8 @@ define i8 @srli_i8(i8 %a) nounwind { ret i8 %1 } +; We could use sext.b+srai, but slli+srai offers more opportunities for +; comppressed instructions. define i8 @srai_i8(i8 %a) nounwind { ; RV64I-LABEL: srai_i8: ; RV64I: # %bb.0: @@ -572,8 +574,8 @@ define i8 @srai_i8(i8 %a) nounwind { ; ; RV64ZBB-LABEL: srai_i8: ; RV64ZBB: # %bb.0: -; RV64ZBB-NEXT: sext.b a0, a0 -; RV64ZBB-NEXT: srai a0, a0, 5 +; RV64ZBB-NEXT: slli a0, a0, 56 +; RV64ZBB-NEXT: srai a0, a0, 61 ; RV64ZBB-NEXT: ret ; ; RV64ZBP-LABEL: srai_i8: @@ -609,6 +611,8 @@ define i16 @srli_i16(i16 %a) nounwind { ret i16 %1 } +; We could use sext.h+srai, but slli+srai offers more opportunities for +; comppressed instructions. define i16 @srai_i16(i16 %a) nounwind { ; RV64I-LABEL: srai_i16: ; RV64I: # %bb.0: @@ -618,8 +622,8 @@ define i16 @srai_i16(i16 %a) nounwind { ; ; RV64ZBB-LABEL: srai_i16: ; RV64ZBB: # %bb.0: -; RV64ZBB-NEXT: sext.h a0, a0 -; RV64ZBB-NEXT: srai a0, a0, 9 +; RV64ZBB-NEXT: slli a0, a0, 48 +; RV64ZBB-NEXT: srai a0, a0, 57 ; RV64ZBB-NEXT: ret ; ; RV64ZBP-LABEL: srai_i16: |