-
Notifications
You must be signed in to change notification settings - Fork 5.1k
[RISC-V] Add pseudo instruction not
and replace xori
when immediate is -1
#117967
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a new pseudo instruction not
for RISC-V64 architecture to replace the previous approach of using xori
with immediate value -1 for bitwise NOT operations. This provides clearer semantics and potentially better code generation for bitwise NOT operations.
- Adds
not
pseudo instruction definition with appropriate encoding - Updates emitter to handle the new instruction alongside existing register-to-register operations
- Replaces
xori reg, reg, -1
patterns with the more semantically clearnot reg, reg
instruction
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
src/coreclr/jit/instrsriscv64.h | Adds the not pseudo instruction definition with encoding 0xFFF04013 |
src/coreclr/jit/emitriscv64.cpp | Updates emitter condition to include INS_not in register-to-register instruction handling |
src/coreclr/jit/codegenriscv64.cpp | Replaces two instances of xori with immediate -1 with the new not instruction |
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
@dotnet-policy-service agree |
It seems that the |
@risc-vv /run |
RISC-V Release-CLR-QEMU: 9092 / 9122 (99.67%)
report.xml, report.md, failures.xml, testclr_details.tar.zst RISC-V Release-CLR-VF2: 9093 / 9123 (99.67%)
report.xml, report.md, failures.xml, testclr_details.tar.zst RISC-V Release-FX-QEMU: 276936 / 278063 (99.59%)
report.xml, report.md, failures.xml, testclr_details.tar.zst RISC-V Release-FX-VF2: 301390 / 303141 (99.42%)
report.xml, report.md, failures.xml, testclr_details.tar.zst Build information and commandsGIT: |
@credo-quia-absurdum This wasn't a problem, rather a new feature introduced last week ;) |
@sirntar thanks for making the bot on-demand. A few possible future enhancements:
|
I'm currently testing this feature, so I expect it to be launched next week
Currently CI doesn't perform atoi tests at all... will add them in the future |
/azp run runtime |
Azure Pipelines successfully started running 1 pipeline(s). |
Add pseudo instruction
not
and replacexori
when immediate is -1As this is my first attempt at adding a new instruction, I might have overlooked certain parts (such as parts of the emitter implementation or validation in debug configuration). Any review or suggestion would be greatly appreciated.
@clamp03 @tomeksowi @SkyShield, @namu-lee
part of #84834, cc @dotnet/samsung