Fix bit-manipulation reference pseudocode#3188
Open
Abhinav Agarwal (abhinavagarwal07) wants to merge 1 commit into
Open
Fix bit-manipulation reference pseudocode#3188Abhinav Agarwal (abhinavagarwal07) wants to merge 1 commit into
Abhinav Agarwal (abhinavagarwal07) wants to merge 1 commit into
Conversation
Normative Rule Changes DetectedThis PR modifies normatively tagged text. Please review the changes below to ensure they are intentional. View Detected ChangesNormative Tag Change Reportriscv-spec SpecificationWhat happens next:
How to update reference files (if needed): make update-ref
git add ref/*.json
git commit -m "Update normative tag reference files"
This comment was automatically generated by the normative tag check workflow. |
8edcc71 to
5ffa369
Compare
- brev8: loop bound sizeof(xlen) iterates one byte past the register; use (xlen - 8), matching rev8 and orc.b (zb.adoc, zk.adoc) - xperm8/xperm4: loop bound xlen overruns the result the same way; use (xlen - 8)/(xlen - 4) (zb.adoc, zk.adoc) - clzw: call the word helper HighestSetBit32 instead of the xlen-wide HighestSetBit, which returns negative for nonzero upper words on RV64 - ctz/ctzw: ascending 0..N loops are annotated `in dec` (zero iterations); use `in inc`, matching cpop/cpopw Signed-off-by: Abhinav Agarwal <abhinavagarwal1996@gmail.com>
5ffa369 to
05e28cb
Compare
Andrew Waterman (aswaterman)
approved these changes
Jun 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes a few small mistakes in the bit-manipulation reference pseudocode:
brev8andxperm8/xperm4loops at the last in-range byte/nibbleclzwcall the 32-bit helper it defines, instead of the XLEN-wide helperctz/ctzwloops count upward, matching the prose and thecpop/cpopwpatternThese are text/pseudocode corrections only; they do not change the intended architectural behavior.