From 79236cc57ae136806fb05b2429611e6a99cf33e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D9=85=D8=B5=D8=B7=D9=81=D9=8A=20=D9=85=D8=AD=D9=85=D9=88?= =?UTF-8?q?=D8=AF=20=D9=83=D9=85=D8=A7=D9=84=20=D8=A7=D9=84=D8=AF=D9=8A?= =?UTF-8?q?=D9=86?= <48567303+moste00@users.noreply.github.com> Date: Sat, 10 Jan 2026 20:59:58 +0200 Subject: [PATCH 1/3] added RISCV release notes --- docs/cs_v6_release_guide.md | 47 ++++++++++++++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/docs/cs_v6_release_guide.md b/docs/cs_v6_release_guide.md index adc3a0d392..5acfc0a348 100644 --- a/docs/cs_v6_release_guide.md +++ b/docs/cs_v6_release_guide.md @@ -12,6 +12,7 @@ Almost all the work was sponsored by [RizinOrg](https://rizin.re/). This release The developers with the biggest contributions were (alphabetically): - `TriCore` - @billow (Sponsored) - `LoongArch` - @jiegec and @FurryAcetylCoA +- `RISC-V` - @moste00 (Sponsored) - `Alpha`, `HPPA` - @R33v0LT (Sponsored) - `AArch64`, `ARM`, `Auto-Sync`, `PPC`, `SystemZ`, modernized testing - @Rot127 (Sponsored) - `Mips`, `NanoMips` - @wargio @@ -22,7 +23,7 @@ There are also multiple smaller additions - Architecture module registration - @oleavr - Building of thin binaries for Apple - @rickmark - Python packaging and testing - @twizmwazin, @peace-maker -- `RISCV` operand access info - @wxrdnx +- `RISC-V` operand access info - @wxrdnx And of course there were many more improvements done by other contributors, which add to the release just as the ones above. For a full list of all the developers, please see the release page. @@ -31,7 +32,7 @@ With all that said, we hope you enjoy the new release! ## Overview -For `v6` we _updated_ the following architectures: `ARM`, `AArch64`, `Mips` (adding `NanoMips`!), `SystemZ`, `PPC`. +For `v6` we _updated_ the following architectures: `ARM`, `AArch64`, `Mips` (adding `NanoMips`!), `RISC-V`, `SystemZ`, `PPC`. And added support for several more: `TriCore` (already in `v5`), `Alpha`, `HPPA`, `LoongArch`. These updates are significant! While in `v5` the most up-to-date module was based on `LLVM 7`, @@ -192,9 +193,49 @@ Nonetheless, we hope this additional information is useful to you. asm text. For example the instruction `fcmpeq %fcc2, %f0, %f4` has 2 not 3 operands. Operands are the two registers `f0` and `f4` and the `cc_field` is set to `SPARC_CC_FIELD_FCC0`. -**RISCV** +**RISC-V** +- 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_32` and `RISCV_REG_F_64`, they're named `RISCV_REG_F_F` + and `RISCV_REG_F_D` for n in `0..31` +- Added register names + * Vector registes and combinations thereof `RISCV_REG_V[_V]*`, 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_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 + * `CS_MODE_RISCV_FD = 1 << 3` + * `CS_MODE_RISCV_V = 1 << 4` + * `CS_MODE_RISCV_ZFINX = 1 << 5` + * `CS_MODE_RISCV_ZCMP_ZCMT_ZCE = 1 << 6` + * `CS_MODE_RISCV_ZICFISS = 1 << 7` + * `CS_MODE_RISCV_E = 1 << 8` + * `CS_MODE_RISCV_A = 1 << 9` + * `CS_MODE_RISCV_COREV = 1 << 10` + * `CS_MODE_RISCV_THEAD = 1 << 11` + * `CS_MODE_RISCV_SIFIVE = 1 << 12` + * `CS_MODE_RISCV_BITMANIP = 1 << 13` + * `CS_MODE_RISCV_ZBA = 1 << 14` + * `CS_MODE_RISCV_ZBB = 1 << 15` + * `CS_MODE_RISCV_ZBC = 1 << 16` + * `CS_MODE_RISCV_ZBKB = 1 << 17` + * `CS_MODE_RISCV_ZBKC = 1 << 18` + * `CS_MODE_RISCV_ZBKX = 1 << 19` + * `CS_MODE_RISCV_ZBS = 1 << 20` + * NOTE1: All extensions above are disabled by default unless enabled by their option name or the corresponding command line flag in cstool. Any other extension is always enabled and can't be disabled. + + * NOTE2: RISC-V has a massive, sprawling list of extensions, but Capstone's internal implementaton choice of using a 32-bit mode field is not enough to cover all of them. For now, those extension flags above were added because their encoding space is conflicting with either each other or other extensions. More flags can be added later if bug reports come in requesting finer-grained extension control. However, the current implementation using bitfields imposes a strict upper limit and would likely be refactored for a more expansive mechanism in the future. See [this issue](https://github.com/capstone-engine/capstone/issues/2848) for more details. **Xtensa** From 59320f766c505a6b95c227645ab1d56578b69940 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D9=85=D8=B5=D8=B7=D9=81=D9=8A=20=D9=85=D8=AD=D9=85=D9=88?= =?UTF-8?q?=D8=AF=20=D9=83=D9=85=D8=A7=D9=84=20=D8=A7=D9=84=D8=AF=D9=8A?= =?UTF-8?q?=D9=86?= <48567303+moste00@users.noreply.github.com> Date: Wed, 21 Jan 2026 23:35:15 +0200 Subject: [PATCH 2/3] minor note change --- docs/cs_v6_release_guide.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/cs_v6_release_guide.md b/docs/cs_v6_release_guide.md index 5acfc0a348..68e9838b62 100644 --- a/docs/cs_v6_release_guide.md +++ b/docs/cs_v6_release_guide.md @@ -233,9 +233,11 @@ Nonetheless, we hope this additional information is useful to you. * `CS_MODE_RISCV_ZBKC = 1 << 18` * `CS_MODE_RISCV_ZBKX = 1 << 19` * `CS_MODE_RISCV_ZBS = 1 << 20` - * NOTE1: All extensions above are disabled by default unless enabled by their option name or the corresponding command line flag in cstool. Any other extension is always enabled and can't be disabled. - - * NOTE2: RISC-V has a massive, sprawling list of extensions, but Capstone's internal implementaton choice of using a 32-bit mode field is not enough to cover all of them. For now, those extension flags above were added because their encoding space is conflicting with either each other or other extensions. More flags can be added later if bug reports come in requesting finer-grained extension control. However, the current implementation using bitfields imposes a strict upper limit and would likely be refactored for a more expansive mechanism in the future. See [this issue](https://github.com/capstone-engine/capstone/issues/2848) for more details. + > [!NOTE] + > All extensions above are disabled by default unless enabled by their option name or the corresponding command line flag in cstool. Any other extension is always enabled and can't be disabled. + + > [!NOTE] + > RISC-V has a massive, sprawling list of extensions, but Capstone's internal implementaton choice of using a 32-bit mode field is not enough to cover all of them. For now, those extension flags above were added because their encoding space is conflicting with either each other or other extensions. More flags can be added later if bug reports come in requesting finer-grained extension control. However, the current implementation using bitfields imposes a strict upper limit and would likely be refactored for a more expansive mechanism in the future. See [this issue](https://github.com/capstone-engine/capstone/issues/2848) for more details. **Xtensa** From aad61b37983512ed0c8962043c7f9a39c78ecf52 Mon Sep 17 00:00:00 2001 From: Rot127 <45763064+Rot127@users.noreply.github.com> Date: Wed, 21 Jan 2026 21:40:24 +0000 Subject: [PATCH 3/3] Update indentation --- docs/cs_v6_release_guide.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/cs_v6_release_guide.md b/docs/cs_v6_release_guide.md index 68e9838b62..f5432f9735 100644 --- a/docs/cs_v6_release_guide.md +++ b/docs/cs_v6_release_guide.md @@ -233,11 +233,12 @@ Nonetheless, we hope this additional information is useful to you. * `CS_MODE_RISCV_ZBKC = 1 << 18` * `CS_MODE_RISCV_ZBKX = 1 << 19` * `CS_MODE_RISCV_ZBS = 1 << 20` - > [!NOTE] - > All extensions above are disabled by default unless enabled by their option name or the corresponding command line flag in cstool. Any other extension is always enabled and can't be disabled. + +> [!NOTE] +> All extensions above are disabled by default unless enabled by their option name or the corresponding command line flag in cstool. Any other extension is always enabled and can't be disabled. - > [!NOTE] - > RISC-V has a massive, sprawling list of extensions, but Capstone's internal implementaton choice of using a 32-bit mode field is not enough to cover all of them. For now, those extension flags above were added because their encoding space is conflicting with either each other or other extensions. More flags can be added later if bug reports come in requesting finer-grained extension control. However, the current implementation using bitfields imposes a strict upper limit and would likely be refactored for a more expansive mechanism in the future. See [this issue](https://github.com/capstone-engine/capstone/issues/2848) for more details. +> [!NOTE] +> RISC-V has a massive, sprawling list of extensions, but Capstone's internal implementaton choice of using a 32-bit mode field is not enough to cover all of them. For now, those extension flags above were added because their encoding space is conflicting with either each other or other extensions. More flags can be added later if bug reports come in requesting finer-grained extension control. However, the current implementation using bitfields imposes a strict upper limit and would likely be refactored for a more expansive mechanism in the future. See [this issue](https://github.com/capstone-engine/capstone/issues/2848) for more details. **Xtensa**