-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit implements the CLIF `get_frame_pointer` instruction which will be needed by trampolines in Wasmtime. This is implemented by generalizing the preexisting `GetSp` `MInst` into a "get special". This the additionally removes the extended `get_sp` opcode in Pulley as it's not necessary as `xmov` can operate on this register.
- Loading branch information
1 parent
8e8ad73
commit 93a7c06
Showing
12 changed files
with
180 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 0 additions & 18 deletions
18
cranelift/filetests/filetests/isa/pulley32/get_stack_pointer.clif
This file was deleted.
Oops, something went wrong.
70 changes: 70 additions & 0 deletions
70
cranelift/filetests/filetests/isa/pulley32/special_regs.clif
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
test compile precise-output | ||
set preserve_frame_pointers | ||
target pulley32 | ||
|
||
function %get_stack_pointer() -> i32 { | ||
block0: | ||
v0 = get_stack_pointer.i32 | ||
return v0 | ||
} | ||
|
||
; VCode: | ||
; x30 = xconst8 -16 | ||
; x27 = xadd32 x27, x30 | ||
; store64 sp+8, x28 // flags = notrap aligned | ||
; store64 sp+0, x29 // flags = notrap aligned | ||
; x29 = xmov x27 | ||
; block0: | ||
; xmov x0, x27 | ||
; x28 = load64_u sp+8 // flags = notrap aligned | ||
; x29 = load64_u sp+0 // flags = notrap aligned | ||
; x30 = xconst8 16 | ||
; x27 = xadd32 x27, x30 | ||
; ret | ||
; | ||
; Disassembled: | ||
; xconst8 spilltmp0, -16 | ||
; xadd32 sp, sp, spilltmp0 | ||
; store64_offset8 sp, 8, lr | ||
; store64 sp, fp | ||
; xmov fp, sp | ||
; xmov x0, sp | ||
; load64_offset8 lr, sp, 8 | ||
; load64 fp, sp | ||
; xconst8 spilltmp0, 16 | ||
; xadd32 sp, sp, spilltmp0 | ||
; ret | ||
|
||
function %get_frame_pointer() -> i32 { | ||
block0: | ||
v0 = get_frame_pointer.i32 | ||
return v0 | ||
} | ||
|
||
; VCode: | ||
; x30 = xconst8 -16 | ||
; x27 = xadd32 x27, x30 | ||
; store64 sp+8, x28 // flags = notrap aligned | ||
; store64 sp+0, x29 // flags = notrap aligned | ||
; x29 = xmov x27 | ||
; block0: | ||
; xmov x0, x29 | ||
; x28 = load64_u sp+8 // flags = notrap aligned | ||
; x29 = load64_u sp+0 // flags = notrap aligned | ||
; x30 = xconst8 16 | ||
; x27 = xadd32 x27, x30 | ||
; ret | ||
; | ||
; Disassembled: | ||
; xconst8 spilltmp0, -16 | ||
; xadd32 sp, sp, spilltmp0 | ||
; store64_offset8 sp, 8, lr | ||
; store64 sp, fp | ||
; xmov fp, sp | ||
; xmov x0, fp | ||
; load64_offset8 lr, sp, 8 | ||
; load64 fp, sp | ||
; xconst8 spilltmp0, 16 | ||
; xadd32 sp, sp, spilltmp0 | ||
; ret | ||
|
18 changes: 0 additions & 18 deletions
18
cranelift/filetests/filetests/isa/pulley64/get_stack_pointer.clif
This file was deleted.
Oops, something went wrong.
70 changes: 70 additions & 0 deletions
70
cranelift/filetests/filetests/isa/pulley64/special_regs.clif
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
test compile precise-output | ||
set preserve_frame_pointers | ||
target pulley64 | ||
|
||
function %get_stack_pointer() -> i64 { | ||
block0: | ||
v0 = get_stack_pointer.i64 | ||
return v0 | ||
} | ||
|
||
; VCode: | ||
; x30 = xconst8 -16 | ||
; x27 = xadd32 x27, x30 | ||
; store64 sp+8, x28 // flags = notrap aligned | ||
; store64 sp+0, x29 // flags = notrap aligned | ||
; x29 = xmov x27 | ||
; block0: | ||
; xmov x0, x27 | ||
; x28 = load64_u sp+8 // flags = notrap aligned | ||
; x29 = load64_u sp+0 // flags = notrap aligned | ||
; x30 = xconst8 16 | ||
; x27 = xadd32 x27, x30 | ||
; ret | ||
; | ||
; Disassembled: | ||
; xconst8 spilltmp0, -16 | ||
; xadd32 sp, sp, spilltmp0 | ||
; store64_offset8 sp, 8, lr | ||
; store64 sp, fp | ||
; xmov fp, sp | ||
; xmov x0, sp | ||
; load64_offset8 lr, sp, 8 | ||
; load64 fp, sp | ||
; xconst8 spilltmp0, 16 | ||
; xadd32 sp, sp, spilltmp0 | ||
; ret | ||
|
||
function %get_frame_pointer() -> i64 { | ||
block0: | ||
v0 = get_frame_pointer.i64 | ||
return v0 | ||
} | ||
|
||
; VCode: | ||
; x30 = xconst8 -16 | ||
; x27 = xadd32 x27, x30 | ||
; store64 sp+8, x28 // flags = notrap aligned | ||
; store64 sp+0, x29 // flags = notrap aligned | ||
; x29 = xmov x27 | ||
; block0: | ||
; xmov x0, x29 | ||
; x28 = load64_u sp+8 // flags = notrap aligned | ||
; x29 = load64_u sp+0 // flags = notrap aligned | ||
; x30 = xconst8 16 | ||
; x27 = xadd32 x27, x30 | ||
; ret | ||
; | ||
; Disassembled: | ||
; xconst8 spilltmp0, -16 | ||
; xadd32 sp, sp, spilltmp0 | ||
; store64_offset8 sp, 8, lr | ||
; store64 sp, fp | ||
; xmov fp, sp | ||
; xmov x0, fp | ||
; load64_offset8 lr, sp, 8 | ||
; load64 fp, sp | ||
; xconst8 spilltmp0, 16 | ||
; xadd32 sp, sp, spilltmp0 | ||
; ret | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters