s390x: Support preserve_frame_pointers flag (#4477)

On s390x, we do not have a frame pointer that can be used to chain
stack frames for easy unwinding.  Instead, our ABI defines a stack
"backchain" mechanism that can be used to the same effect.

This PR uses that backchain mechanism to implement the new
preserve_frame_pointers flags introduced here:
https://github.com/bytecodealliance/wasmtime/pull/4469
This commit is contained in:
Ulrich Weigand
2022-07-21 19:09:16 +02:00
committed by GitHub
parent 4ce329d1eb
commit fd639dd044
3 changed files with 87 additions and 15 deletions

View File

@@ -0,0 +1,15 @@
;; Test compilation of leaf functions without preserving frame pointers.
test compile precise-output
set unwind_info=false
set preserve_frame_pointers=false
target s390x
function %leaf(i64) -> i64 {
block0(v0: i64):
return v0
}
; block0:
; br %r14

View File

@@ -0,0 +1,21 @@
;; Test compilation of leaf functions while preserving frame pointers.
test compile precise-output
set unwind_info=false
set preserve_frame_pointers=true
target s390x
function %leaf(i64) -> i64 {
block0(v0: i64):
return v0
}
; stmg %r14, %r15, 112(%r15)
; lgr %r1, %r15
; aghi %r15, -160
; virtual_sp_offset_adjust 160
; stg %r1, 0(%r15)
; block0:
; lmg %r14, %r15, 272(%r15)
; br %r14