aboutsummaryrefslogtreecommitdiff
path: root/include/opcode/riscv.h
diff options
context:
space:
mode:
authorNelson Chu <nelson.chu@sifive.com>2020-12-02 17:18:35 +0800
committerNelson Chu <nelson.chu@sifive.com>2020-12-10 10:37:43 +0800
commit729a53530e86972d1143553a415db34e6e01d5d2 (patch)
treee8a27c9d6d7f0cd468a089616450dca0ef0e7e4e /include/opcode/riscv.h
parentcd6b05c1b2321cafe3ad9335aaa734a28f2a058e (diff)
downloadgdb-729a53530e86972d1143553a415db34e6e01d5d2.zip
gdb-729a53530e86972d1143553a415db34e6e01d5d2.tar.gz
gdb-729a53530e86972d1143553a415db34e6e01d5d2.tar.bz2
RISC-V: Control fence.i and csr instructions by zifencei and zicsr.
bfd/ * elfxx-riscv.c (riscv_ext_dont_care_version): New function. Return TRUE if we don't care the versions of the extensions. These extensions are added to the subset list for special purposes, with the explicit versions or the RISCV_UNKNOWN_VERSION versions. (riscv_parse_add_subset): If we do care the versions of the extension, and the versions are unknown, then report errors for the non-implicit extensions, and return directly for the implicit one. (riscv_arch_str1): Do not output i extension after e, and the extensions which versions are unknown. gas/ * config/tc-riscv.c (riscv_multi_subset_supports): Handle INSN_CLASS_ZICSR and INSN_CLASS_ZIFENCEI. * testsuite/gas/riscv/march-imply-i.s: New testcase. * testsuite/gas/riscv/march-imply-i2p0-01.d: New testcase. The version of i is less than 2.1, and zi* are supported in the chosen spec, so enable the fence.i and csr instructions, also output the implicit zi* to the arch string. * testsuite/gas/riscv/march-imply-i2p0-02.d: Likewise, but the zi* are not supported in the spec 2.2. Enable the related instructions since i's version is less than 2.1, but do not output them. * testsuite/gas/riscv/march-imply-i2p1-01.d: New testcase. The version of i is 2.1, so don't add it's implicit zi*, and disable the related instructions. * testsuite/gas/riscv/march-imply-i2p1-01.l: Likewise. * testsuite/gas/riscv/march-imply-i2p1-02.d: Likewise, and set the zi* explicitly, so enable the related instructions. * testsuite/gas/riscv/march-imply-i2p0.d: Removed. * testsuite/gas/riscv/march-imply-i2p1.d: Removed. include/ * opcode/riscv.h: Add INSN_CLASS_ZICSR and INSN_CLASS_ZIFENCEI. opcodes/ * riscv-opc.c (riscv_opcodes): Control fence.i and csr instructions by zifencei and zicsr.
Diffstat (limited to 'include/opcode/riscv.h')
-rw-r--r--include/opcode/riscv.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/opcode/riscv.h b/include/opcode/riscv.h
index 680780a..6a9fd4a 100644
--- a/include/opcode/riscv.h
+++ b/include/opcode/riscv.h
@@ -306,9 +306,11 @@ enum riscv_insn_class
INSN_CLASS_M,
INSN_CLASS_F,
INSN_CLASS_D,
- INSN_CLASS_D_AND_C,
- INSN_CLASS_F_AND_C,
INSN_CLASS_Q,
+ INSN_CLASS_F_AND_C,
+ INSN_CLASS_D_AND_C,
+ INSN_CLASS_ZICSR,
+ INSN_CLASS_ZIFENCEI,
};
/* This structure holds information for a particular instruction. */