mirror of
https://github.com/capstone-engine/capstone.git
synced 2026-10-12 02:11:43 +00:00
- Updated to LLVM-18
- Operands have now read/write access information
- Previously only the basic extensions and the compressed ISA was supported, now every extension supported by LLVM-18 also available (e.g. vector, crypto, ...)
- Changed register names
* FP Regs: Instead of `RISCV_REG_F<n>_32` and `RISCV_REG_F<n>_64`, they're named `RISCV_REG_F<n>_F`
and `RISCV_REG_F<n>_D` for n in `0..31`
- Added register names
* Vector registes and combinations thereof `RISCV_REG_V<n>[_V<n_i>]*`, examples
* `RISCV_REG_V21`
* `RISCV_REG_V9_V10`
* `RISCV_REG_V3_V4_V5`
* etc... up to 8-register combinations
* Half-percision (16-bit) FP registers `RISCV_REG_F<n>_H` for n in `0..31`
- Changed instruction names
* Instructions ending in `_AQ_RL` now end in `_AQRL`
- Added instruction names: massive amount, see `include/capstone/riscv.h`
- Added `dimm` and `csr` fields inside the union data of `cs_riscv_op`, with corresponding `riscv_op_type`
* `dimm` is used for instructions with FP immediates
* `csr` is used for instructions with CSR systrem registes
- Added ISA flags to turn ISA extensions on and off
46 lines
1.0 KiB
C
46 lines
1.0 KiB
C
/* Capstone Disassembly Engine */
|
|
/* RISC-V Backend By Rodrigo Cortes Porto <[email protected]> &
|
|
Shawn Chang <[email protected]>, HardenedLinux@2018 */
|
|
|
|
#ifdef CAPSTONE_HAS_RISCV
|
|
|
|
#include "../../utils.h"
|
|
#include "../../MCRegisterInfo.h"
|
|
#include "RISCVInstPrinter.h"
|
|
#include "RISCVMapping.h"
|
|
#include "RISCVModule.h"
|
|
#include "RISCVLinkage.h"
|
|
|
|
cs_err RISCV_global_init(cs_struct *ud)
|
|
{
|
|
MCRegisterInfo *mri;
|
|
mri = cs_mem_malloc(sizeof(*mri));
|
|
|
|
RISCV_init(mri);
|
|
ud->printer = RISCV_LLVM_printInstruction;
|
|
ud->printer_info = mri;
|
|
ud->getinsn_info = mri;
|
|
ud->disasm = RISCV_LLVM_getInstruction;
|
|
ud->post_printer = NULL;
|
|
|
|
ud->reg_name = RISCV_reg_name;
|
|
ud->insn_id = RISCV_get_insn_id;
|
|
ud->insn_name = RISCV_insn_name;
|
|
ud->group_name = RISCV_group_name;
|
|
|
|
return CS_ERR_OK;
|
|
}
|
|
|
|
cs_err RISCV_option(cs_struct *handle, cs_opt_type type, size_t value)
|
|
{
|
|
if (type == CS_OPT_SYNTAX) {
|
|
handle->syntax = (int)value;
|
|
} else if (type == CS_OPT_MODE) {
|
|
handle->mode = (cs_mode)value;
|
|
}
|
|
|
|
return CS_ERR_OK;
|
|
}
|
|
|
|
#endif
|