Skip to content

[hardware] 🐛 Use SEW bits of rs1 in widening .vx/.wx instructions - #514

Open
davidharrishmc wants to merge 1 commit into
pulp-platform:mainfrom
davidharrishmc:fix/widening-vx-scalar
Open

davidharrishmc wants to merge 1 commit into
pulp-platform:mainfrom
davidharrishmc:fix/widening-vx-scalar

Conversation

@davidharrishmc

Copy link
Copy Markdown

Caution

This pull request was generated by an AI assistant (Claude Code) and has not been reviewed by a human. Please review it with that in mind.

Fixes #505. Widening .vx/.wx instructions now use only the low SEW bits of rs1, zero- or sign-extended like a vs1 element. The lanes replicate scalar_op at vtype.vsew, which is 2*SEW for widening operations, and the OpQueueConversionZExt2/SExt2 conversion applies only to vector operands, so the dispatcher extends rs1 itself.

Verification (Verilator, NrLanes=4, VLEN=512): 30 cases at SEW 8/16/32 (vwadd[u], vwsubu, vwmul[u/su], vwmacc[u/su/us] .vx, vwaddu.wx) with rs1 bits above SEW set, checked against the RVV 1.0 definitions: 30 wrong on main, all correct with this change.

Changelog

Fixed

Checklist

  • Automated tests pass (Ara's own test suite was not run; see Verification)
  • Changelog updated
  • Code style guideline is observed

The lanes replicate the scalar operand at the instruction's vtype.vsew, which is 2*SEW for
widening operations, and the ZExt2/SExt2 conversion applies only to vector operands, so rs1 bits
above SEW leaked into the result. Extend rs1[SEW-1:0] in the dispatcher the way vs1 would be.

Fixes pulp-platform#505

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: David Harris <David_Harris@hmc.edu>

This branch has not been deployed

No deployments
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.

Widening .vx/.wx instructions use rs1 bits above SEW

1 participant