- What changed: Completed decode support for all remaining standard RISC-V instructions across the I/M/A/F/D/C extensions, fixed multiple long-standing immediate-extraction bugs in the compressed-instruction decoder, and added comprehensive test coverage.
- Why: The decoder previously returned
unimplemented_instructionfor RV64C integer loads/stores (c.ld,c.sd,c.ldsp,c.sdsp) and had no decode paths for any C.FP instructions (c.flw,c.fsw,c.fld,c.fsd, and their stack-pointer variants). Privileged system instructions (mret,sret,uret,wfi,sfence.vma) were misclassified as CSR operations, andfcvt.s.dwas missing from the RVF decoder.
- RVI:
decode_system()now correctly decodesmret,sret,uret,wfi, andsfence.vmaas system instructions instead of falling through to CSR logic. - Decoder:
infer_groups()tags the above mnemonics with the"system"group. - RVF: Added
fcvt.s.ddecode path forfunct5=01000, fmt=00, rs2=00001.
- Implemented
c.ld,c.sd,c.ldsp,c.sdspwith correct CL/CS/CI/CSS operand formatting and Capstone aliases (ld/sd). - Added correct immediate extractions in
decoder.rs:uimm_cldforc.ld/c.sduimm_cldspforc.ldspuimm_sdspforc.sdsp
- Implemented all 8 C.FP instructions:
c.fld,c.fsd,c.fldsp,c.fsdsp(gated on D extension)c.flw,c.fsw,c.flwsp,c.fswsp(gated on F extension, RV32 only)
- Extended
InstructionExtension::try_decode_compressedsignature withextensions: &Extensionsso the C extension can check F/D availability at decode time. - Updated all extension implementations (RVI, RVA, RVM, RVF, RVD, T-Head CMov) to match the new trait signature.
Fixed several bugs in decoder.rs that produced incorrect displacements for compressed load/store instructions:
uimm_cl/uimm_cs(used byc.lw/c.sw)uimm_css(used byc.swsp)uimm_fldsp/uimm_cldsp(used byc.fldsp/c.ldsp)
- Added 10+ new unit tests in
decoder.rscovering:fcvt.s.d- System privileged instructions
- RV64C (
c.ld,c.sd,c.ldsp,c.sdsp) - C.FP on RV32 and RV64
- Extension gating (C.FP rejected without F/D)
- Added E2E CLI test
test_riscv_new_compressed_instructions_decode. - Updated existing tests whose expectations were invalidated by the new decode paths:
test_rv64_only_compressed_families_report_unsupported_mode_on_rv32test_invalid_compressed_encoding_reports_failuretest_json_formatter_emits_data_pseudo_for_unsupported_compressed
- Removed dead code:
decode_c_unimplemented()and theunimplemented_instructionerror helper (no longer called anywhere).
- This change affects CLI compatibility promises.
- This change affects shared IR semantics or formatter behavior.
New mnemonics (
c.ld,c.sd,c.flw,c.fsw,c.fld,c.fsd, and stack variants) are now emitted instead of errors for previously-unhandled encodings. - This change affects public Rust API behavior.
- This change updates benchmark baselines, known differences, or support-matrix claims.
-
cargo test --workspace --all-features— 222 tests pass, 0 failures
- If this change adds or changes ISA/compatibility behavior, I added or updated parity coverage under
test/architectures/<arch>/test_cases.txt. - If this change adds or changes ISA/compatibility behavior, I added or updated Rust tests/golden/property coverage in the affected crate.
- If parity is intentionally incomplete, I updated
tests/differential/known-differences.tomlwith owner/expiry metadata instead of leaving the divergence undocumented.
- Follow-up work or accepted limitations:
- The existing
uimm_cl/uimm_cs/uimm_cssimmediate extractions contained latent bugs that were fixed as part of this PR. Existing test cases happened to use encodings where the bugs did not manifest (e.g.inst[6]=0andinst[11]=0), so no golden fixtures needed updating. - Capstone parity coverage for the new instructions is not yet present in
test_cases.txtbecausecstoolis not available in the current environment. Parity data should be regenerated once the Capstone binary is built.
- The existing