[PATCH] D95090: [RISCV] Modify add.uw patterns to put the masked operand in rs1 to match 0.93 bitmanip spec.
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 20 15:48:10 PST 2021
craig.topper updated this revision to Diff 318043.
craig.topper added a comment.
Rebase
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D95090/new/
https://reviews.llvm.org/D95090
Files:
llvm/lib/Target/RISCV/RISCVInstrInfoB.td
llvm/test/CodeGen/RISCV/rv64Zba.ll
Index: llvm/test/CodeGen/RISCV/rv64Zba.ll
===================================================================
--- llvm/test/CodeGen/RISCV/rv64Zba.ll
+++ llvm/test/CodeGen/RISCV/rv64Zba.ll
@@ -72,12 +72,12 @@
;
; RV64IB-LABEL: adduw:
; RV64IB: # %bb.0:
-; RV64IB-NEXT: add.uw a0, a0, a1
+; RV64IB-NEXT: add.uw a0, a1, a0
; RV64IB-NEXT: ret
;
; RV64IBA-LABEL: adduw:
; RV64IBA: # %bb.0:
-; RV64IBA-NEXT: add.uw a0, a0, a1
+; RV64IBA-NEXT: add.uw a0, a1, a0
; RV64IBA-NEXT: ret
%and = and i64 %b, 4294967295
%add = add i64 %and, %a
@@ -95,13 +95,13 @@
;
; RV64IB-LABEL: adduw_2:
; RV64IB: # %bb.0:
-; RV64IB-NEXT: add.uw a0, a1, a0
+; RV64IB-NEXT: add.uw a0, a0, a1
; RV64IB-NEXT: lb a0, 0(a0)
; RV64IB-NEXT: ret
;
; RV64IBA-LABEL: adduw_2:
; RV64IBA: # %bb.0:
-; RV64IBA-NEXT: add.uw a0, a1, a0
+; RV64IBA-NEXT: add.uw a0, a0, a1
; RV64IBA-NEXT: lb a0, 0(a0)
; RV64IBA-NEXT: ret
%3 = zext i32 %0 to i64
Index: llvm/lib/Target/RISCV/RISCVInstrInfoB.td
===================================================================
--- llvm/lib/Target/RISCV/RISCVInstrInfoB.td
+++ llvm/lib/Target/RISCV/RISCVInstrInfoB.td
@@ -836,7 +836,7 @@
(SLLIUW GPR:$rs1, uimm5:$shamt)>;
def : Pat<(shl (and GPR:$rs1, 0xFFFFFFFF), uimm5:$shamt),
(SLLIUW GPR:$rs1, uimm5:$shamt)>;
-def : Pat<(add GPR:$rs1, (and GPR:$rs2, (i64 0xFFFFFFFF))),
+def : Pat<(add (and GPR:$rs1, (i64 0xFFFFFFFF)), GPR:$rs2),
(ADDUW GPR:$rs1, GPR:$rs2)>;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D95090.318043.patch
Type: text/x-patch
Size: 1536 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210120/f004e076/attachment.bin>
More information about the llvm-commits
mailing list