Enable bit-manipulation extensions to RISC-V #2544
Open
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.
In reference to #2539, this PR enables certain RISC-V ISA extensions in assembly passed to the
asm
function in pwntools. It simply adds thezba
,zbb
,zbc
, andzbs
extension strings to CLI arguments passed to the assembler.There is a long list of other ISA extensions outlined in this doc - https://gcc.gnu.org/onlinedocs/gcc/RISC-V-Options.html, but these 4 were chosen purely because they are general purpose and I happened to have run into them (many of the other ones are related to increasing performance of cryptographic functions or are SIMD-related).
The original issue mentions the possibility of exposing more functionality in the
asm()
function to allow the user to have more control over the assembler/compile process. In this case, as mentioned by @Arusekk in #2539, this is not needed. Currently, examples of where this would be nice don't immediately come to mind.