Skip to content

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

Merged
cfallin merged 1 commit into
bytecodealliance:mainfrom
akirilov-arm:callee_saves
Apr 13, 2021
Merged

Cranelift AArch64: Improve the handling of callee-saved registers#2823
cfallin merged 1 commit into
bytecodealliance:mainfrom
akirilov-arm:callee_saves

Conversation

@akirilov-arm
Copy link
Copy Markdown
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.

@akirilov-arm akirilov-arm requested a review from cfallin April 9, 2021 15:03
@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
Copy Markdown
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.

Comment thread cranelift/codegen/src/isa/aarch64/abi.rs
@akirilov-arm
Copy link
Copy Markdown
Contributor Author

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

@cfallin
Copy link
Copy Markdown
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