aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@sifive.com>2025-10-06 19:34:55 -0700
committerGitHub <noreply@github.com>2025-10-06 19:34:55 -0700
commit08078fb359b68d88ee3edbb01a910af7b8cde548 (patch)
tree10f3c5cac37e5e73fdf1de07df3804d507dfccec /llvm/lib/Target
parentc410e88f0f8c0654d7744d6d029009f9cb736143 (diff)
downloadllvm-08078fb359b68d88ee3edbb01a910af7b8cde548.zip
llvm-08078fb359b68d88ee3edbb01a910af7b8cde548.tar.gz
llvm-08078fb359b68d88ee3edbb01a910af7b8cde548.tar.bz2
[RISCV] Fix copy/paste mistake in Sh3Add_UWPat. (#161923)
This pattern is a copy of the pattern in Sh3AddPat but using sh3add.uw instead of sh3add. This is a mistake and the pattern should be the equivalent of the first pattern from Sh1Add_UWPat and Sh2Add_UWPat. These classes were created to share with Andes in a788a1abd9c88, but there was so many test changes in there that we must have overlooked the changes to Zba codegen.
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/RISCV/RISCVInstrInfoZb.td4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoZb.td b/llvm/lib/Target/RISCV/RISCVInstrInfoZb.td
index ce21d83..8d9b777 100644
--- a/llvm/lib/Target/RISCV/RISCVInstrInfoZb.td
+++ b/llvm/lib/Target/RISCV/RISCVInstrInfoZb.td
@@ -808,9 +808,9 @@ multiclass Sh2Add_UWPat<Instruction sh2add_uw> {
}
multiclass Sh3Add_UWPat<Instruction sh3add_uw> {
- def : Pat<(i64 (add_like_non_imm12 (and GPR:$rs1, 0xFFFFFFF8),
+ def : Pat<(i64 (add_like_non_imm12 (and (shl GPR:$rs1, (i64 3)), 0x7FFFFFFFF),
(XLenVT GPR:$rs2))),
- (sh3add_uw (XLenVT (SRLIW GPR:$rs1, 3)), GPR:$rs2)>;
+ (sh3add_uw GPR:$rs1, GPR:$rs2)>;
// Use SRLI to clear the LSBs and SHXADD_UW to mask and shift.
def : Pat<(i64 (add_like_non_imm12 (and GPR:$rs1, 0x7FFFFFFF8),
(XLenVT GPR:$rs2))),