-
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.
Winch: Add SIMD load and extend and load and splat instructions for x…
…64 (#9950) * Winch: Add SIMD load and extend and load and splat instructions * Try removing simd_align from the unsupported for Winch list * No more todos and rename loadkind variant * Use AVX instructions for loads * Adjust load with splat instructions to use AVX * SIMD spec tests for Winch should fail on x64 MacOS * Refine check for should-fail * Adjust conditional check to avoid compile error
- Loading branch information
1 parent
a1511a0
commit dd18896
Showing
18 changed files
with
638 additions
and
64 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,29 @@ | ||
;;! target = "x86_64" | ||
;;! test = "winch" | ||
;;! flags = [ "-Ccranelift-has-avx=true", "-Ccranelift-has-avx2=true" ] | ||
|
||
(module | ||
(memory (data "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\a0\7f")) | ||
|
||
(func (export "v128.load16_splat") (result v128) (v128.load16_splat (i32.const 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) | ||
;; movl $0, %eax | ||
;; movq 0x60(%r14), %rcx | ||
;; addq %rax, %rcx | ||
;; vpbroadcastw (%rcx), %xmm0 | ||
;; addq $0x10, %rsp | ||
;; popq %rbp | ||
;; retq | ||
;; 43: 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" | ||
;;! flags = [ "-Ccranelift-has-avx=true" ] | ||
|
||
(module | ||
(memory (data "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\a0\7f")) | ||
|
||
(func (export "v128.load16x4_s") (result v128) (v128.load16x4_s (i32.const 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) | ||
;; movl $0, %eax | ||
;; movq 0x60(%r14), %rcx | ||
;; addq %rax, %rcx | ||
;; vpmovsxwd (%rcx), %xmm0 | ||
;; addq $0x10, %rsp | ||
;; popq %rbp | ||
;; retq | ||
;; 43: 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" | ||
;;! flags = [ "-Ccranelift-has-avx=true" ] | ||
|
||
(module | ||
(memory (data "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\a0\7f")) | ||
|
||
(func (export "v128.load16x4_u") (result v128) (v128.load16x4_u (i32.const 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) | ||
;; movl $0, %eax | ||
;; movq 0x60(%r14), %rcx | ||
;; addq %rax, %rcx | ||
;; vpmovzxwd (%rcx), %xmm0 | ||
;; addq $0x10, %rsp | ||
;; popq %rbp | ||
;; retq | ||
;; 43: 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" | ||
;;! flags = [ "-Ccranelift-has-avx=true", "-Ccranelift-has-avx2=true" ] | ||
|
||
(module | ||
(memory (data "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\a0\7f")) | ||
|
||
(func (export "v128.load32_splat") (result v128) (v128.load32_splat (i32.const 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) | ||
;; movl $0, %eax | ||
;; movq 0x60(%r14), %rcx | ||
;; addq %rax, %rcx | ||
;; vpbroadcastd (%rcx), %xmm0 | ||
;; addq $0x10, %rsp | ||
;; popq %rbp | ||
;; retq | ||
;; 43: 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" | ||
;;! flags = [ "-Ccranelift-has-avx=true" ] | ||
|
||
(module | ||
(memory (data "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\a0\7f")) | ||
|
||
(func (export "v128.load32x2_s") (result v128) (v128.load32x2_s (i32.const 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) | ||
;; movl $0, %eax | ||
;; movq 0x60(%r14), %rcx | ||
;; addq %rax, %rcx | ||
;; vpmovsxdq (%rcx), %xmm0 | ||
;; addq $0x10, %rsp | ||
;; popq %rbp | ||
;; retq | ||
;; 43: 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" | ||
;;! flags = [ "-Ccranelift-has-avx=true" ] | ||
|
||
(module | ||
(memory (data "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\a0\7f")) | ||
|
||
(func (export "v128.load32x2_u") (result v128) (v128.load32x2_u (i32.const 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) | ||
;; movl $0, %eax | ||
;; movq 0x60(%r14), %rcx | ||
;; addq %rax, %rcx | ||
;; vpmovzxdq (%rcx), %xmm0 | ||
;; addq $0x10, %rsp | ||
;; popq %rbp | ||
;; retq | ||
;; 43: 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,30 @@ | ||
;;! target = "x86_64" | ||
;;! test = "winch" | ||
;;! flags = [ "-Ccranelift-has-avx=true" ] | ||
|
||
(module | ||
(memory (data "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\a0\7f")) | ||
|
||
(func (export "v128.load64_splat") (result v128) (v128.load64_splat (i32.const 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 0x47 | ||
;; 1c: movq %rdi, %r14 | ||
;; subq $0x10, %rsp | ||
;; movq %rdi, 8(%rsp) | ||
;; movq %rsi, (%rsp) | ||
;; movl $0, %eax | ||
;; movq 0x60(%r14), %rcx | ||
;; addq %rax, %rcx | ||
;; movsd (%rcx), %xmm0 | ||
;; vpshufd $0x44, %xmm0, %xmm0 | ||
;; addq $0x10, %rsp | ||
;; popq %rbp | ||
;; retq | ||
;; 47: 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" | ||
;;! flags = [ "-Ccranelift-has-avx=true", "-Ccranelift-has-avx2=true" ] | ||
|
||
(module | ||
(memory (data "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\a0\7f")) | ||
|
||
(func (export "v128.load8_splat") (result v128) (v128.load8_splat (i32.const 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) | ||
;; movl $0, %eax | ||
;; movq 0x60(%r14), %rcx | ||
;; addq %rax, %rcx | ||
;; vpbroadcastb (%rcx), %xmm0 | ||
;; addq $0x10, %rsp | ||
;; popq %rbp | ||
;; retq | ||
;; 43: 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" | ||
;;! flags = [ "-Ccranelift-has-avx=true" ] | ||
|
||
(module | ||
(memory (data "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\a0\7f")) | ||
|
||
(func (export "v128.load8x8_s") (result v128) (v128.load8x8_s (i32.const 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) | ||
;; movl $0, %eax | ||
;; movq 0x60(%r14), %rcx | ||
;; addq %rax, %rcx | ||
;; vpmovsxbw (%rcx), %xmm0 | ||
;; addq $0x10, %rsp | ||
;; popq %rbp | ||
;; retq | ||
;; 43: 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" | ||
;;! flags = [ "-Ccranelift-has-avx=true" ] | ||
|
||
(module | ||
(memory (data "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\a0\7f")) | ||
|
||
(func (export "v128.load8x8_u") (result v128) (v128.load8x8_u (i32.const 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) | ||
;; movl $0, %eax | ||
;; movq 0x60(%r14), %rcx | ||
;; addq %rax, %rcx | ||
;; vpmovzxbw (%rcx), %xmm0 | ||
;; addq $0x10, %rsp | ||
;; popq %rbp | ||
;; retq | ||
;; 43: 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
Oops, something went wrong.