-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
TheIronBorn
committed
Jun 25, 2018
1 parent
1271a3f
commit f02e949
Showing
4 changed files
with
85 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
//! rotate instruction tests | ||
#![feature(stdsimd)] | ||
#![feature(proc_macro)] | ||
#![feature(avx512_target_feature)] | ||
|
||
#[macro_use] | ||
// extern crate assert_instr_macro; | ||
extern crate stdsimd_test; | ||
extern crate stdsimd; | ||
|
||
use stdsimd::simd::*; | ||
use stdsimd_test::assert_instr; | ||
|
||
// Verify that supported hardware compiles rotates into single instructions | ||
|
||
#[inline] | ||
#[target_feature(enable = "avx512f")] | ||
#[cfg_attr(test, assert_instr(vprorvq))] | ||
unsafe fn rotate_right_variable(x: u64x8, y: u64x8) -> u64x8 { | ||
x.rotate_right(y) | ||
} | ||
|
||
#[inline] | ||
#[target_feature(enable = "avx512f")] | ||
#[cfg_attr(test, assert_instr(vprolvq))] | ||
unsafe fn rotate_left_variable(x: u64x8, y: u64x8) -> u64x8 { | ||
x.rotate_left(y) | ||
} | ||
|
||
#[inline] | ||
#[target_feature(enable = "avx512f")] | ||
#[cfg_attr(test, assert_instr(vprorq))] | ||
unsafe fn rotate_right(x: u64x8, y: u64) -> u64x8 { | ||
x.rotate_right(y) | ||
} | ||
|
||
#[inline] | ||
#[target_feature(enable = "avx512f")] | ||
#[cfg_attr(test, assert_instr(vprolq))] | ||
unsafe fn rotate_left(x: u64x8, y: u64) -> u64x8 { | ||
x.rotate_left(y) | ||
} |