Skip to content

riscv: advance xperm8 output positions by one byte - #279

Merged
LekKit merged 1 commit into
LekKit:stagingfrom
carlosqwqqwq:fix/xperm8-byte-step
Aug 12, 2026
Merged

riscv: advance xperm8 output positions by one byte#279
LekKit merged 1 commit into
LekKit:stagingfrom
carlosqwqqwq:fix/xperm8-byte-step

Conversation

@carlosqwqqwq

Copy link
Copy Markdown

riscv: advance xperm8 output positions by one byte

Fixes #275

Commit message

riscv: advance xperm8 output positions by one byte

Description

riscv_bit_xperm8() advances its output position by four bits although each xperm8 element is one byte. The helper therefore writes overlapping byte results. Advance by eight bits so the identity-permutation and general byte controls have the architectural result.

Validation

  • The RV64 Zbkx witness, QEMU, and the recorded native/reference controls agree after the fix.
  • The proposed change is one source-line change in src/cpu/riscv_base.h.
  • The full result matrix is attached with the witness outputs.

@LekKit
LekKit merged commit cd8b13d 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.

RV64 xperm8 produces incorrect results in the current RVVM revision

2 participants