[PATCH] D50217: [RISCV] Add mnemonic alias: move, sbreak and scall.

Kito Cheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 2 20:08:36 PDT 2018


kito-cheng created this revision.
kito-cheng added reviewers: asb, apazos.
Herald added subscribers: llvm-commits, rkruppe, the_o, brucehoult, MartinMosbeck, rogfer01, mgrang, edward-jones, zzheng, jrtc27, shiva0217, niosHD, sabuasal, simoncook, johnrusso, rbar.

as title.


Repository:
  rL LLVM

https://reviews.llvm.org/D50217

Files:
  lib/Target/RISCV/RISCVInstrInfo.td
  test/MC/RISCV/rvi-aliases-valid.s


Index: test/MC/RISCV/rvi-aliases-valid.s
===================================================================
--- test/MC/RISCV/rvi-aliases-valid.s
+++ test/MC/RISCV/rvi-aliases-valid.s
@@ -193,3 +193,15 @@
 # CHECK-INST: sltiu a2, a3, 4
 # CHECK-ALIAS: sltiu a2, a3, 4
 sltu a2,a3,4
+
+# CHECK-INST: addi a2, a3, 0
+# CHECK-ALIAS: mv a2, a3
+move a2,a3
+
+# CHECK-INST: ebreak
+# CHECK-ALIAS: ebreak
+sbreak
+
+# CHECK-INST: ecall
+# CHECK-ALIAS: ecall
+scall
Index: lib/Target/RISCV/RISCVInstrInfo.td
===================================================================
--- lib/Target/RISCV/RISCVInstrInfo.td
+++ lib/Target/RISCV/RISCVInstrInfo.td
@@ -581,6 +581,14 @@
                 (SLTIU  GPR:$rd, GPR:$rs1, simm12:$imm12)>;
 }
 
+def : MnemonicAlias<"move", "mv">;
+
+// The SCALL and SBREAK instructions have been renamed to ECALL and EBREAK
+// User-Level ISA 2.1.
+// We still accpet the old name for backward compatibility like GNU toolchain.
+def : MnemonicAlias<"scall", "ecall">;
+def : MnemonicAlias<"sbreak", "ebreak">;
+
 //===----------------------------------------------------------------------===//
 // Pseudo-instructions and codegen patterns
 //


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50217.158899.patch
Type: text/x-patch
Size: 1168 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180803/e6726c6e/attachment.bin>


More information about the llvm-commits mailing list