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

Cranelift AArch64: Improve the handling of callee-saved registers #2823

Merged
merged 1 commit into from
Apr 13, 2021

Conversation

akirilov-arm
Copy link
Contributor

SIMD & FP registers are now saved and restored in pairs, similarly to general-purpose registers. Also, the fix for issue #2254 has enabled us to save and to restore only the bottom 64 bits of the registers (in case of non-Baldrdash ABIs), which is the requirement from the Procedure Call Standard for the Arm 64-bit Architecture.
As for the callee-saved general-purpose registers, if a procedure needs to save and restore an odd number of them, it no longer uses store and load pair instructions for the last register.

@github-actions github-actions bot added cranelift Issues related to the Cranelift code generator cranelift:area:aarch64 Issues related to AArch64 backend. labels Apr 9, 2021
Copy link
Member

@cfallin cfallin left a comment

Choose a reason for hiding this comment

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

This looks great, thanks! It should be a nice optimization for functions that clobber a bunch of FP state.

Just one nit requesting a comment addition below but otherwise LGTM.

cranelift/codegen/src/isa/aarch64/abi.rs Show resolved Hide resolved
@akirilov-arm
Copy link
Contributor Author

It looks like the test failures were caused by unrelated issues - I noticed that other PRs were similarly affected.

@cfallin
Copy link
Member

cfallin commented Apr 13, 2021

CI just fixed in #2830; should be good after a rebase I think!

SIMD & FP registers are now saved and restored in pairs, similarly
to general-purpose registers. Also, only the bottom 64 bits of the
registers are saved and restored (in case of non-Baldrdash ABIs),
which is the requirement from the Procedure Call Standard for the
Arm 64-bit Architecture.

As for the callee-saved general-purpose registers, if a procedure
needs to save and restore an odd number of them, it no longer uses
store and load pair instructions for the last register.

Copyright (c) 2021, Arm Limited.
@cfallin cfallin merged commit 8caac9e into bytecodealliance:main Apr 13, 2021
@akirilov-arm akirilov-arm deleted the callee_saves branch April 14, 2021 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cranelift:area:aarch64 Issues related to AArch64 backend. cranelift Issues related to the Cranelift code generator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants