-
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.
* add MemOpKind to wasm_store * add fence to x64 asm * implement atomic store for x64 masm * emit error for 128bits atomic store * propagate MemOpKind from Visitor * implement atomic store visitor methods * add atomic store tests * fmt * whitelist spec tests * atomic heap address compute align check * fmt * edit comment * cleanup check align function * add doc for check_align * review edits * review edits - use scratch register for tmp in emit_align_check - pop-push value from stack rather than peeking in emit_align_check * final edits
- Loading branch information
1 parent
7f9049b
commit 3a4cf0a
Showing
19 changed files
with
442 additions
and
51 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
;;! target = "x86_64" | ||
;;! test = "winch" | ||
|
||
(module | ||
(import "env" "memory" (memory 1 1 shared)) | ||
(func (i32.atomic.store (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 0x5c | ||
;; 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 0x5e | ||
;; 42: movl $0, %ecx | ||
;; movq 0x58(%r14), %r11 | ||
;; movq (%r11), %rdx | ||
;; addq %rcx, %rdx | ||
;; movl %eax, (%rdx) | ||
;; mfence | ||
;; addq $0x10, %rsp | ||
;; popq %rbp | ||
;; retq | ||
;; 5c: ud2 | ||
;; 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 | ||
(import "env" "memory" (memory 1 1 shared)) | ||
(func (i32.atomic.store16 (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 0x5f | ||
;; 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 0x61 | ||
;; 44: movl $0, %ecx | ||
;; movq 0x58(%r14), %r11 | ||
;; movq (%r11), %rdx | ||
;; addq %rcx, %rdx | ||
;; movw %ax, (%rdx) | ||
;; mfence | ||
;; addq $0x10, %rsp | ||
;; popq %rbp | ||
;; retq | ||
;; 5f: ud2 | ||
;; 61: 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,29 @@ | ||
;;! target = "x86_64" | ||
;;! test = "winch" | ||
|
||
(module | ||
(import "env" "memory" (memory 1 1 shared)) | ||
(func (i32.atomic.store8 (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 0x4b | ||
;; 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 | ||
;; movb %al, (%rdx) | ||
;; mfence | ||
;; addq $0x10, %rsp | ||
;; popq %rbp | ||
;; retq | ||
;; 4b: 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 | ||
(import "env" "memory" (memory 1 1 shared)) | ||
(func (i64.atomic.store (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 | ||
;; andq $7, %rcx | ||
;; cmpq $0, %rcx | ||
;; jne 0x63 | ||
;; 46: movl $0, %ecx | ||
;; movq 0x58(%r14), %r11 | ||
;; movq (%r11), %rdx | ||
;; addq %rcx, %rdx | ||
;; movq %rax, (%rdx) | ||
;; mfence | ||
;; 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,34 @@ | ||
;;! target = "x86_64" | ||
;;! test = "winch" | ||
|
||
(module | ||
(import "env" "memory" (memory 1 1 shared)) | ||
(func (i64.atomic.store16 (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 | ||
;; andw $1, %cx | ||
;; cmpw $0, %cx | ||
;; jne 0x63 | ||
;; 46: movl $0, %ecx | ||
;; movq 0x58(%r14), %r11 | ||
;; movq (%r11), %rdx | ||
;; addq %rcx, %rdx | ||
;; movw %ax, (%rdx) | ||
;; mfence | ||
;; 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,34 @@ | ||
;;! target = "x86_64" | ||
;;! test = "winch" | ||
|
||
(module | ||
(import "env" "memory" (memory 1 1 shared)) | ||
(func (i64.atomic.store32 (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 0x5e | ||
;; 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 0x60 | ||
;; 44: movl $0, %ecx | ||
;; movq 0x58(%r14), %r11 | ||
;; movq (%r11), %rdx | ||
;; addq %rcx, %rdx | ||
;; movl %eax, (%rdx) | ||
;; mfence | ||
;; addq $0x10, %rsp | ||
;; popq %rbp | ||
;; retq | ||
;; 5e: ud2 | ||
;; 60: 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,29 @@ | ||
;;! target = "x86_64" | ||
;;! test = "winch" | ||
|
||
(module | ||
(import "env" "memory" (memory 1 1 shared)) | ||
(func (i64.atomic.store8 (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 0x4d | ||
;; 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 | ||
;; movb %al, (%rdx) | ||
;; mfence | ||
;; addq $0x10, %rsp | ||
;; popq %rbp | ||
;; retq | ||
;; 4d: ud2 |
Oops, something went wrong.