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
spring runtime assembly cleaning #13033
Conversation
Not able to review but on the topic of the Changes entry it's also a
good way to credit both authors and reviewers of PRs and to convey an
idea of what is worked on so I would be of the opinion to add an entry
if that's okay with you.
|
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.
I am more familiar with power and arm64 assembly, which look correct to me, and the other backends look like a straight forward replacement. General question about the correct use of CFI directives, this PR follows the existing patterns so not specific to this change.
ldp x29, x30, [sp], 16 | ||
CFI_ADJUST(-16) | ||
.endm | ||
|
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.
On the ordering of CFI directives, should they be before or after the instruction they relate to? When I compile C code to get the assembly, I get the instruction first and then the CFI directive. For compiled OCaml code and runtime assembly there is a mix of before and after. Does it matter? For example on entry to a main function:
_main: ; @main
.cfi_startproc
; %bb.0:
sub sp, sp, #64
.cfi_def_cfa_offset 64
stp x29, x30, [sp, #48] ; 16-byte Folded Spill
add x29, sp, #48
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
...
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.
My understanding is that CFI annotations must appear after the instruction which causes the changes they refer to.
55ab2f3
to
dade454
Compare
Looks good to me. 👍🏻 |
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.
Approved on behalf of @tmcgilchrist. Thanks everyone!
Hmm, it looks like the CI is failing on
|
dade454
to
70049b9
Compare
This should be fixed now. I moved the inclusion of |
This deduplicates code a bit and helps comparing logic against amd64. And this slightly improves CFI annotation correctness.
70049b9
to
ebc5e1d
Compare
...and The other backends do not because they use |
This mechanical diff factors multiple occurrences of the stack gymkhana done in non-leaf functions, and standardizes on the
ENTER_FUNCTION
andLEAVE_FUNCTION
found on amd64.This helps reading the code a bit, and also comparing platforms against each other.
No testsuite regression observed on the four affected platforms.
Not sure this is worth a
Changes
entry as this is quite mechanical and almost doesn't change anything (the astute reader will notice that this fixes a missing stack adjustment in the raising exception path ofcaml_call_realloc_stack
on s390x, which was harmless since an exception is raised anyway.)