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

machinst ABI: Allow back-end to define stack alignment #2345

Merged
merged 1 commit into from
Nov 3, 2020
Merged

machinst ABI: Allow back-end to define stack alignment #2345

merged 1 commit into from
Nov 3, 2020

Conversation

uweigand
Copy link
Member

@uweigand uweigand commented Nov 2, 2020

The common gen_prologue code currently assumes that the stack
pointer has to be aligned to twice the word size. While this
is true for many ABIs, it does not hold universally.

This patch adds a new constant STACK_ALIGN that back-ends can
provide to define the specific stack alignment required by the
ABI on that platform.

@uweigand
Copy link
Member Author

uweigand commented Nov 2, 2020

@cfallin This is one of the changes discussed here #2128 (comment) (required for the IBM Z back-end).

@github-actions github-actions bot added cranelift Issues related to the Cranelift code generator cranelift:area:machinst Issues related to instruction selection and the new MachInst backend. cranelift:area:aarch64 Issues related to AArch64 backend. cranelift:area:x64 Issues related to x64 codegen labels Nov 2, 2020
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.

Thanks!

@cfallin
Copy link
Member

cfallin commented Nov 2, 2020

There's some weirdness with wiggle in the x64-backend CI -- looking into it.

@cfallin
Copy link
Member

cfallin commented Nov 2, 2020

@uweigand I think #2352 should fix the CI failure; would you mind rebasing to pull that in?

The common gen_prologue code currently assumes that the stack
pointer has to be aligned to twice the word size.  While this
is true for many ABIs, it does not hold universally.

This patch adds a new callback stack_align that back-ends can
provide to define the specific stack alignment required by the
ABI on that platform.
@cfallin cfallin merged commit 5ab7b4a into bytecodealliance:main Nov 3, 2020
@uweigand uweigand deleted the abi-stackalign branch November 10, 2020 12:14
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:area:machinst Issues related to instruction selection and the new MachInst backend. cranelift:area:x64 Issues related to x64 codegen cranelift Issues related to the Cranelift code generator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants