-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
8294492: RISC-V: Use li instead of patchable movptr at non-patchable callsites #10462
Changes from 1 commit
ba3cfab
d58e2a7
62cf62c
ad15d6b
4985dcf
60608a3
fe56ee0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -529,6 +529,8 @@ class MacroAssembler: public Assembler { | |
// mv | ||
void mv(Register Rd, address addr) { li(Rd, (int64_t)addr); } | ||
void mv(Register Rd, address addr, int32_t &offset) { | ||
// Split address into a lower 12-bit sign-extended offset and the remainder, | ||
// so that the offset could be encoded in jalr or load/store instruction. | ||
offset = ((int32_t)(uintptr_t)addr << 20) >> 20; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would you mind one more tweak here? Considering that the type of 'offset' is int32_t, I think it will be more readable here if we convert 'addr' into int64_t type instead of uintptr_t. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Of course. Also changed other uintptr_t usages to int64_t. |
||
li(Rd, (uintptr_t)addr - offset); | ||
} | ||
|
@@ -894,7 +896,7 @@ class MacroAssembler: public Assembler { | |
|
||
void rt_call(address dest, Register tmp = t0); | ||
|
||
void call(const address &dest, Register temp = t0) { | ||
void call(const address dest, Register temp = t0) { | ||
assert_cond(dest != NULL); | ||
assert(temp != noreg, "temp must not be empty register!"); | ||
int32_t offset = 0; | ||
|
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.
We should add necessary comment for this function, like:
"Split address into a lower 12-bit sign-extended offset and the remainder so that the offset could be encoded in jalr or load/store instruction."
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.
done - added.