Skip to content
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

[LoongArch64] Part-2:Add runtime assembly code (*.S) files in nativeaot. #104084

Merged
merged 6 commits into from
Jul 2, 2024

Conversation

sunlijun-610
Copy link
Contributor

This PR is the second part adding nativeaot support on LoongArch64.
It adds runtime assembly code (*.S) files.

@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Jun 27, 2024
Copy link
Contributor

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

@jkotas
Copy link
Member

jkotas commented Jun 27, 2024

@shushanhf @huoyaoyuan Could you please review and signoff on this PR?

Copy link
Member

@huoyaoyuan huoyaoyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have limited knowledge on LA64 asm. Here are some points I don't understand or can be improved for consistency.

src/coreclr/nativeaot/Runtime/loongarch64/AllocFast.S Outdated Show resolved Hide resolved
src/coreclr/nativeaot/Runtime/loongarch64/AllocFast.S Outdated Show resolved Hide resolved
src/coreclr/nativeaot/Runtime/loongarch64/AllocFast.S Outdated Show resolved Hide resolved
src/coreclr/nativeaot/Runtime/loongarch64/AllocFast.S Outdated Show resolved Hide resolved
src/coreclr/nativeaot/Runtime/loongarch64/PInvoke.S Outdated Show resolved Hide resolved
src/coreclr/nativeaot/Runtime/loongarch64/PInvoke.S Outdated Show resolved Hide resolved
src/coreclr/nativeaot/Runtime/loongarch64/AllocFast.S Outdated Show resolved Hide resolved
src/coreclr/nativeaot/Runtime/loongarch64/AllocFast.S Outdated Show resolved Hide resolved
src/coreclr/nativeaot/Runtime/loongarch64/WriteBarriers.S Outdated Show resolved Hide resolved
// by the linker (GD->IE/LE relaxation).
//la.local $a0, \var //
//ld.d \target, $a0, 0 //
//.tlsdesccall \var //TODO-LOONGARCH64
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anything preventing fixing this TODO?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TLSDESC is a new feature on LoongArch that is not yet supported in LLVM, so that .tlsdesccall is not defined yet.
LLVM is expected to support TLS in a few months, and we need to wait for LLVM support before fixing it.
Do I need to delete this TODO?
Thanks!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is fine to keep the TODO, but it should explain when it is about. E.g. TODO-LOONGARCH64: Fix once TLSDESC is supported by LLVM (add link to LLVM tracking issue if there is one)

Copy link
Contributor

@shushanhf shushanhf Jul 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sunlijun-610 maybe the LLVM had merged the LA64's TLS patch.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I will add the note of TODO first.
And I will ask the leader of LoongArch LLVM project. If the LA64's TLS patch has been already merged, I will fix it as soon as possible.
Thanks!

@jkotas jkotas requested a review from shushanhf July 2, 2024 05:41
@jkotas
Copy link
Member

jkotas commented Jul 2, 2024

@shushanhf Could you please sign-off on this PR?

@shushanhf
Copy link
Contributor

@shushanhf Could you please sign-off on this PR?

OK, thanks.
I will review this PR now.

Copy link
Contributor

@shushanhf shushanhf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The atomic will be added next comment.

Copy link
Contributor

@shushanhf shushanhf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

review the ExceptionHandling.S

Copy link
Contributor

@shushanhf shushanhf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Thanks

Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@jkotas jkotas merged commit 745b776 into dotnet:main Jul 2, 2024
87 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Aug 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-loongarch64 area-NativeAOT-coreclr community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants