machinst ABI: Allow back-end to define stack alignment

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.
This commit is contained in:
Ulrich Weigand
2020-11-02 13:07:49 +01:00
parent d1be8dcfc0
commit d02ae3940c
4 changed files with 19 additions and 1 deletions

View File

@@ -90,6 +90,11 @@ impl ABIMachineSpec for X64ABIMachineSpec {
64
}
/// Return required stack alignment in bytes.
fn stack_align(_call_conv: isa::CallConv) -> u32 {
16
}
fn compute_arg_locs(
call_conv: isa::CallConv,
params: &[ir::AbiParam],