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 // 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