Skip to content

[hw][dispatcher] Tag full vd..vd+nf for segment loads/stores#454

Open
sjalloq wants to merge 1 commit intopulp-platform:mainfrom
sjalloq:fix-segment-load-eew-tracker
Open

[hw][dispatcher] Tag full vd..vd+nf for segment loads/stores#454
sjalloq wants to merge 1 commit intopulp-platform:mainfrom
sjalloq:fix-segment-load-eew-tracker

Conversation

@sjalloq
Copy link
Copy Markdown

@sjalloq sjalloq commented May 1, 2026

The per-vreg EEW tracker (eew_d[]) is updated when an instruction writes a destination vreg, but the existing loop only iterates over EMUL consecutive registers. Segment loads/stores write (NF+1)*EMUL consecutive vregs (vd, vd+1, ..., vd+nf at each EMUL group), so all but the base vd were left at the reset-default EW8.

Fix: when the op is a segment load/store (VLE/VLSE/VLXE/VSE/VSSE/VSXE with nf != 0), extend the tracker update loop to cover (nf+1)*EMUL consecutive vregs.

The bug was hidden in the existing rv64uv segment tests because VCLEAR (used as a defensive reset before each test) does vmv.v.i v_reg, 0 at the test's vsew, which side-effects the EEW tracker into the matching state for v_reg. Tests that lack this pre-tagging surface the bug.

Description of PR that completes issue here...

Changelog

Fixed

  • Description of changes

Added

  • Description of changes

Changed

  • Description of changes

Checklist

  • Automated tests pass
  • Changelog updated
  • Code style guideline is observed

Please check our contributing guidelines before opening a Pull Request.

The per-vreg EEW tracker (eew_d[]) is updated when an instruction
writes a destination vreg, but the existing loop only iterates over
EMUL consecutive registers. Segment loads/stores write (NF+1)*EMUL
consecutive vregs (vd, vd+1, ..., vd+nf at each EMUL group), so all
but the base vd were left at the reset-default EW8.

Fix: when the op is a segment load/store (VLE/VLSE/VLXE/VSE/VSSE/VSXE
with nf != 0), extend the tracker update loop to cover (nf+1)*EMUL
consecutive vregs.

The bug was hidden in the existing rv64uv segment tests because
VCLEAR (used as a defensive reset before each test) does
`vmv.v.i v_reg, 0` at the test's vsew, which side-effects the EEW
tracker into the matching state for v_reg. Tests that lack this
pre-tagging surface the bug.
@sjalloq
Copy link
Copy Markdown
Author

sjalloq commented May 1, 2026

This is the fix for #454

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant