[RISCV][Lifting] Implement the atomic extension#6373
Draft
moste00 wants to merge 4 commits into
Draft
Conversation
This was referenced May 17, 2026
…riants of the instructions in it for 32-bit arch variant only, and add some tests
b871922 to
2504d42
Compare
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.
Your checklist for this pull request
RZ_APIfunction and struct this PR changes.RZ_API).Detailed description
Continues #6364. Implements the A extension of RISC-V "trivially", by ignoring all concurrency guards and gurantees in the spec since RzIL is a strictly sequential VM, all instructions defined by the extension therefore reduce to a simplified implementation.
Claude Code CLI was used to write some code under review and testing by me, I take responsiblity for all the code and bugs here, I use CCC as only a text editing multiplier.
Test plan
Testing this extension specifically could be challenging, since spawning threads is itself a syscall (which we don't model in RzIL), I'm not sure how can we execute multiple threads (if even sequentially) in RzIL VM.
Theoretically, executing threads one-after-the-other is a valid sequentially-consistent way to execute threads, but I'm not sure we can get to this point. It's also prone to deadlocks if threads share variables and wait on them.
So all-in-all, this extension will be a bit under-tested compared to the others, but I will still add regression testing in the
asmtest files.Closing issues
PR Stack Structure
This PR is the third of a 4-PR stack that lifts the IMAFD RISC-V archiecture plus some privileged instructions.
The following is a table for ease of navigation from any PR to any other, please filter by the commit(s) mentioned in the table when reviewing the diff in the "Files Changed" tab to avoid the noise of the base branches.
Because it's painful to maintain this stack manually with no Github or other tooling support, I won't grow it any further until one of those 4 PRs gets merged.
Depends-on: #6364