Skip to content

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

Merged
jkotas merged 6 commits into
dotnet:mainfrom
sunlijun-610:main_part-2
Jul 2, 2024
Merged

[LoongArch64] Part-2:Add runtime assembly code (*.S) files in nativeaot.#104084
jkotas merged 6 commits into
dotnet:mainfrom
sunlijun-610:main_part-2

Conversation

@sunlijun-610

Copy link
Copy Markdown
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
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

@jkotas

jkotas commented Jun 27, 2024

Copy link
Copy Markdown
Member

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

@huoyaoyuan huoyaoyuan left a comment

Copy link
Copy Markdown
Member

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.

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

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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)

@shushanhf shushanhf Jul 2, 2024

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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

jkotas commented Jul 2, 2024

Copy link
Copy Markdown
Member

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

@shushanhf

Copy link
Copy Markdown
Contributor

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

OK, thanks.
I will review this PR now.

Comment thread src/coreclr/nativeaot/Runtime/loongarch64/AllocFast.S Outdated
Comment thread src/coreclr/nativeaot/Runtime/loongarch64/AllocFast.S Outdated
Comment thread src/coreclr/nativeaot/Runtime/loongarch64/ExceptionHandling.S Outdated
Comment thread src/coreclr/nativeaot/Runtime/loongarch64/ExceptionHandling.S Outdated
Comment thread src/coreclr/nativeaot/Runtime/loongarch64/ExceptionHandling.S Outdated
Comment thread src/coreclr/nativeaot/Runtime/loongarch64/ExceptionHandling.S Outdated
Comment thread src/coreclr/nativeaot/Runtime/loongarch64/ExceptionHandling.S Outdated
Comment thread src/coreclr/nativeaot/Runtime/loongarch64/ExceptionHandling.S Outdated

@shushanhf shushanhf left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread src/coreclr/nativeaot/Runtime/loongarch64/ExceptionHandling.S Outdated
Comment thread src/coreclr/nativeaot/Runtime/loongarch64/ExceptionHandling.S Outdated
Comment thread src/coreclr/nativeaot/Runtime/loongarch64/ExceptionHandling.S Outdated
Comment thread src/coreclr/nativeaot/Runtime/loongarch64/ExceptionHandling.S Outdated
Comment thread src/coreclr/nativeaot/Runtime/loongarch64/ExceptionHandling.S Outdated

@shushanhf shushanhf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

review the ExceptionHandling.S

Comment thread src/coreclr/nativeaot/Runtime/unix/unixasmmacrosloongarch64.inc Outdated
Comment thread src/coreclr/nativeaot/Runtime/unix/unixasmmacrosloongarch64.inc Outdated
Comment thread src/coreclr/nativeaot/Runtime/unix/unixasmmacrosloongarch64.inc Outdated

@shushanhf shushanhf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM
Thanks

@jkotas jkotas left a comment

Copy link
Copy Markdown
Member

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
@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