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

Improved ARM64 code generation #9937

Merged
merged 4 commits into from Nov 26, 2020
Merged

Conversation

xavierleroy
Copy link
Contributor

This PR improves (marginally) the code generated by the ARM64 port.

The first commit recognizes the full set of hardware-supported immediate operands for logical operations. The code is slightly tricky but is similar to the code that CompCert uses when targeting ARM64.

The second commit tries to generate shorter instruction sequences for loading large integer constants. Again, it is inspired by CompCert for ARM64. It also reduces code duplication between determining the size of the instruction sequence and actually generating it.

The third commit recognizes the sbfm instruction for sign extensions. This should improve a bit the code generated for int32 arithmetic.

…ions

Now we recognize the full set of hardware supported immediate operands.

`is_logical_immediate` was moved from Selection to Arch and made
to work on nativeints.  This is in preparation for future use in Emit.
Add a special case for immediates that can be loaded in one "or" instruction.

Refactor the code that produces sequences of movz/movn/movk to be less
redundant and to choose the shortest sequence between the "movz" sequence
and the "movn" sequence.
@xavierleroy
Copy link
Contributor Author

Thanks for the review. I rebased and am running a round of "precheck" CI.

@xavierleroy
Copy link
Contributor Author

CI on ARM64 is happy. Merging!

@xavierleroy xavierleroy merged commit f1ce133 into ocaml:trunk Nov 26, 2020
@xavierleroy xavierleroy deleted the arm64-codegen branch January 9, 2021 17:12
dbuenzli pushed a commit to dbuenzli/ocaml that referenced this pull request Mar 25, 2021
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.

None yet

2 participants