-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Implement fcvt_from_uint (i32x4 -> f32x4) for x86 #1765
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
cb48f59
Add x86_vcvtudq2ps instruction
abrown 5a6ae42
Add x86_pblendw instruction
abrown 235e4f9
Add AVX512F flag
abrown eca8126
Add x86 legalization for fcvt_from_uint.f32x4
abrown c513892
Translate Wasm's f32x4.convert_i32x4_u instruction to Cranelift's fcv…
abrown File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
9 changes: 9 additions & 0 deletions
9
cranelift/filetests/filetests/isa/x86/simd-avx512-conversion-binemit.clif
This file contains hidden or 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,9 @@ | ||
| test binemit | ||
| set enable_simd | ||
| target x86_64 has_avx512vl=true | ||
|
|
||
| function %fcvt_from_uint(i32x4) { | ||
| block0(v0: i32x4 [%xmm2]): | ||
| [-, %xmm6] v1 = x86_vcvtudq2ps v0 ; bin: 62 f1 7f 08 7a f2 | ||
| return | ||
| } |
10 changes: 10 additions & 0 deletions
10
cranelift/filetests/filetests/isa/x86/simd-avx512-conversion-legalize.clif
This file contains hidden or 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,10 @@ | ||
| test legalizer | ||
| set enable_simd | ||
| target x86_64 skylake has_avx512f=true | ||
|
|
||
| function %fcvt_from_uint(i32x4) -> f32x4 { | ||
| block0(v0:i32x4): | ||
| v1 = fcvt_from_uint.f32x4 v0 | ||
| ; check: v1 = x86_vcvtudq2ps v0 | ||
| return v1 | ||
| } |
19 changes: 19 additions & 0 deletions
19
cranelift/filetests/filetests/isa/x86/simd-conversion-legalize.clif
This file contains hidden or 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,19 @@ | ||
| test legalizer | ||
| set enable_simd | ||
| target x86_64 skylake | ||
|
|
||
| function %fcvt_from_uint(i32x4) -> f32x4 { | ||
| block0(v0:i32x4): | ||
| v1 = fcvt_from_uint.f32x4 v0 | ||
| ; check: v2 = raw_bitcast.i16x8 v0 | ||
| ; nextln: v3 = vconst.i16x8 const0 | ||
| ; nextln: v4 = x86_pblendw v3, v2, 85 | ||
| ; nextln: v5 = raw_bitcast.i32x4 v4 | ||
| ; nextln: v6 = isub v0, v5 | ||
| ; nextln: v7 = fcvt_from_sint.f32x4 v5 | ||
| ; nextln: v8 = ushr_imm v6, 1 | ||
| ; nextln: v9 = fcvt_from_sint.f32x4 v8 | ||
| ; nextln: v10 = fadd v9, v9 | ||
| ; nextln: v1 = fadd v10, v7 | ||
| return v1 | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.