-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* implement rmw sub for x64 in winch * fmt * fix tests after rebase * turn match into if-let * fix test
- Loading branch information
1 parent
529b6ad
commit c72de0b
Showing
10 changed files
with
316 additions
and
9 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
tests/disas/winch/x64/atomic/rmw/i32_atomic_rmw16_subu.wat
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,36 @@ | ||
;;! target = "x86_64" | ||
;;! test = "winch" | ||
|
||
(module | ||
(memory 1 1 shared) | ||
(func (export "_start") (result i32) | ||
(i32.atomic.rmw16.sub_u (i32.const 0) (i32.const 42)))) | ||
;; wasm[0]::function[0]: | ||
;; pushq %rbp | ||
;; movq %rsp, %rbp | ||
;; movq 8(%rdi), %r11 | ||
;; movq 0x10(%r11), %r11 | ||
;; addq $0x10, %r11 | ||
;; cmpq %rsp, %r11 | ||
;; ja 0x64 | ||
;; 1c: movq %rdi, %r14 | ||
;; subq $0x10, %rsp | ||
;; movq %rdi, 8(%rsp) | ||
;; movq %rsi, (%rsp) | ||
;; movl $0x2a, %eax | ||
;; movl $0, %ecx | ||
;; andw $1, %cx | ||
;; cmpw $0, %cx | ||
;; jne 0x66 | ||
;; 44: movl $0, %ecx | ||
;; movq 0x58(%r14), %r11 | ||
;; movq (%r11), %rdx | ||
;; addq %rcx, %rdx | ||
;; negw %ax | ||
;; lock xaddw %ax, (%rdx) | ||
;; movzwl %ax, %eax | ||
;; addq $0x10, %rsp | ||
;; popq %rbp | ||
;; retq | ||
;; 64: ud2 | ||
;; 66: ud2 |
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,31 @@ | ||
;;! target = "x86_64" | ||
;;! test = "winch" | ||
|
||
(module | ||
(memory 1 1 shared) | ||
(func (export "_start") (result i32) | ||
(i32.atomic.rmw8.sub_u (i32.const 0) (i32.const 42)))) | ||
;; wasm[0]::function[0]: | ||
;; pushq %rbp | ||
;; movq %rsp, %rbp | ||
;; movq 8(%rdi), %r11 | ||
;; movq 0x10(%r11), %r11 | ||
;; addq $0x10, %r11 | ||
;; cmpq %rsp, %r11 | ||
;; ja 0x4f | ||
;; 1c: movq %rdi, %r14 | ||
;; subq $0x10, %rsp | ||
;; movq %rdi, 8(%rsp) | ||
;; movq %rsi, (%rsp) | ||
;; movl $0x2a, %eax | ||
;; movl $0, %ecx | ||
;; movq 0x58(%r14), %r11 | ||
;; movq (%r11), %rdx | ||
;; addq %rcx, %rdx | ||
;; negb %al | ||
;; lock xaddb %al, (%rdx) | ||
;; movzbl %al, %eax | ||
;; addq $0x10, %rsp | ||
;; popq %rbp | ||
;; retq | ||
;; 4f: ud2 |
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 = "x86_64" | ||
;;! test = "winch" | ||
|
||
(module | ||
(memory 1 1 shared) | ||
(func (export "_start") (result i32) | ||
(i32.atomic.rmw.sub (i32.const 0) (i32.const 42)))) | ||
;; wasm[0]::function[0]: | ||
;; pushq %rbp | ||
;; movq %rsp, %rbp | ||
;; movq 8(%rdi), %r11 | ||
;; movq 0x10(%r11), %r11 | ||
;; addq $0x10, %r11 | ||
;; cmpq %rsp, %r11 | ||
;; ja 0x5d | ||
;; 1c: movq %rdi, %r14 | ||
;; subq $0x10, %rsp | ||
;; movq %rdi, 8(%rsp) | ||
;; movq %rsi, (%rsp) | ||
;; movl $0x2a, %eax | ||
;; movl $0, %ecx | ||
;; andl $3, %ecx | ||
;; cmpl $0, %ecx | ||
;; jne 0x5f | ||
;; 42: movl $0, %ecx | ||
;; movq 0x58(%r14), %r11 | ||
;; movq (%r11), %rdx | ||
;; addq %rcx, %rdx | ||
;; negl %eax | ||
;; lock xaddl %eax, (%rdx) | ||
;; addq $0x10, %rsp | ||
;; popq %rbp | ||
;; retq | ||
;; 5d: ud2 | ||
;; 5f: ud2 |
36 changes: 36 additions & 0 deletions
36
tests/disas/winch/x64/atomic/rmw/i64_atomic_rmw16_subu.wat
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,36 @@ | ||
;;! target = "x86_64" | ||
;;! test = "winch" | ||
|
||
(module | ||
(memory 1 1 shared) | ||
(func (export "_start") (result i64) | ||
(i64.atomic.rmw16.sub_u (i32.const 0) (i64.const 42)))) | ||
;; wasm[0]::function[0]: | ||
;; pushq %rbp | ||
;; movq %rsp, %rbp | ||
;; movq 8(%rdi), %r11 | ||
;; movq 0x10(%r11), %r11 | ||
;; addq $0x10, %r11 | ||
;; cmpq %rsp, %r11 | ||
;; ja 0x67 | ||
;; 1c: movq %rdi, %r14 | ||
;; subq $0x10, %rsp | ||
;; movq %rdi, 8(%rsp) | ||
;; movq %rsi, (%rsp) | ||
;; movq $0x2a, %rax | ||
;; movl $0, %ecx | ||
;; andw $1, %cx | ||
;; cmpw $0, %cx | ||
;; jne 0x69 | ||
;; 46: movl $0, %ecx | ||
;; movq 0x58(%r14), %r11 | ||
;; movq (%r11), %rdx | ||
;; addq %rcx, %rdx | ||
;; negw %ax | ||
;; lock xaddw %ax, (%rdx) | ||
;; movzwq %ax, %rax | ||
;; addq $0x10, %rsp | ||
;; popq %rbp | ||
;; retq | ||
;; 67: ud2 | ||
;; 69: ud2 |
36 changes: 36 additions & 0 deletions
36
tests/disas/winch/x64/atomic/rmw/i64_atomic_rmw32_subu.wat
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,36 @@ | ||
;;! target = "x86_64" | ||
;;! test = "winch" | ||
|
||
(module | ||
(memory 1 1 shared) | ||
(func (export "_start") (result i64) | ||
(i64.atomic.rmw32.sub_u (i32.const 0) (i64.const 42)))) | ||
;; wasm[0]::function[0]: | ||
;; pushq %rbp | ||
;; movq %rsp, %rbp | ||
;; movq 8(%rdi), %r11 | ||
;; movq 0x10(%r11), %r11 | ||
;; addq $0x10, %r11 | ||
;; cmpq %rsp, %r11 | ||
;; ja 0x61 | ||
;; 1c: movq %rdi, %r14 | ||
;; subq $0x10, %rsp | ||
;; movq %rdi, 8(%rsp) | ||
;; movq %rsi, (%rsp) | ||
;; movq $0x2a, %rax | ||
;; movl $0, %ecx | ||
;; andl $3, %ecx | ||
;; cmpl $0, %ecx | ||
;; jne 0x63 | ||
;; 44: movl $0, %ecx | ||
;; movq 0x58(%r14), %r11 | ||
;; movq (%r11), %rdx | ||
;; addq %rcx, %rdx | ||
;; negl %eax | ||
;; lock xaddl %eax, (%rdx) | ||
;; movl %eax, %eax | ||
;; addq $0x10, %rsp | ||
;; popq %rbp | ||
;; retq | ||
;; 61: ud2 | ||
;; 63: ud2 |
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,31 @@ | ||
;;! target = "x86_64" | ||
;;! test = "winch" | ||
|
||
(module | ||
(memory 1 1 shared) | ||
(func (export "_start") (result i64) | ||
(i64.atomic.rmw8.sub_u (i32.const 0) (i64.const 42)))) | ||
;; wasm[0]::function[0]: | ||
;; pushq %rbp | ||
;; movq %rsp, %rbp | ||
;; movq 8(%rdi), %r11 | ||
;; movq 0x10(%r11), %r11 | ||
;; addq $0x10, %r11 | ||
;; cmpq %rsp, %r11 | ||
;; ja 0x52 | ||
;; 1c: movq %rdi, %r14 | ||
;; subq $0x10, %rsp | ||
;; movq %rdi, 8(%rsp) | ||
;; movq %rsi, (%rsp) | ||
;; movq $0x2a, %rax | ||
;; movl $0, %ecx | ||
;; movq 0x58(%r14), %r11 | ||
;; movq (%r11), %rdx | ||
;; addq %rcx, %rdx | ||
;; negb %al | ||
;; lock xaddb %al, (%rdx) | ||
;; movzbq %al, %rax | ||
;; addq $0x10, %rsp | ||
;; popq %rbp | ||
;; retq | ||
;; 52: ud2 |
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 = "x86_64" | ||
;;! test = "winch" | ||
|
||
(module | ||
(memory 1 1 shared) | ||
(func (export "_start") (result i64) | ||
(i64.atomic.rmw.sub (i32.const 0) (i64.const 42)))) | ||
;; wasm[0]::function[0]: | ||
;; pushq %rbp | ||
;; movq %rsp, %rbp | ||
;; movq 8(%rdi), %r11 | ||
;; movq 0x10(%r11), %r11 | ||
;; addq $0x10, %r11 | ||
;; cmpq %rsp, %r11 | ||
;; ja 0x63 | ||
;; 1c: movq %rdi, %r14 | ||
;; subq $0x10, %rsp | ||
;; movq %rdi, 8(%rsp) | ||
;; movq %rsi, (%rsp) | ||
;; movq $0x2a, %rax | ||
;; movl $0, %ecx | ||
;; andq $7, %rcx | ||
;; cmpq $0, %rcx | ||
;; jne 0x65 | ||
;; 46: movl $0, %ecx | ||
;; movq 0x58(%r14), %r11 | ||
;; movq (%r11), %rdx | ||
;; addq %rcx, %rdx | ||
;; negq %rax | ||
;; lock xaddq %rax, (%rdx) | ||
;; addq $0x10, %rsp | ||
;; popq %rbp | ||
;; retq | ||
;; 63: ud2 | ||
;; 65: ud2 |
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