Skip to content

riscv: enforce the fixed rs2 field for LR.W and LR.D - #272

Merged
LekKit merged 1 commit into
LekKit:stagingfrom
carlosqwqqwq:fix/lr-rs2-reserved
Aug 12, 2026
Merged

riscv: enforce the fixed rs2 field for LR.W and LR.D#272
LekKit merged 1 commit into
LekKit:stagingfrom
carlosqwqqwq:fix/lr-rs2-reserved

Conversation

@carlosqwqqwq

Copy link
Copy Markdown

riscv: enforce the fixed rs2 field for LR.W and LR.D

Fixes #266

Commit message

riscv: enforce the fixed rs2 field for LR.W and LR.D

Description

The RISC-V LR.W and LR.D encodings require rs2=x0. RVVM currently dispatches non-zero rs2 encodings as valid load-reserved operations. Reject those reserved encodings before the alignment and reservation path while preserving legal LR controls.

Validation

  • Invalid D/W encodings and legal controls were run on native RV64, QEMU, interpreter, JIT, fixed interpreter, and fixed JIT paths.
  • The proposed change is limited to the two atomic LR helpers.
  • The result matrix for each lane is attached with the witness outputs.

@LekKit
LekKit merged commit 45a7cc6 into LekKit:staging Aug 12, 2026
15 checks passed
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.

RVVM executes reserved LR.W/LR.D encodings with non-zero rs2

2 participants