forked from bytecodealliance/wasmtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Winch:
v128
logical ops for x64 (bytecodealliance#10109)
* v128.not * v128.and * v128.andnot * v128.or * rename test files * v128.xor * enable spec tests * v128.bitselect * v128.any_true * v128.load*_lane * v128.load*_lane * cleanup duplicate methods * move lane/load to wasm_store/load * rename v128 functions * ensure avx support * fmt * fix merge blips * fix unsupported tests * fix missing avx checks
- Loading branch information
1 parent
24620d9
commit cb195e5
Showing
23 changed files
with
1,081 additions
and
281 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
;;! target = "x86_64" | ||
;;! test = "winch" | ||
;;! flags = [ "-Ccranelift-has-avx" ] | ||
|
||
(module | ||
(func (export "_start") (result v128) | ||
(v128.and | ||
(v128.const i64x2 0 0xFFFFFFFFFFFFFFFF) | ||
(v128.const i64x2 0xFFFFFFFFFFFFFFFF 0) | ||
))) | ||
;; wasm[0]::function[0]: | ||
;; pushq %rbp | ||
;; movq %rsp, %rbp | ||
;; movq 8(%rdi), %r11 | ||
;; movq 0x10(%r11), %r11 | ||
;; addq $0x10, %r11 | ||
;; cmpq %rsp, %r11 | ||
;; ja 0x4a | ||
;; 1c: movq %rdi, %r14 | ||
;; subq $0x10, %rsp | ||
;; movq %rdi, 8(%rsp) | ||
;; movq %rsi, (%rsp) | ||
;; movdqu 0x1c(%rip), %xmm0 | ||
;; movdqu 0x24(%rip), %xmm1 | ||
;; vpand %xmm0, %xmm1, %xmm1 | ||
;; movdqa %xmm1, %xmm0 | ||
;; addq $0x10, %rsp | ||
;; popq %rbp | ||
;; retq | ||
;; 4a: ud2 | ||
;; 4c: addb %al, (%rax) | ||
;; 4e: addb %al, (%rax) |
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,32 @@ | ||
;;! target = "x86_64" | ||
;;! test = "winch" | ||
;;! flags = [ "-Ccranelift-has-avx" ] | ||
|
||
(module | ||
(func (export "_start") (result v128) | ||
(v128.andnot | ||
(v128.const i64x2 0 0xFFFFFFFFFFFFFFFF) | ||
(v128.const i64x2 0xFFFFFFFFFFFFFFFF 0) | ||
))) | ||
;; wasm[0]::function[0]: | ||
;; pushq %rbp | ||
;; movq %rsp, %rbp | ||
;; movq 8(%rdi), %r11 | ||
;; movq 0x10(%r11), %r11 | ||
;; addq $0x10, %r11 | ||
;; cmpq %rsp, %r11 | ||
;; ja 0x4a | ||
;; 1c: movq %rdi, %r14 | ||
;; subq $0x10, %rsp | ||
;; movq %rdi, 8(%rsp) | ||
;; movq %rsi, (%rsp) | ||
;; movdqu 0x1c(%rip), %xmm0 | ||
;; movdqu 0x24(%rip), %xmm1 | ||
;; vpandn %xmm1, %xmm0, %xmm1 | ||
;; movdqa %xmm1, %xmm0 | ||
;; addq $0x10, %rsp | ||
;; popq %rbp | ||
;; retq | ||
;; 4a: ud2 | ||
;; 4c: addb %al, (%rax) | ||
;; 4e: addb %al, (%rax) |
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" | ||
;;! flags = [ "-Ccranelift-has-avx" ] | ||
|
||
(module | ||
(func (export "_start") (result i32) | ||
(v128.any_true | ||
(v128.const i64x2 0 0xFFFFFFFFFFFFFFFF) | ||
))) | ||
;; wasm[0]::function[0]: | ||
;; pushq %rbp | ||
;; movq %rsp, %rbp | ||
;; movq 8(%rdi), %r11 | ||
;; movq 0x10(%r11), %r11 | ||
;; addq $0x10, %r11 | ||
;; cmpq %rsp, %r11 | ||
;; ja 0x48 | ||
;; 1c: movq %rdi, %r14 | ||
;; subq $0x10, %rsp | ||
;; movq %rdi, 8(%rsp) | ||
;; movq %rsi, (%rsp) | ||
;; movdqu 0x1c(%rip), %xmm0 | ||
;; vptest %xmm0, %xmm0 | ||
;; movl $0, %eax | ||
;; setne %al | ||
;; addq $0x10, %rsp | ||
;; popq %rbp | ||
;; retq | ||
;; 48: ud2 | ||
;; 4a: addb %al, (%rax) | ||
;; 4c: addb %al, (%rax) | ||
;; 4e: addb %al, (%rax) | ||
;; 50: addb %al, (%rax) | ||
;; 52: addb %al, (%rax) | ||
;; 54: addb %al, (%rax) | ||
;; 56: addb %al, (%rax) |
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" | ||
;;! flags = [ "-Ccranelift-has-avx" ] | ||
|
||
(module | ||
(func (export "_start") (result v128) | ||
(v128.bitselect | ||
(v128.const i64x2 0x3298472837385628 0x58212382347A3994) | ||
(v128.const i64x2 0x7483929592465832 0x1285837491823847) | ||
(v128.const i64x2 0xFFFFFF0FFFFFFFFF 0xFFFFFF0FFFFFFFFF) | ||
))) | ||
;; wasm[0]::function[0]: | ||
;; pushq %rbp | ||
;; movq %rsp, %rbp | ||
;; movq 8(%rdi), %r11 | ||
;; movq 0x10(%r11), %r11 | ||
;; addq $0x10, %r11 | ||
;; cmpq %rsp, %r11 | ||
;; ja 0x5a | ||
;; 1c: movq %rdi, %r14 | ||
;; subq $0x10, %rsp | ||
;; movq %rdi, 8(%rsp) | ||
;; movq %rsi, (%rsp) | ||
;; movdqu 0x2c(%rip), %xmm0 | ||
;; movdqu 0x34(%rip), %xmm1 | ||
;; movdqu 0x3c(%rip), %xmm2 | ||
;; vpand %xmm0, %xmm2, %xmm15 | ||
;; vpandn %xmm1, %xmm0, %xmm3 | ||
;; vpor %xmm3, %xmm15, %xmm3 | ||
;; movdqa %xmm3, %xmm0 | ||
;; addq $0x10, %rsp | ||
;; popq %rbp | ||
;; retq | ||
;; 5a: ud2 | ||
;; 5c: addb %al, (%rax) | ||
;; 5e: addb %al, (%rax) |
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" | ||
;;! flags = [ "-Ccranelift-has-avx" ] | ||
|
||
(module | ||
(memory 1 1) | ||
(func (export "_start") (result v128) | ||
(v128.load16_lane | ||
1 (i32.const 0) (v128.const i64x2 0xFFFFFFFFFFFFFFFF 0xFFFFFFFFFFFFFFFF) | ||
))) | ||
;; wasm[0]::function[0]: | ||
;; pushq %rbp | ||
;; movq %rsp, %rbp | ||
;; movq 8(%rdi), %r11 | ||
;; movq 0x10(%r11), %r11 | ||
;; addq $0x10, %r11 | ||
;; cmpq %rsp, %r11 | ||
;; ja 0x50 | ||
;; 1c: movq %rdi, %r14 | ||
;; subq $0x10, %rsp | ||
;; movq %rdi, 8(%rsp) | ||
;; movq %rsi, (%rsp) | ||
;; movdqu 0x2c(%rip), %xmm0 | ||
;; movl $0, %eax | ||
;; movq 0x50(%r14), %rcx | ||
;; addq %rax, %rcx | ||
;; movzwq (%rcx), %r11 | ||
;; vpinsrw $1, %r11d, %xmm0, %xmm0 | ||
;; addq $0x10, %rsp | ||
;; popq %rbp | ||
;; retq | ||
;; 50: ud2 | ||
;; 52: addb %al, (%rax) | ||
;; 54: addb %al, (%rax) | ||
;; 56: addb %al, (%rax) | ||
;; 58: addb %al, (%rax) | ||
;; 5a: addb %al, (%rax) | ||
;; 5c: addb %al, (%rax) | ||
;; 5e: addb %al, (%rax) |
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,40 @@ | ||
;;! target = "x86_64" | ||
;;! test = "winch" | ||
;;! flags = [ "-Ccranelift-has-avx" ] | ||
|
||
(module | ||
(memory 1 1) | ||
(func (export "_start") (result v128) | ||
(v128.load32_lane | ||
1 (i32.const 0) (v128.const i64x2 0xFFFFFFFFFFFFFFFF 0xFFFFFFFFFFFFFFFF) | ||
))) | ||
;; 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) | ||
;; movdqu 0x2c(%rip), %xmm0 | ||
;; movl $0, %eax | ||
;; movq 0x50(%r14), %rcx | ||
;; addq %rax, %rcx | ||
;; movl (%rcx), %r11d | ||
;; vpinsrd $1, %r11d, %xmm0, %xmm0 | ||
;; addq $0x10, %rsp | ||
;; popq %rbp | ||
;; retq | ||
;; 4f: ud2 | ||
;; 51: addb %al, (%rax) | ||
;; 53: addb %al, (%rax) | ||
;; 55: addb %al, (%rax) | ||
;; 57: addb %al, (%rax) | ||
;; 59: addb %al, (%rax) | ||
;; 5b: addb %al, (%rax) | ||
;; 5d: addb %al, (%rax) | ||
;; 5f: addb %bh, %bh |
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,40 @@ | ||
;;! target = "x86_64" | ||
;;! test = "winch" | ||
;;! flags = [ "-Ccranelift-has-avx" ] | ||
|
||
(module | ||
(memory 1 1) | ||
(func (export "_start") (result v128) | ||
(v128.load64_lane | ||
1 (i32.const 0) (v128.const i64x2 0xFFFFFFFFFFFFFFFF 0xFFFFFFFFFFFFFFFF) | ||
))) | ||
;; 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) | ||
;; movdqu 0x2c(%rip), %xmm0 | ||
;; movl $0, %eax | ||
;; movq 0x50(%r14), %rcx | ||
;; addq %rax, %rcx | ||
;; movq (%rcx), %r11 | ||
;; vpinsrq $1, %r11, %xmm0, %xmm0 | ||
;; addq $0x10, %rsp | ||
;; popq %rbp | ||
;; retq | ||
;; 4f: ud2 | ||
;; 51: addb %al, (%rax) | ||
;; 53: addb %al, (%rax) | ||
;; 55: addb %al, (%rax) | ||
;; 57: addb %al, (%rax) | ||
;; 59: addb %al, (%rax) | ||
;; 5b: addb %al, (%rax) | ||
;; 5d: addb %al, (%rax) | ||
;; 5f: addb %bh, %bh |
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" | ||
;;! flags = [ "-Ccranelift-has-avx" ] | ||
|
||
(module | ||
(memory 1 1) | ||
(func (export "_start") (result v128) | ||
(v128.load8_lane | ||
1 (i32.const 0) (v128.const i64x2 0xFFFFFFFFFFFFFFFF 0xFFFFFFFFFFFFFFFF) | ||
))) | ||
;; wasm[0]::function[0]: | ||
;; pushq %rbp | ||
;; movq %rsp, %rbp | ||
;; movq 8(%rdi), %r11 | ||
;; movq 0x10(%r11), %r11 | ||
;; addq $0x10, %r11 | ||
;; cmpq %rsp, %r11 | ||
;; ja 0x50 | ||
;; 1c: movq %rdi, %r14 | ||
;; subq $0x10, %rsp | ||
;; movq %rdi, 8(%rsp) | ||
;; movq %rsi, (%rsp) | ||
;; movdqu 0x2c(%rip), %xmm0 | ||
;; movl $0, %eax | ||
;; movq 0x50(%r14), %rcx | ||
;; addq %rax, %rcx | ||
;; movzbq (%rcx), %r11 | ||
;; vpinsrb $1, %r11d, %xmm0, %xmm0 | ||
;; addq $0x10, %rsp | ||
;; popq %rbp | ||
;; retq | ||
;; 50: ud2 | ||
;; 52: addb %al, (%rax) | ||
;; 54: addb %al, (%rax) | ||
;; 56: addb %al, (%rax) | ||
;; 58: addb %al, (%rax) | ||
;; 5a: addb %al, (%rax) | ||
;; 5c: addb %al, (%rax) | ||
;; 5e: addb %al, (%rax) |
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,32 @@ | ||
;;! target = "x86_64" | ||
;;! test = "winch" | ||
;;! flags = [ "-Ccranelift-has-avx" ] | ||
|
||
(module | ||
(func (export "_start") (result v128) | ||
(v128.not (v128.const i64x2 0xFFFFFFFFFFFFFFFF 0)))) | ||
;; wasm[0]::function[0]: | ||
;; pushq %rbp | ||
;; movq %rsp, %rbp | ||
;; movq 8(%rdi), %r11 | ||
;; movq 0x10(%r11), %r11 | ||
;; addq $0x10, %r11 | ||
;; cmpq %rsp, %r11 | ||
;; ja 0x43 | ||
;; 1c: movq %rdi, %r14 | ||
;; subq $0x10, %rsp | ||
;; movq %rdi, 8(%rsp) | ||
;; movq %rsi, (%rsp) | ||
;; movdqu 0x1c(%rip), %xmm0 | ||
;; vpcmpeqd %xmm15, %xmm15, %xmm15 | ||
;; vpxor %xmm0, %xmm15, %xmm0 | ||
;; addq $0x10, %rsp | ||
;; popq %rbp | ||
;; retq | ||
;; 43: ud2 | ||
;; 45: addb %al, (%rax) | ||
;; 47: addb %al, (%rax) | ||
;; 49: addb %al, (%rax) | ||
;; 4b: addb %al, (%rax) | ||
;; 4d: addb %al, (%rax) | ||
;; 4f: addb %bh, %bh |
Oops, something went wrong.