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

Add initial LoongArch64 CPU support #15628

Merged
merged 3 commits into from
Oct 4, 2023
Merged

Conversation

liushuyu
Copy link
Contributor

This pull request ports the D runtime to LoongArch64 CPU architecture.

LoongArch64 is a new CPU architecture and has been supported by GCC (since GCC 13) and LLVM/Clang (since LLVM 16).

You can find more information about this architecture here: https://loongson.github.io/LoongArch-Documentation/README-EN.html

@dlang-bot
Copy link
Contributor

Thanks for your pull request and interest in making D better, @liushuyu! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#15628"

@WalterBright
Copy link
Member

I'm puzzled. There's LoongArch64, LoongArch32, LoongArch_HardFloat, and LoongArch_SoftFloat. But the only one that is used is LoongArch64. I suggest not defining the others until there's a use case (otherwise we could define all kinds of architectures that we don't support, which is pointless).

@WalterBright
Copy link
Member

Other than that, I approve this.

@xen0n
Copy link

xen0n commented Sep 28, 2023

Yeah currently Linux only supports the 64-bit userland, and 32-bit LoongArch support is patchy right now. I'd agree with only defining LoongArch64 (and maybe the hard-float symbol) until use cases for the rest arise.

@ibuclaw
Copy link
Member

ibuclaw commented Sep 28, 2023

Something should perhaps be predefined though when the base architecture is !TARGET_64BIT in gdc/ldc backend, otherwise there is no indication that compiler is generating code for a LoongArch processor.

@liushuyu
Copy link
Contributor Author

Something should perhaps be predefined though when the base architecture is !TARGET_64BIT in gdc/ldc backend, otherwise there is no indication that compiler is generating code for a LoongArch processor.

I agree with that. Currently, GDC and LDC implementations for LoongArch32/64 architectures do use all those version identifiers.

@liushuyu
Copy link
Contributor Author

I have rebased this pull request against the latest master branch.

@liushuyu
Copy link
Contributor Author

liushuyu commented Oct 3, 2023

Hi,

What is the status of this pull request? Should I do something or tag someone for review?

@thewilsonator thewilsonator merged commit 2c4003b into dlang:master Oct 4, 2023
37 of 40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants