[llvm] r343958 - [RISCV] Update alu8.ll and alu16.ll test cases
Alex Bradbury via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 8 02:08:52 PDT 2018
Author: asb
Date: Mon Oct 8 02:08:51 2018
New Revision: 343958
URL: http://llvm.org/viewvc/llvm-project?rev=343958&view=rev
Log:
[RISCV] Update alu8.ll and alu16.ll test cases
The srli test in alu8.ll was a no-op, as it shifted by 8 bits. Fix this, and
also change the immediate in alu16.ll as shifted by something other than a
poewr of 8 is more interesting.
Modified:
llvm/trunk/test/CodeGen/RISCV/alu16.ll
llvm/trunk/test/CodeGen/RISCV/alu8.ll
Modified: llvm/trunk/test/CodeGen/RISCV/alu16.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/RISCV/alu16.ll?rev=343958&r1=343957&r2=343958&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/RISCV/alu16.ll (original)
+++ llvm/trunk/test/CodeGen/RISCV/alu16.ll Mon Oct 8 02:08:51 2018
@@ -82,11 +82,11 @@ define i16 @srli(i16 %a) nounwind {
; RV32I-LABEL: srli:
; RV32I: # %bb.0:
; RV32I-NEXT: lui a1, 16
-; RV32I-NEXT: addi a1, a1, -256
+; RV32I-NEXT: addi a1, a1, -64
; RV32I-NEXT: and a0, a0, a1
-; RV32I-NEXT: srli a0, a0, 8
+; RV32I-NEXT: srli a0, a0, 6
; RV32I-NEXT: ret
- %1 = lshr i16 %a, 8
+ %1 = lshr i16 %a, 6
ret i16 %1
}
Modified: llvm/trunk/test/CodeGen/RISCV/alu8.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/RISCV/alu8.ll?rev=343958&r1=343957&r2=343958&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/RISCV/alu8.ll (original)
+++ llvm/trunk/test/CodeGen/RISCV/alu8.ll Mon Oct 8 02:08:51 2018
@@ -79,16 +79,20 @@ define i8 @slli(i8 %a) nounwind {
define i8 @srli(i8 %a) nounwind {
; RV32I-LABEL: srli:
; RV32I: # %bb.0:
+; RV32I-NEXT: andi a0, a0, 192
+; RV32I-NEXT: srli a0, a0, 6
; RV32I-NEXT: ret
- %1 = lshr i8 %a, 8
+ %1 = lshr i8 %a, 6
ret i8 %1
}
define i8 @srai(i8 %a) nounwind {
; RV32I-LABEL: srai:
; RV32I: # %bb.0:
+; RV32I-NEXT: slli a0, a0, 24
+; RV32I-NEXT: srai a0, a0, 29
; RV32I-NEXT: ret
- %1 = ashr i8 %a, 9
+ %1 = ashr i8 %a, 5
ret i8 %1
}
More information about the llvm-commits
mailing list