-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Verify code generation of the AVX-512 rotates
- Loading branch information
Showing
6 changed files
with
99 additions
and
4 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,8 @@ | ||
[package] | ||
name = "verify" | ||
version = "0.1.0" | ||
authors = ["gnzlbg <gonzalobg88@gmail.com>"] | ||
|
||
[dev-dependencies] | ||
stdsimd-test = { git = "https://github.com/rust-lang-nursery/stdsimd.git" } | ||
packed_simd = { path = ".." } |
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 @@ | ||
mod ops; |
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 @@ | ||
mod vector_rotates; |
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,70 @@ | ||
mod u64x8 { | ||
use packed_simd::*; | ||
use stdsimd_test::assert_instr; | ||
|
||
#[inline] | ||
#[cfg_attr( | ||
any(target_arch = "x86", target_arch = "x86_64"), | ||
target_feature(enable = "avx512f,avx512vl") | ||
)] | ||
#[cfg_attr( | ||
any(target_arch = "x86", target_arch = "x86_64"), | ||
assert_instr(vpro) | ||
)] | ||
unsafe fn rotate_right_variable(x: u64x8, v: u64x8) -> u64x8 { | ||
x.rotate_right(v) | ||
} | ||
|
||
#[inline] | ||
#[cfg_attr( | ||
any(target_arch = "x86", target_arch = "x86_64"), | ||
target_feature(enable = "avx512f,avx512vl") | ||
)] | ||
#[cfg_attr( | ||
any(target_arch = "x86", target_arch = "x86_64"), | ||
assert_instr(vpro) | ||
)] | ||
unsafe fn rotate_left_variable(x: u64x8, v: u64x8) -> u64x8 { | ||
x.rotate_left(v) | ||
} | ||
|
||
#[inline] | ||
#[cfg_attr( | ||
any(target_arch = "x86", target_arch = "x86_64"), | ||
target_feature(enable = "avx512f") | ||
)] | ||
#[cfg_attr( | ||
any(target_arch = "x86", target_arch = "x86_64"), | ||
assert_instr(vpro) | ||
)] | ||
unsafe fn rotate_right(x: u64x8) -> u64x8 { | ||
x.rotate_right(u64x8::splat(12)) | ||
} | ||
|
||
#[inline] | ||
#[cfg_attr( | ||
any(target_arch = "x86", target_arch = "x86_64"), | ||
target_feature(enable = "avx512f") | ||
)] | ||
#[cfg_attr( | ||
any(target_arch = "x86", target_arch = "x86_64"), | ||
assert_instr(vpro) | ||
)] | ||
unsafe fn rotate_left(x: u64x8) -> u64x8 { | ||
x.rotate_left(u64x8::splat(12)) | ||
} | ||
|
||
#[inline] | ||
#[cfg_attr( | ||
any(target_arch = "x86", target_arch = "x86_64"), | ||
target_feature(enable = "avx512f") | ||
)] | ||
#[cfg_attr( | ||
any(target_arch = "x86", target_arch = "x86_64"), | ||
assert_instr(vpro) | ||
)] | ||
unsafe fn rotate_left_x2(x: u64x2) -> u64x2 { | ||
x.rotate_left(u64x2::splat(12)) | ||
} | ||
|
||
} |
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,10 @@ | ||
#![feature(rust_2018_preview, use_extern_macros, avx512_target_feature)] | ||
|
||
#[cfg(test)] | ||
extern crate packed_simd; | ||
|
||
#[cfg(test)] | ||
extern crate stdsimd_test; | ||
|
||
#[cfg(test)] | ||
mod api; |