-
Notifications
You must be signed in to change notification settings - Fork 14.1k
[AArch64][SME] Rewrite __arm_get_current_vg to preserve required registers #100143
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
Conversation
…sters The documentation for the __arm_get_current_vg support routine specifies that the following registers are call-preserved: - X1-X15, X19-X29 and SP - Z0-Z31 - P0-P15 This patch rewrites the implementation of this routine in compiler-rt, as the current version does not guarantee that these registers will be preserved. See https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aapcs64.rst#arm-get-current-vg
DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED(__arm_get_current_vg) | ||
.variant_pcs __arm_get_current_vg | ||
BTI_C | ||
mov x0, xzr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this necessary? I'd expect it to be overwritten by the call to __arm_sme_state
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does get overwritten, I've removed this
|
||
__attribute__((target("sve"))) long | ||
__arm_get_current_vg(void) __arm_streaming_compatible { | ||
struct SME_STATE State = __arm_sme_state(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the definition of this struct and the prototype of __arm_sme_state
be removed as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They can indeed :)
.cfi_offset w30, -8 | ||
.cfi_offset w29, -16 | ||
mov x17, x1 | ||
bl __arm_sme_state |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this call be moved into the 0:
branch?
__arm_sme_state call to the '0' branch. - Removed SME_STATE struct from sme-abi-vg.c
…t with TPIDR2_SYMBOL
Should this be backported to 19.x |
Hi @AtariDreams, yes it should be. I will create an issue to backport it. |
/cherry-pick 6da6772 |
…sters (llvm#100143) The documentation for the __arm_get_current_vg support routine specifies that the following registers are call-preserved: - X1-X15, X19-X29 and SP - Z0-Z31 - P0-P15 This patch rewrites the implementation of this routine in compiler-rt, as the current version does not guarantee that these registers will be preserved. (cherry picked from commit 6da6772)
/pull-request #100546 |
…sters (#100143) Summary: The documentation for the __arm_get_current_vg support routine specifies that the following registers are call-preserved: - X1-X15, X19-X29 and SP - Z0-Z31 - P0-P15 This patch rewrites the implementation of this routine in compiler-rt, as the current version does not guarantee that these registers will be preserved. Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: https://phabricator.intern.facebook.com/D60250669
…sters (llvm#100143) The documentation for the __arm_get_current_vg support routine specifies that the following registers are call-preserved: - X1-X15, X19-X29 and SP - Z0-Z31 - P0-P15 This patch rewrites the implementation of this routine in compiler-rt, as the current version does not guarantee that these registers will be preserved. (cherry picked from commit 6da6772)
The documentation for the __arm_get_current_vg support routine specifies
that the following registers are call-preserved:
This patch rewrites the implementation of this routine in compiler-rt, as
the current version does not guarantee that these registers will be preserved.