-
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.
* winch aarch64 jmp * winch aarch64 branch * winch aarch64 jmp_table * winch aarch64 branch tests * winch aarch64 jmp: add islands for long range branches
- Loading branch information
Showing
15 changed files
with
25,882 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
;;! target = "aarch64" | ||
;;! test = "winch" | ||
(module | ||
(func (export "as-br_if-cond") | ||
(block (br_if 0 (br 0))) | ||
) | ||
) | ||
;; wasm[0]::function[0]: | ||
;; stp x29, x30, [sp, #-0x10]! | ||
;; mov x29, sp | ||
;; mov x28, sp | ||
;; mov x9, x0 | ||
;; sub sp, sp, #0x10 | ||
;; mov x28, sp | ||
;; stur x0, [x28, #8] | ||
;; stur x1, [x28] | ||
;; add sp, sp, #0x10 | ||
;; mov x28, sp | ||
;; ldp x29, x30, [sp], #0x10 | ||
;; 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
;;! target = "aarch64" | ||
;;! test = "winch" | ||
(module | ||
(func (export "as-br-value") (result i32) | ||
(block (result i32) (br 0 (br 0 (i32.const 9)))) | ||
) | ||
) | ||
;; wasm[0]::function[0]: | ||
;; stp x29, x30, [sp, #-0x10]! | ||
;; mov x29, sp | ||
;; mov x28, sp | ||
;; mov x9, x0 | ||
;; sub sp, sp, #0x10 | ||
;; mov x28, sp | ||
;; stur x0, [x28, #8] | ||
;; stur x1, [x28] | ||
;; mov x16, #9 | ||
;; mov w0, w16 | ||
;; add sp, sp, #0x10 | ||
;; mov x28, sp | ||
;; ldp x29, x30, [sp], #0x10 | ||
;; 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
;;! target = "aarch64" | ||
;;! test = "winch" | ||
(module | ||
(func (export "as-if-cond") (result i32) | ||
(block (result i32) | ||
(if (result i32) (br 0 (i32.const 2)) | ||
(then (i32.const 0)) | ||
(else (i32.const 1)) | ||
) | ||
) | ||
) | ||
) | ||
;; wasm[0]::function[0]: | ||
;; stp x29, x30, [sp, #-0x10]! | ||
;; mov x29, sp | ||
;; mov x28, sp | ||
;; mov x9, x0 | ||
;; sub sp, sp, #0x10 | ||
;; mov x28, sp | ||
;; stur x0, [x28, #8] | ||
;; stur x1, [x28] | ||
;; mov x16, #2 | ||
;; mov w0, w16 | ||
;; add sp, sp, #0x10 | ||
;; mov x28, sp | ||
;; ldp x29, x30, [sp], #0x10 | ||
;; 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
;;! target = "aarch64" | ||
;;! test = "winch" | ||
(module | ||
(func (export "as-if-else") (param i32 i32) (result i32) | ||
(block (result i32) | ||
(if (result i32) (local.get 0) | ||
(then (local.get 1)) | ||
(else (br 1 (i32.const 4))) | ||
) | ||
) | ||
) | ||
) | ||
;; wasm[0]::function[0]: | ||
;; stp x29, x30, [sp, #-0x10]! | ||
;; mov x29, sp | ||
;; mov x28, sp | ||
;; mov x9, x0 | ||
;; sub sp, sp, #0x18 | ||
;; mov x28, sp | ||
;; stur x0, [x28, #0x10] | ||
;; stur x1, [x28, #8] | ||
;; stur w2, [x28, #4] | ||
;; stur w3, [x28] | ||
;; ldur w0, [x28, #4] | ||
;; tst w0, w0 | ||
;; b.eq #0x40 | ||
;; b #0x38 | ||
;; 38: ldur w0, [x28] | ||
;; b #0x48 | ||
;; 40: mov x16, #4 | ||
;; mov w0, w16 | ||
;; add sp, sp, #0x18 | ||
;; mov x28, sp | ||
;; ldp x29, x30, [sp], #0x10 | ||
;; 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
;;! target = "aarch64" | ||
;;! test = "winch" | ||
(module | ||
(func (export "as-if-then") (param i32 i32) (result i32) | ||
(block (result i32) | ||
(if (result i32) (local.get 0) | ||
(then (br 1 (i32.const 3))) | ||
(else (local.get 1)) | ||
) | ||
) | ||
) | ||
) | ||
;; wasm[0]::function[0]: | ||
;; stp x29, x30, [sp, #-0x10]! | ||
;; mov x29, sp | ||
;; mov x28, sp | ||
;; mov x9, x0 | ||
;; sub sp, sp, #0x18 | ||
;; mov x28, sp | ||
;; stur x0, [x28, #0x10] | ||
;; stur x1, [x28, #8] | ||
;; stur w2, [x28, #4] | ||
;; stur w3, [x28] | ||
;; ldur w0, [x28, #4] | ||
;; tst w0, w0 | ||
;; b.eq #0x44 | ||
;; b #0x38 | ||
;; 38: mov x16, #3 | ||
;; mov w0, w16 | ||
;; b #0x48 | ||
;; 44: ldur w0, [x28] | ||
;; add sp, sp, #0x18 | ||
;; mov x28, sp | ||
;; ldp x29, x30, [sp], #0x10 | ||
;; 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
;;! target = "aarch64" | ||
;;! test = "winch" | ||
|
||
(module | ||
(func (export "as-loop-first") (result i32) | ||
(block (result i32) (loop (result i32) (br 1 (i32.const 3)) (i32.const 2))) | ||
) | ||
) | ||
;; wasm[0]::function[0]: | ||
;; stp x29, x30, [sp, #-0x10]! | ||
;; mov x29, sp | ||
;; mov x28, sp | ||
;; mov x9, x0 | ||
;; sub sp, sp, #0x10 | ||
;; mov x28, sp | ||
;; stur x0, [x28, #8] | ||
;; stur x1, [x28] | ||
;; mov x16, #3 | ||
;; mov w0, w16 | ||
;; add sp, sp, #0x10 | ||
;; mov x28, sp | ||
;; ldp x29, x30, [sp], #0x10 | ||
;; 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
;;! target = "aarch64" | ||
;;! test = "winch" | ||
(module | ||
(func (;0;) (result i32) | ||
(local i32) | ||
local.get 0 | ||
loop ;; label = @1 | ||
local.get 0 | ||
block ;; label = @2 | ||
end | ||
br 0 (;@1;) | ||
end | ||
) | ||
(export "" (func 0)) | ||
) | ||
;; wasm[0]::function[0]: | ||
;; stp x29, x30, [sp, #-0x10]! | ||
;; mov x29, sp | ||
;; mov x28, sp | ||
;; mov x9, x0 | ||
;; sub sp, sp, #0x18 | ||
;; mov x28, sp | ||
;; stur x0, [x28, #0x10] | ||
;; stur x1, [x28, #8] | ||
;; mov x16, #0 | ||
;; stur x16, [x28] | ||
;; ldur w16, [x28, #4] | ||
;; sub sp, sp, #8 | ||
;; mov x28, sp | ||
;; stur x16, [x28, #8] | ||
;; ldur w16, [x28, #0xc] | ||
;; sub sp, sp, #8 | ||
;; mov x28, sp | ||
;; stur x16, [x28, #8] | ||
;; add sp, sp, #8 | ||
;; mov x28, sp | ||
;; b #0x38 | ||
;; 54: add sp, sp, #0x18 | ||
;; mov x28, sp | ||
;; ldp x29, x30, [sp], #0x10 | ||
;; 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
;;! target = "aarch64" | ||
;;! test = "winch" | ||
(module | ||
(func (export "as-br-if-cond") | ||
(block (br_if 0 (br_if 0 (i32.const 1) (i32.const 1)))) | ||
) | ||
) | ||
;; wasm[0]::function[0]: | ||
;; stp x29, x30, [sp, #-0x10]! | ||
;; mov x29, sp | ||
;; mov x28, sp | ||
;; mov x9, x0 | ||
;; sub sp, sp, #0x10 | ||
;; mov x28, sp | ||
;; stur x0, [x28, #8] | ||
;; stur x1, [x28] | ||
;; mov x16, #1 | ||
;; mov w0, w16 | ||
;; tst w0, w0 | ||
;; b.ne #0x48 | ||
;; b #0x34 | ||
;; 34: mov x16, #1 | ||
;; mov w0, w16 | ||
;; tst w0, w0 | ||
;; b.ne #0x48 | ||
;; b #0x48 | ||
;; 48: add sp, sp, #0x10 | ||
;; mov x28, sp | ||
;; ldp x29, x30, [sp], #0x10 | ||
;; 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
;;! target = "aarch64" | ||
;;! test = "winch" | ||
(module | ||
(func (export "as-br-value") (result i32) | ||
(block (result i32) (br 0 (br_if 0 (i32.const 1) (i32.const 2)))) | ||
) | ||
) | ||
;; wasm[0]::function[0]: | ||
;; stp x29, x30, [sp, #-0x10]! | ||
;; mov x29, sp | ||
;; mov x28, sp | ||
;; mov x9, x0 | ||
;; sub sp, sp, #0x10 | ||
;; mov x28, sp | ||
;; stur x0, [x28, #8] | ||
;; stur x1, [x28] | ||
;; mov x16, #2 | ||
;; mov w1, w16 | ||
;; mov x16, #1 | ||
;; mov w0, w16 | ||
;; tst w1, w1 | ||
;; b.ne #0x3c | ||
;; b #0x3c | ||
;; 3c: add sp, sp, #0x10 | ||
;; mov x28, sp | ||
;; ldp x29, x30, [sp], #0x10 | ||
;; 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
;;! target = "aarch64" | ||
;;! test = "winch" | ||
(module | ||
(func (export "as-if-cond") (param i32) (result i32) | ||
(block (result i32) | ||
(if (result i32) | ||
(br_if 0 (i32.const 1) (local.get 0)) | ||
(then (i32.const 2)) | ||
(else (i32.const 3)) | ||
) | ||
) | ||
) | ||
) | ||
;; wasm[0]::function[0]: | ||
;; stp x29, x30, [sp, #-0x10]! | ||
;; mov x29, sp | ||
;; mov x28, sp | ||
;; mov x9, x0 | ||
;; sub sp, sp, #0x18 | ||
;; mov x28, sp | ||
;; stur x0, [x28, #0x10] | ||
;; stur x1, [x28, #8] | ||
;; stur w2, [x28, #4] | ||
;; ldur w1, [x28, #4] | ||
;; mov x16, #1 | ||
;; mov w0, w16 | ||
;; tst w1, w1 | ||
;; b.ne #0x5c | ||
;; b #0x3c | ||
;; 3c: tst w0, w0 | ||
;; b.eq #0x54 | ||
;; b #0x48 | ||
;; 48: mov x16, #2 | ||
;; mov w0, w16 | ||
;; b #0x5c | ||
;; 54: mov x16, #3 | ||
;; mov w0, w16 | ||
;; add sp, sp, #0x18 | ||
;; mov x28, sp | ||
;; ldp x29, x30, [sp], #0x10 | ||
;; 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
;;! target = "aarch64" | ||
;;! test = "winch" | ||
(module | ||
(func (export "as-local-set-value") (param i32) (result i32) | ||
(local i32) | ||
(block (result i32) | ||
(local.set 0 (br_if 0 (i32.const 17) (local.get 0))) | ||
(i32.const -1) | ||
) | ||
) | ||
) | ||
;; wasm[0]::function[0]: | ||
;; stp x29, x30, [sp, #-0x10]! | ||
;; mov x29, sp | ||
;; mov x28, sp | ||
;; mov x9, x0 | ||
;; sub sp, sp, #0x18 | ||
;; mov x28, sp | ||
;; stur x0, [x28, #0x10] | ||
;; stur x1, [x28, #8] | ||
;; stur w2, [x28, #4] | ||
;; mov x16, #0 | ||
;; stur w16, [x28] | ||
;; mov x16, #0 | ||
;; ldur w1, [x28, #4] | ||
;; mov x16, #0x11 | ||
;; mov w0, w16 | ||
;; tst w1, w1 | ||
;; b.ne #0x54 | ||
;; b #0x48 | ||
;; 48: stur w0, [x28, #4] | ||
;; orr x16, xzr, #0xffffffff | ||
;; mov w0, w16 | ||
;; add sp, sp, #0x18 | ||
;; mov x28, sp | ||
;; ldp x29, x30, [sp], #0x10 | ||
;; ret |
Oops, something went wrong.