-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
riscv64: Add vconst
lowerings
#6324
Merged
Merged
Changes from 1 commit
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
867551a
riscv64: Use `LoadAddr` on `Load`/`Store`
afonso360 9b9268d
riscv64: Add I Type encoding
afonso360 e420731
riscv64: Add S Type encoding
afonso360 ac5fbd3
riscv64: Use `LoadAddr` on `VecLoad`/`VecStore`
afonso360 16687fa
riscv64: Add Const/Lable AModes
afonso360 0105eb8
riscv64: Add Label Address Generation
afonso360 df1bed7
riscv64: Add `vconst` support
afonso360 1048da3
riscv64: Use `unsigned_field_width` in encode
afonso360 5d1f8fe
riscv64: Use `WritableReg` in encode
afonso360 59b0983
riscv64: Deduplicate AMode formatting
afonso360 f3f2fd1
riscv64: Refcator VectorLoad/Store AMode Pattern matching
afonso360 c2a89d5
riscv64: Avoid passing `fp` and `sp` through the register allocator
afonso360 fabce61
riscv64: Fix `PCRel{Hi20,Lo12I}` relocation
afonso360 d8ae950
riscv64: Update PCRelLo12I Comment
afonso360 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
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.
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.
This feels backwards to me, but I think it's probably correct.
The instruction using Hi20 comes first, followed by the Lo12. So if the Hi20 label is at address
x
, then Lo12 is at addressx+4
.Based on that, if we want to compute the same address for both labels, I expected that either Hi20 should use
x+4
, or Lo12 should usex-4
.Of the two instructions, the one which actually examines the program counter is
auipc
, so I think we need to compute the offset relative to that instruction. So I think you are correct that it's Lo12 that needs adjustment.But I guess here we aren't given the address of the instruction, right?
offset
is the distance from this instruction to the address we want, or in other words,target_address - insn_address
. So ifinsn_address
isx-4
, thenoffset
istarget_address - (x - 4)
, which is equivalent to(target_address - x) + 4
.And that's what you've implemented. If there's a way to make the comment more clear that'd be fantastic, but I'm at least reasonably convinced that this is correct.
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.
Thank you for the additional comment, @afonso360!