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

initial Aarch64 support #16554

Merged
merged 1 commit into from
Sep 6, 2024
Merged

initial Aarch64 support #16554

merged 1 commit into from
Sep 6, 2024

Conversation

WalterBright
Copy link
Member

Only works for a trivial function: void foo() { }

This is here mainly to ensure it stays in sync with the master branch as both evolve, and to not break the master.

Added undocumented -arm command line switch to enable it.

@WalterBright WalterBright added Review:WIP Work In Progress - not ready for review or pulling Arch:Aarch64 Issues specific to Arm 64 labels Jun 3, 2024
@WalterBright WalterBright requested a review from ibuclaw as a code owner June 3, 2024 00:04
@dlang-bot
Copy link
Contributor

Thanks for your pull request, @WalterBright!

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#16554"

@WalterBright WalterBright force-pushed the arm branch 10 times, most recently from 4acce51 to a8423cd Compare June 3, 2024 07:12
Comment on lines 32 to 35
import dmd.backend.code;
import dmd.backend.arm.cod3;
import dmd.backend.x86.code_x86;
Copy link
Member

Choose a reason for hiding this comment

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

I can't see you getting far mixing different architectures like this.

Copy link
Member

@ibuclaw ibuclaw Jun 3, 2024

Choose a reason for hiding this comment

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

In case this comes across as an unactionable comment. To clarify, changes like this make it quite clear that a lot more work needs to go into separation of IR and target modules in the back-end before the introduction of any new architecture can be done (sans this kind of spaghetti imports).

That alone would make introducing any new foreign architecture into dmd more palatable.

Copy link
Member Author

Choose a reason for hiding this comment

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

A good chunk of the code between the two will be identical. It's a balance between having them being totally separate and sharing common code. I don't know just where that balance will be, it will become apparent after I make more progress.

Copy link
Contributor

Choose a reason for hiding this comment

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

Having every architecture depend on every other architecture is not sustainable. Isn't contributing a new architecture hard enough without technical debt like this?

Copy link
Member Author

Choose a reason for hiding this comment

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

It won't be clear where the separation should be until I make much more progress.

@WalterBright WalterBright force-pushed the arm branch 13 times, most recently from 884e745 to bff911e Compare June 9, 2024 03:01
@WalterBright WalterBright force-pushed the arm branch 3 times, most recently from 5efb695 to 1f68251 Compare August 31, 2024 18:40
@WalterBright
Copy link
Member Author

How does disasm86.d, with its last commit 2 weeks ago, suddenly start failing the LDC Ubuntu run of its unittests?

a746142

core.exception.AssertError@src/dmd/backend/x86/disasm86.d(3760): Assertion failure

@WalterBright WalterBright force-pushed the arm branch 9 times, most recently from 0ce321e to 1dfbe08 Compare September 5, 2024 02:42
@WalterBright
Copy link
Member Author

The LDC Ubuntu test is now working again, though I still have made no changes in that direction.

@WalterBright WalterBright force-pushed the arm branch 2 times, most recently from c6ba646 to 80e33d8 Compare September 6, 2024 07:40
@WalterBright
Copy link
Member Author

The LDC Ubuntu is back to failing again.

@tgehr
Copy link
Contributor

tgehr commented Sep 6, 2024

In target.d:

426 | isX86 = !isX86_64;

Looks wrong.

@WalterBright WalterBright force-pushed the arm branch 2 times, most recently from 16509ca to ec94ef1 Compare September 6, 2024 20:18
@WalterBright
Copy link
Member Author

@tgehr the process of setting those variables is an ugly tangle that I had only partially straightened out. I added an assert that it was set up correctly.

@WalterBright
Copy link
Member Author

P.S. I fixed the heisenbug in the disasm86 code.

@WalterBright WalterBright merged commit 01518c3 into dlang:master Sep 6, 2024
41 checks passed
@WalterBright WalterBright deleted the arm branch September 6, 2024 22:36
WalterBright added a commit to WalterBright/dmd that referenced this pull request Sep 7, 2024
@tgehr
Copy link
Contributor

tgehr commented Sep 7, 2024

@tgehr the process of setting those variables is an ugly tangle that I had only partially straightened out. I added an assert that it was set up correctly.

isX86 = !isX86_64;
assert(isX86 + isX86_64 + isAArch64 == 1); // there can be only one

This assertion is equivalent to assert(!isAArch64).

thewilsonator pushed a commit to thewilsonator/dmd that referenced this pull request Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arch:Aarch64 Issues specific to Arm 64 Compiler:Backend glue code, optimizer, code generation Review:WIP Work In Progress - not ready for review or pulling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants