On Mon, 8 Jun 2026 15:31:01 GMT, Ilya Gavrilin <[email protected]> wrote:

> This small change enables support for the with-hsdis=capstone option for the 
> RISC-V target. 
> It could be done because libcapstone is available in apt repositories.
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

make/Hsdis.gmk line 52:

> 50:   else ifeq ($(call isTargetCpuArch, riscv), true)
> 51:     CAPSTONE_ARCH := CS_ARCH_RISCV
> 52:     CAPSTONE_MODE := CS_MODE_RISCV64

Thanks for this patch!
I also tested both cross-compilation and a native build, and both worked fine 
with this change.

Suggestion:

    CAPSTONE_MODE := 'CS_MODE_RISCV64|CS_MODE_RISCVC'


I have one small question: would it make sense to enable `CS_MODE_RISCVC` here 
as well?
On rv64gc boards, this can be observed easily with `java -version 
-XX:+UnlockDiagnosticVMOptions -XX:+PrintAssembly`: many compressed 
instructions are not decoded and are shown as `.byte` instead.

Although the RISC-V port wiki describes RV64G as the supported base 
configuration and lists RVC as an explicitly enabled feature, RVC is widely 
assumed in Linux-capable riscv64 environments today.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/31424#discussion_r3388332361

Reply via email to