[RISC-V] Add pseudo instruction not and replace xori when immediate is -1#117967
[RISC-V] Add pseudo instruction not and replace xori when immediate is -1#117967jakobbotsch merged 3 commits intodotnet:mainfrom
not and replace xori when immediate is -1#117967Conversation
There was a problem hiding this comment.
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
notpseudo instruction definition with appropriate encoding - Updates emitter to handle the new instruction alongside existing register-to-register operations
- Replaces
xori reg, reg, -1patterns with the more semantically clearnot reg, reginstruction
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
notand replacexoriwhen 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