[RISC-V] Added designated output instruction emitters#96741
Merged
jakobbotsch merged 120 commits intodotnet:mainfrom Jan 25, 2024
Merged
[RISC-V] Added designated output instruction emitters#96741jakobbotsch merged 120 commits intodotnet:mainfrom
jakobbotsch merged 120 commits intodotnet:mainfrom
Conversation
added 30 commits
December 15, 2023 15:19
This reverts commit c238b82.
sirntar
reviewed
Jan 12, 2024
sirntar
reviewed
Jan 15, 2024
jakobbotsch
reviewed
Jan 15, 2024
jakobbotsch
reviewed
Jan 15, 2024
jakobbotsch
reviewed
Jan 15, 2024
jakobbotsch
reviewed
Jan 15, 2024
jakobbotsch
reviewed
Jan 15, 2024
yurai007
approved these changes
Jan 23, 2024
tomeksowi
approved these changes
Jan 23, 2024
Comment on lines
+2285
to
+2286
| // This assert may be triggered by the untrimmed signed integers. Please refer to the TrimSigned helpers | ||
| assertCodeLength(imm21, 21); |
Member
There was a problem hiding this comment.
Maybe this should call TrimSigned instead? These helpers assert isValidSimm anyway.
Contributor
Author
There was a problem hiding this comment.
On this stage imm is unsigned since the sign extension has to be removed at this stage (explicitly done via TrimSigned functions or via LowerNBits etc.). This means that I should use isValidUimm or assertCodeLength and I think that the latter one is more versatile.
jakobbotsch
reviewed
Jan 25, 2024
Comment on lines
+2734
to
+2742
| static ssize_t LowerNBitsOfWord(ssize_t word) | ||
| { | ||
| BYTE* const dst = *dp; | ||
| BYTE* dstRW = *dp + writeableOffset; | ||
| BYTE* dstRW2 = dstRW + 4; // addr for updating gc info if needed. | ||
| const BYTE* const odstRW = dstRW; | ||
| const BYTE* const odst = *dp; | ||
| code_t code = 0; | ||
| instruction ins; | ||
| size_t sz; // = emitSizeOfInsDsc(id); | ||
| static_assert(MaskSize < 32, "Given mask size is bigger than the word itself"); | ||
| static_assert(MaskSize > 0, "Given mask size cannot be zero"); | ||
|
|
||
| assert(REG_NA == (int)REG_NA); | ||
| static constexpr size_t kMask = NBitMask(MaskSize); | ||
|
|
||
| insOpts insOp = id->idInsOpt(); | ||
| return word & kMask; | ||
| } |
Member
There was a problem hiding this comment.
Isn't it strange that MaskSize can only be up to 32 when the word is a 64 bit value?
jakobbotsch
approved these changes
Jan 25, 2024
Bajtazar
added a commit
to Bajtazar/runtime
that referenced
this pull request
Feb 7, 2024
…dotnet#96741)"" This reverts commit ecc044d.
jakobbotsch
pushed a commit
that referenced
this pull request
Feb 13, 2024
* [RISC-V] Fix mistakes in emitter * Revert "[RISC-V] Added designated output instruction emitters (#96741)" This reverts commit 77fd98c. * Revert "Revert "[RISC-V] Added designated output instruction emitters (#96741)"" This reverts commit ecc044d. * [RISC-V] Sync emitOutputIns with the latest ref branch * [RISC-V] Formatted code * [RISC-V] Fixes * [RISC-V] Fixed sign cast in assert code len * [RISC-V] Readed assert * [RISC-V] Fixed fence sanity check and removed fence_i --------- Co-authored-by: Dong-Heon Jung <clamp03@gmail.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
IMPORTANT: Before this PR could be merge, it requires changes from #96136This PR:
emitOutputInstrfunction in order to use a newly added emittersThis PR is a part of a larger scope of work aiming to move all output instruction emission to the
emitOutputInstrfrom theemitIns_*functionsPart of #84834
cc @wscho77 @HJLeee @clamp03 @JongHeonChoi @t-mustafin @gbalykov @viewizard @ashaurtaev @brucehoult @sirntar @yurai007 @tomeksowi