Skip to content

Fixes for arm64#1691

Closed
anmolsahoo25 wants to merge 7 commits intooxcaml:mainfrom
anmolsahoo25:fixes-arm64
Closed

Fixes for arm64#1691
anmolsahoo25 wants to merge 7 commits intooxcaml:mainfrom
anmolsahoo25:fixes-arm64

Conversation

@anmolsahoo25
Copy link
Copy Markdown
Contributor

This PR proposes patches that enable the main branch to be compiled and tested on arm64 machines.

Summary of changes -

  1. Fixed async exceptions
  2. Implemented local allocations
  3. Fixed failing test cases - regalloc_validator

Notes -

  1. The regalloc_validator test case "Location can't be unknown after allocation" is failing on arm64 because the unknown register is different from amd64 "V/68" instead of "V/53". Still investigating this error.
  2. Disabled simd and unboxed-primitive-args tests on arm64 as the -msse4.2 flag causes compilation errors for the stubs.
  3. I am not aware of the CI process so I haven't updated any CI related files for arm64.

Apologies if I am not adhering to general PR guidelines. It's my first PR and I am open to feedback!

The following tests - tests/lib-systhreads/eintr.ml and
tests/async-exns/async_exns_1 were failing.

This patch loads the trap ptr into Caml_state->async_exception_pointer in
arm64.S which fixes the test cases.
This patch implements local allocation by adding code emission for local
allocation, regions and assembly routine for calling stack relocation.
The tests/backend/regalloc_validator test was failing because register names
were hard-coded for amd64. Created a new test with arm64 names to fix this and
modified the dune file to enable the respective tests on each platform.
@xclerc
Copy link
Copy Markdown
Contributor

xclerc commented Aug 4, 2023

Thanks for the pull request!
(Please bear with us, it may take
a bit of time to review.)

About note 1, I will have a closer
look, but it is not necessarily
surprising you get different stamps.

@anmolsahoo25
Copy link
Copy Markdown
Contributor Author

Of course, please take your time.

Partially reverts commit 4a29540.
The previous commit disabled the test on arm64 in the upstream
testsuite, which was not necessary.
Syncs the backend/arm64/emit.mlp changes with upstream
asmcomp/arm64/emit.mlp for local allocation. This
was missed in a previous commit.
Copy link
Copy Markdown
Member

@TheNumbat TheNumbat left a comment

Choose a reason for hiding this comment

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

Approving the SIMD tests, will leave it to @xclerc to look over the regalloc validator change.

@mshinwell
Copy link
Copy Markdown
Collaborator

@anmolsahoo25 could you please confirm here that you agree to the contents of the Developer Certificate of Origin (https://developercertificate.org/)?

@anmolsahoo25
Copy link
Copy Markdown
Contributor Author

I have read and agree to the contents of https://developercertificate.org/.

@mshinwell
Copy link
Copy Markdown
Collaborator

@anmolsahoo25 thanks

@anmolsahoo25
Copy link
Copy Markdown
Contributor Author

@mshinwell Thank you too, for taking a look at the code and bringing it up to par for merging.

@mshinwell
Copy link
Copy Markdown
Collaborator

Thanks for the submission - this is good work. We should have the remainder merged via the other PRs in not too long.

@anmolsahoo25
Copy link
Copy Markdown
Contributor Author

Looking forward to it. :)

@mshinwell
Copy link
Copy Markdown
Collaborator

This has all been merged via other PRs.

@mshinwell mshinwell closed this Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants