-
-
Notifications
You must be signed in to change notification settings - Fork 264
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
Add initial support for LoongArch64 #4500
Conversation
@@ -765,6 +765,14 @@ void registerPredefinedTargetVersions() { | |||
case llvm::Triple::wasm64: | |||
VersionCondition::addPredefinedGlobalIdent("WebAssembly"); | |||
break; | |||
case llvm::Triple::loongarch32: |
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.
you have the 32-bit version here, but in most other locations you only support 64bit, e.g. in TargetABI::getTarget()
and getTargetCPU
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.
you have the 32-bit version here, but in most other locations you only support 64bit, e.g. in
TargetABI::getTarget()
andgetTargetCPU
This is because 32-bit LoongArch is still tentative, and there is no real hardware for this specification.
I have added a tentative implementation for LoongArch32 now, but since the 32-bit ABI specification is not stable, I will not include an implementation for it in TargetABI::getTarget()
.
7a53134
to
a47e2e4
Compare
New changes since the last push:
|
All CI tests have successfully passed. |
IndirectByvalRewrite indirectByvalRewrite{}; | ||
|
||
public: | ||
auto returnInArg(TypeFunction *tf, bool) -> bool override { |
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.
nitpick: is there any benefit to this auto .... -> bool
over bool ...
? We don't really use this syntax in LDC's codebase anywhere else.
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.
nitpick: is there any benefit to this
auto .... -> bool
overbool ...
? We don't really use this syntax in LDC's codebase anywhere else.
When I run clang-tidy
on my changes, it tells me to use this expression instead of bool func_name(args...)
.
I do notice you have a .clang-tidy
configuration in the project root. Perhaps that configuration makes clang-tidy
to add this specific lint? (I am using Clang 16 on my system).
The PR looks good to me. Tests are missing, perhaps good to have at least one test for the triple and ABI ? |
Will do in a bit. |
Done. Let's see if CI will pick it up. |
CI passed without issue and the new test was picked up by CIs that running with LLVM 16 |
case "LoongArch32": | ||
case "LoongArch64": | ||
case "LoongArch_HardFloat": | ||
case "LoongArch_SoftFloat": |
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'd get this with the next frontend merge automatically, after your upstream PR has been merged. But is okay (we usually guard LDC-specific frontends mods in version (IN_LLVM)
for future merge conflicts).]
Hi, DMD upstream has merged the LoongArch support for the D runtime. Do you want me to do a merge, or do you want to do it yourself? |
not adding it to release notes, because runtime support is lacking and will only come with dlang 2.106 |
Thank u ;) |
This pull request ports the LDC compiler to LoongArch64 CPU architecture.
LoongArch64 is a new CPU architecture and has been supported by LLVM/Clang since LLVM 16.
You can find more information about this architecture here: https://loongson.github.io/LoongArch-Documentation/README-EN.html.
The port for D runtime is also in progress at dlang/dmd#15628.