[riscv-port] RFR: 8281731: riscv: Refactor instruction extraction code in nativeInst_riscv.h/cpp

Xiaolin Zheng xlinzheng at openjdk.java.net
Mon Feb 14 10:34:57 UTC 2022

Hi team,

Could I have a review of this patch - this is just a trivial refactoring with some cleanups for `nativeInst_riscv.h/cpp` using `Assembler::extract()` with raw bits, by adding `extract_rs1`, `extract_rs2`, `extract_rd`, `extract_opcode`, and `extract_funct3` to make the code cleaner and conciser. Tested hotspot tier1 on Qemu with no other errors.



Commit messages:
 - A tiny cleanup for nativeInst_riscv.h/cpp
 - Refactor: add extract_rs1, extract_rs2, extract_rd, extract_opcode, and extract_funct3 instead of using raw bits to make code more intuitive

Changes: https://git.openjdk.java.net/riscv-port/pull/57/files
 Webrev: https://webrevs.openjdk.java.net/?repo=riscv-port&pr=57&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8281731
  Stats: 155 lines in 2 files changed: 49 ins; 20 del; 86 mod
  Patch: https://git.openjdk.java.net/riscv-port/pull/57.diff
  Fetch: git fetch https://git.openjdk.java.net/riscv-port pull/57/head:pull/57

PR: https://git.openjdk.java.net/riscv-port/pull/57

More information about the riscv-port-dev mailing list