This commit implements the stack limit checks in cranelift for the AArch64 backend. This gets the `stack_limit` argument purpose as well as a function's global `stack_limit` directive working for the AArch64 backend. I've tested this locally on some hardware and in an emulator and it looks to be working for basic tests, but I've never really done AArch64 before so some scrutiny on the instructions would be most welcome!
33 lines
576 B
ArmAsm
33 lines
576 B
ArmAsm
.arch armv8-a
|
|
.file "foo.c"
|
|
.text
|
|
.align 2
|
|
.global foo
|
|
.type foo, %function
|
|
foo:
|
|
.LFB0:
|
|
.cfi_startproc
|
|
stp x29, x30, [sp, -32]!
|
|
.cfi_def_cfa_offset 32
|
|
.cfi_offset 29, -32
|
|
.cfi_offset 30, -24
|
|
add x29, sp, 0
|
|
.cfi_def_cfa_register 29
|
|
str x19, [sp, 16]
|
|
.cfi_offset 19, -16
|
|
mov w19, w0
|
|
bl bar
|
|
add w0, w19, 3
|
|
ldr x19, [sp, 16]
|
|
ldp x29, x30, [sp], 32
|
|
.cfi_restore 30
|
|
.cfi_restore 29
|
|
.cfi_restore 19
|
|
.cfi_def_cfa 31, 0
|
|
ret
|
|
.cfi_endproc
|
|
.LFE0:
|
|
.size foo, .-foo
|
|
.ident "GCC: (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04) 7.5.0"
|
|
.section .note.GNU-stack,"",@progbits
|