-
Notifications
You must be signed in to change notification settings - Fork 5.1k
[LoongArch64] add the coreclr/unwinder/loongarch64
from the #62979.
#63489
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
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
Close & reopen for trigger CI |
Close & reopen for trigger CI |
1 similar comment
Close & reopen for trigger CI |
@shushanhf #62979 Has been merged. Does this need to be updated? Is there an unwinding specification somewhere? @janvorli Can you please review? |
@BruceForstall this is essentially a close clone of the same arm64 stuff, so it uses basically the same format of unwind info as arm64 (modulo the differences in register architecture). |
@shushanhf what was the reason for replacing |
Yes, the JIT unwind code implementation is basically a raw copy of the arm64 code right now. |
ContextRecord->Sp += 16 * (CurCode & 0x1f); | ||
} | ||
|
||
#if 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.
Is any of the code under #if 0
going to be used in the future? If not, it would be better to remove all the stuff under #if 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.
OK, I will delete them.
If needed in future, I will add them back.
Thanks
function, as an offset relative to the IamgeBase. | ||
|
||
FunctionEntry - Supplies the address of the function table entry for the | ||
specified function. If appropriate, this should have araeady been |
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.
specified function. If appropriate, this should have araeady been | |
specified function. If appropriate, this should have already been |
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.
Thanks.
function being unwound. | ||
|
||
FunctionEntry - Supplies the address of the function table entry for the | ||
specified function. If appropriate, this should have araeady been |
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.
specified function. If appropriate, this should have araeady been | |
specified function. If appropriate, this should have already been |
|
||
SpOffset - Specifies a stack offset. Positive values are simply used | ||
as a base offset. Negative values assume a predecrement behavior: | ||
a 0 offset is used for restoration, but the absoute value of the |
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.
a 0 offset is used for restoration, but the absoute value of the | |
a 0 offset is used for restoration, but the absolute value of the |
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.
Thanks
FRegOpcodes = (FloatSize + 8) / 16; | ||
HOpcodes = 4 * HBit; | ||
StackAdjustOpcodes = (Cr == 3) ? 1 : 0; | ||
if (Cr != 3 || LocalSize > 512) {///TODO for LOONGARCH64: 512 is smaller than real! |
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.
Should this TODO be handled in this PR?
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.
OK, I will amend it.
Thanks
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.
I will just delete the comment TODO
.
Here the 512
is just the JIT unwind info rather than the ISA's info.
Now the LoongArch64's implementation for JIT-unwind is referenced the arm64, althought we can redesign based on the LoongArch64's ISA which might be better.
FRegOpcodes = (FloatSize + 8) / 16; | ||
HOpcodes = HBit; | ||
StackAdjustOpcodes = (Cr == 3) ? 1 : 0; | ||
if (Cr != 3 || LocalSize > 512) {///TODO for LOONGARCH64: 512 is smaller than real! |
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.
Should this TODO be handled in this PR?
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.
OK, Thanks
|
||
CurrentOffset = 0; | ||
if (Cr == 3) { | ||
if (LocalSize <= 512) {///TODO for LOONGARCH64: 512 is smaller! |
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.
Should this TODO be handled in this PR?
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.
OK, thanks
} | ||
} | ||
while (LocalSize != 0) { | ||
Count = (LocalSize + 4087) % 4088 + 1;///TODO: should amend the LOONGARCH64 ! |
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.
Should this TODO be handled in this PR?
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.
ok, thanks
When I cloned it's |
Ah, I see, I was looking at an older state of the repo by accident, please ignore that comment then. |
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.
LGTM, thank you!
[LoongArch64] add the
coreclr/unwinder/loongarch64
from the #62979.