aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorjiawei <jiawei@iscas.ac.cn>2021-11-15 11:03:42 +0800
committerNelson Chu <nelson.chu@sifive.com>2021-11-16 11:47:55 +0800
commit3d1cafa0c60f859940262af7852b21a42dd78ba1 (patch)
treeb80f2292a60b9442794b600dc6c635adf34236f0 /bfd
parentdfdba097767e42f5163aeb5a97c4aa0084d44457 (diff)
downloadgdb-3d1cafa0c60f859940262af7852b21a42dd78ba1.zip
gdb-3d1cafa0c60f859940262af7852b21a42dd78ba1.tar.gz
gdb-3d1cafa0c60f859940262af7852b21a42dd78ba1.tar.bz2
RISC-V: Scalar crypto instructions and operand set.
Add instructions in k-ext, some instruction in zbkb, zbkc is reuse from zbb,zbc, we just change the class attribute to make them both support. The 'aes64ks1i' and 'aes64ks2' instructions are present in both the Zknd and Zkne extensions on rv64. Add new operand letter 'y' to present 'bs' symbol and 'Y' to present 'rnum' symbolc for zkn instructions. Also add a new Entropy Source CSR define 'seed' located at address 0x015. bfd/ * elfxx-riscv.c (riscv_multi_subset_supports): Added support for crypto extension. gas/ *config/tc-riscv.c (enum riscv_csr_class): Added CSR_CLASS_ZKR. (riscv_csr_address): Checked for CSR_CLASS_ZKR. (validate_riscv_insn): Added y and Y for bs and rnum operands. (riscv_ip): Handle y and Y operands. include/ * opcode/riscv-opc.h: Added encodings of crypto instructions. Also defined new csr seed, which address is 0x15. * opcode/riscv.h: Defined OP_* and INSN_CLASS_* for crypto. opcodes/ * riscv-dis.c (print_insn_args): Recognized new y and Y operands. * riscv-opc.c (riscv_opcodes): Added crypto instructions.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/elfxx-riscv.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/bfd/elfxx-riscv.c b/bfd/elfxx-riscv.c
index 9879480..e2fb400 100644
--- a/bfd/elfxx-riscv.c
+++ b/bfd/elfxx-riscv.c
@@ -2180,6 +2180,31 @@ riscv_multi_subset_supports (riscv_parse_subset_t *rps,
return riscv_subset_supports (rps, "zbc");
case INSN_CLASS_ZBS:
return riscv_subset_supports (rps, "zbs");
+ case INSN_CLASS_ZBKB:
+ return riscv_subset_supports (rps, "zbkb");
+ case INSN_CLASS_ZBKC:
+ return riscv_subset_supports (rps, "zbkc");
+ case INSN_CLASS_ZBKX:
+ return riscv_subset_supports (rps, "zbkx");
+ case INSN_CLASS_ZBB_OR_ZBKB:
+ return (riscv_subset_supports (rps, "zbb")
+ || riscv_subset_supports (rps, "zbkb"));
+ case INSN_CLASS_ZBC_OR_ZBKC:
+ return (riscv_subset_supports (rps, "zbc")
+ || riscv_subset_supports (rps, "zbkc"));
+ case INSN_CLASS_ZKND:
+ return riscv_subset_supports (rps, "zknd");
+ case INSN_CLASS_ZKNE:
+ return riscv_subset_supports (rps, "zkne");
+ case INSN_CLASS_ZKNH:
+ return riscv_subset_supports (rps, "zknh");
+ case INSN_CLASS_ZKND_OR_ZKNE:
+ return (riscv_subset_supports (rps, "zknd")
+ || riscv_subset_supports (rps, "zkne"));
+ case INSN_CLASS_ZKSED:
+ return riscv_subset_supports (rps, "zksed");
+ case INSN_CLASS_ZKSH:
+ return riscv_subset_supports (rps, "zksh");
default:
rps->error_handler
(_("internal: unreachable INSN_CLASS_*"));