aboutsummaryrefslogtreecommitdiff
path: root/opcodes
diff options
context:
space:
mode:
authorLifang Xia <lifang_xia@c-sky.com>2021-04-15 10:51:14 +0800
committerLifang Xia <lifang_xia@c-sky.com>2021-04-16 11:25:15 +0800
commita8ab20932084328fb48930c028b60a348c6644b3 (patch)
treea65f0a2cac4ebfa15f49f757ae66a319830b0408 /opcodes
parentad7c46164f2d558be9f34c1902430259eb00e62b (diff)
downloadbinutils-a8ab20932084328fb48930c028b60a348c6644b3.zip
binutils-a8ab20932084328fb48930c028b60a348c6644b3.tar.gz
binutils-a8ab20932084328fb48930c028b60a348c6644b3.tar.bz2
RISC-V: compress "addi d,CV,z" to "c.mv d,CV"
PR 27732 gas/ * testsuite/gas/riscv/c-zero-imm.d: Compress addi a4,a4,0 to c.mv a4,a4. * testsuite/gas/riscv/c-zero-imm.s: Likewise. opcodes/ * riscv-opc.c (riscv_opcodes): New insn alias for addi. Compress "addi d,CV,z" to "c.mv d,CV".
Diffstat (limited to 'opcodes')
-rw-r--r--opcodes/riscv-opc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/opcodes/riscv-opc.c b/opcodes/riscv-opc.c
index 1348ec7..f55a01b 100644
--- a/opcodes/riscv-opc.c
+++ b/opcodes/riscv-opc.c
@@ -276,6 +276,7 @@ const struct riscv_opcode riscv_opcodes[] =
{"addi", 0, INSN_CLASS_C, "d,CU,z", MATCH_C_NOP, MASK_C_ADDI|MASK_RVC_IMM, match_c_nop, INSN_ALIAS },
{"addi", 0, INSN_CLASS_C, "Cc,Cc,CL", MATCH_C_ADDI16SP, MASK_C_ADDI16SP, match_c_addi16sp, INSN_ALIAS },
{"addi", 0, INSN_CLASS_C, "d,Cz,Co", MATCH_C_LI, MASK_C_LI, match_rd_nonzero, INSN_ALIAS },
+{"addi", 0, INSN_CLASS_C, "d,CV,z", MATCH_C_MV, MASK_C_MV, match_c_add, INSN_ALIAS },
{"addi", 0, INSN_CLASS_I, "d,s,j", MATCH_ADDI, MASK_ADDI, match_opcode, 0 },
{"add", 0, INSN_CLASS_C, "d,CU,CV", MATCH_C_ADD, MASK_C_ADD, match_c_add, INSN_ALIAS },
{"add", 0, INSN_CLASS_C, "d,CV,CU", MATCH_C_ADD, MASK_C_ADD, match_c_add, INSN_ALIAS },