-
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 or implement atomic rmw xor fix operand sizes implement and, or, xor update rmw or tests update rmw xor tests fmt use ad-hoc conversion for AtomicRmwSeqOp fix test fix rebae quirks
- Loading branch information
1 parent
d58f1b5
commit d1c5659
Showing
27 changed files
with
1,010 additions
and
5 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
39 changes: 39 additions & 0 deletions
39
tests/disas/winch/x64/atomic/rmw/i32_atomic_rmw16_andu.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,39 @@ | ||
;;! target = "x86_64" | ||
;;! test = "winch" | ||
|
||
(module | ||
(memory 1 1 shared) | ||
(func (export "_start") (result i32) | ||
(i32.atomic.rmw16.and_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 0x72 | ||
;; 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 0x74 | ||
;; 44: movl $0, %ecx | ||
;; movq 0x58(%r14), %r11 | ||
;; movq (%r11), %rdx | ||
;; addq %rcx, %rdx | ||
;; movzwq (%rdx), %rax | ||
;; movq %rax, %r11 | ||
;; andq %rax, %r11 | ||
;; lock cmpxchgw %r11w, (%rdx) | ||
;; jne 0x57 | ||
;; 69: movzwl %ax, %eax | ||
;; addq $0x10, %rsp | ||
;; popq %rbp | ||
;; retq | ||
;; 72: ud2 | ||
;; 74: 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,39 @@ | ||
;;! target = "x86_64" | ||
;;! test = "winch" | ||
|
||
(module | ||
(memory 1 1 shared) | ||
(func (export "_start") (result i32) | ||
(i32.atomic.rmw16.or_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 0x72 | ||
;; 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 0x74 | ||
;; 44: movl $0, %ecx | ||
;; movq 0x58(%r14), %r11 | ||
;; movq (%r11), %rdx | ||
;; addq %rcx, %rdx | ||
;; movzwq (%rdx), %rax | ||
;; movq %rax, %r11 | ||
;; orq %rax, %r11 | ||
;; lock cmpxchgw %r11w, (%rdx) | ||
;; jne 0x57 | ||
;; 69: movzwl %ax, %eax | ||
;; addq $0x10, %rsp | ||
;; popq %rbp | ||
;; retq | ||
;; 72: ud2 | ||
;; 74: ud2 |
39 changes: 39 additions & 0 deletions
39
tests/disas/winch/x64/atomic/rmw/i32_atomic_rmw16_xoru.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,39 @@ | ||
;;! target = "x86_64" | ||
;;! test = "winch" | ||
|
||
(module | ||
(memory 1 1 shared) | ||
(func (export "_start") (result i32) | ||
(i32.atomic.rmw16.xor_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 0x72 | ||
;; 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 0x74 | ||
;; 44: movl $0, %ecx | ||
;; movq 0x58(%r14), %r11 | ||
;; movq (%r11), %rdx | ||
;; addq %rcx, %rdx | ||
;; movzwq (%rdx), %rax | ||
;; movq %rax, %r11 | ||
;; xorq %rax, %r11 | ||
;; lock cmpxchgw %r11w, (%rdx) | ||
;; jne 0x57 | ||
;; 69: movzwl %ax, %eax | ||
;; addq $0x10, %rsp | ||
;; popq %rbp | ||
;; retq | ||
;; 72: ud2 | ||
;; 74: 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,34 @@ | ||
;;! target = "x86_64" | ||
;;! test = "winch" | ||
|
||
(module | ||
(memory 1 1 shared) | ||
(func (export "_start") (result i32) | ||
(i32.atomic.rmw8.and_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 0x5e | ||
;; 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 | ||
;; movzbq (%rdx), %rax | ||
;; movq %rax, %r11 | ||
;; andq %rax, %r11 | ||
;; lock cmpxchgb %r11b, (%rdx) | ||
;; jne 0x44 | ||
;; 55: movzbl %al, %eax | ||
;; addq $0x10, %rsp | ||
;; popq %rbp | ||
;; retq | ||
;; 5e: 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,34 @@ | ||
;;! target = "x86_64" | ||
;;! test = "winch" | ||
|
||
(module | ||
(memory 1 1 shared) | ||
(func (export "_start") (result i32) | ||
(i32.atomic.rmw8.or_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 0x5e | ||
;; 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 | ||
;; movzbq (%rdx), %rax | ||
;; movq %rax, %r11 | ||
;; orq %rax, %r11 | ||
;; lock cmpxchgb %r11b, (%rdx) | ||
;; jne 0x44 | ||
;; 55: movzbl %al, %eax | ||
;; addq $0x10, %rsp | ||
;; popq %rbp | ||
;; retq | ||
;; 5e: 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,34 @@ | ||
;;! target = "x86_64" | ||
;;! test = "winch" | ||
|
||
(module | ||
(memory 1 1 shared) | ||
(func (export "_start") (result i32) | ||
(i32.atomic.rmw8.xor_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 0x5e | ||
;; 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 | ||
;; movzbq (%rdx), %rax | ||
;; movq %rax, %r11 | ||
;; xorq %rax, %r11 | ||
;; lock cmpxchgb %r11b, (%rdx) | ||
;; jne 0x44 | ||
;; 55: movzbl %al, %eax | ||
;; addq $0x10, %rsp | ||
;; popq %rbp | ||
;; retq | ||
;; 5e: 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,38 @@ | ||
;;! target = "x86_64" | ||
;;! test = "winch" | ||
|
||
(module | ||
(memory 1 1 shared) | ||
(func (export "_start") (result i32) | ||
(i32.atomic.rmw.and (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 0x6a | ||
;; 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 0x6c | ||
;; 42: movl $0, %ecx | ||
;; movq 0x58(%r14), %r11 | ||
;; movq (%r11), %rdx | ||
;; addq %rcx, %rdx | ||
;; movl (%rdx), %eax | ||
;; movq %rax, %r11 | ||
;; andq %rax, %r11 | ||
;; lock cmpxchgl %r11d, (%rdx) | ||
;; jne 0x53 | ||
;; 64: addq $0x10, %rsp | ||
;; popq %rbp | ||
;; retq | ||
;; 6a: ud2 | ||
;; 6c: 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,38 @@ | ||
;;! target = "x86_64" | ||
;;! test = "winch" | ||
|
||
(module | ||
(memory 1 1 shared) | ||
(func (export "_start") (result i32) | ||
(i32.atomic.rmw.or (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 0x6a | ||
;; 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 0x6c | ||
;; 42: movl $0, %ecx | ||
;; movq 0x58(%r14), %r11 | ||
;; movq (%r11), %rdx | ||
;; addq %rcx, %rdx | ||
;; movl (%rdx), %eax | ||
;; movq %rax, %r11 | ||
;; orq %rax, %r11 | ||
;; lock cmpxchgl %r11d, (%rdx) | ||
;; jne 0x53 | ||
;; 64: addq $0x10, %rsp | ||
;; popq %rbp | ||
;; retq | ||
;; 6a: ud2 | ||
;; 6c: 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,38 @@ | ||
;;! target = "x86_64" | ||
;;! test = "winch" | ||
|
||
(module | ||
(memory 1 1 shared) | ||
(func (export "_start") (result i32) | ||
(i32.atomic.rmw.xor (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 0x6a | ||
;; 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 0x6c | ||
;; 42: movl $0, %ecx | ||
;; movq 0x58(%r14), %r11 | ||
;; movq (%r11), %rdx | ||
;; addq %rcx, %rdx | ||
;; movl (%rdx), %eax | ||
;; movq %rax, %r11 | ||
;; xorq %rax, %r11 | ||
;; lock cmpxchgl %r11d, (%rdx) | ||
;; jne 0x53 | ||
;; 64: addq $0x10, %rsp | ||
;; popq %rbp | ||
;; retq | ||
;; 6a: ud2 | ||
;; 6c: ud2 |
39 changes: 39 additions & 0 deletions
39
tests/disas/winch/x64/atomic/rmw/i64_atomic_rmw16_andu.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,39 @@ | ||
;;! target = "x86_64" | ||
;;! test = "winch" | ||
|
||
(module | ||
(memory 1 1 shared) | ||
(func (export "_start") (result i64) | ||
(i64.atomic.rmw16.and_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 0x75 | ||
;; 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 0x77 | ||
;; 46: movl $0, %ecx | ||
;; movq 0x58(%r14), %r11 | ||
;; movq (%r11), %rdx | ||
;; addq %rcx, %rdx | ||
;; movzwq (%rdx), %rax | ||
;; movq %rax, %r11 | ||
;; andq %rax, %r11 | ||
;; lock cmpxchgw %r11w, (%rdx) | ||
;; jne 0x59 | ||
;; 6b: movzwq %ax, %rax | ||
;; addq $0x10, %rsp | ||
;; popq %rbp | ||
;; retq | ||
;; 75: ud2 | ||
;; 77: ud2 |
Oops, something went wrong.