Skip to content

RVV trap-path tests, arch-test V coverage, and decode layout guard #735

Description

@jserv

Three follow-ups bundled because they are all about preventing RVV regressions; subdivide later if any one of them grows.

1. Trap-path smoke coverage

The current smoke harness (mk/tests.mk check-rvv-smoke matches tail -n 1 == \"RVV smoke OK\") cannot distinguish an intentional illegal-instruction trap from a generic abort, and tests/rvv-smoke.S already documents this gap at line ~739. Targets:

  • vd-vs-v0 overlap traps in masked segmented loads.
  • vrgather source/destination overlap traps.
  • vcompress non-zero vstart traps.
  • Fault-only-first mid-segment fault behavior (vl truncation vs trap on first active element).

Needs an mtvec / trap-handler scaffold in tests/rvv-smoke.S (or sibling) AND an updated check-test mechanism that asserts more than the last stdout line — exit-code assertions or marker strings.

2. riscv-arch-test V battery in CI

The existing arch-test plumbing (tests/arch-test-target/setup.py, tests/arch-test-target/rv32emu/rv32emu_isa.yaml) advertises RV32IMCZicsr_Zifencei and does not parse V. Work item is broader than "wire it up":

  • Teach the target plugin about the V extension.
  • Pull in the matching upstream test suite (commits/tag to be determined).
  • Add a CI job gated on CONFIG_EXT_V=y.

This catches spec-compliance regressions the smoke test cannot.

3. Cross-struct opcode-offset static_assert

try_fuse_sequence does memcpy(ir->fuse, ir, sizeof(opcode_fuse_t)), so rv_insn_t.opcode and opcode_fuse_t.opcode share their byte position by contract. Add static_assert(offsetof(rv_insn_t, opcode) == offsetof(opcode_fuse_t, opcode), \"...\") in src/decode.h. CHANGELOG.md (2026-05-16: RVV Build and Opcode Layout Fixes) documents the regression that motivated this guard.

Tracked under the umbrella issue #504.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions