Skip to content

Commit

Permalink
fix test attr
Browse files Browse the repository at this point in the history
  • Loading branch information
TheIronBorn committed Jul 6, 2018
1 parent 31823d7 commit 9759c78
Showing 1 changed file with 35 additions and 10 deletions.
45 changes: 35 additions & 10 deletions crates/coresimd/tests/rotate_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,36 +14,61 @@ use stdsimd_test::assert_instr;
// Verify that supported hardware compiles rotates into single instructions

#[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))]
#[cfg_attr(
all(
any(target_arch = "x86", target_arch = "x86_64"),
target_feature(enable = "avx512f")
),
assert_instr(vpro)
)]
unsafe fn rotate_right_variable(x: u64x8) -> u64x8 {
x.rotate_right(u64x8::new(0, 1, 2, 3, 4, 5, 6, 7))
}

#[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))]
#[cfg_attr(
all(
any(target_arch = "x86", target_arch = "x86_64"),
target_feature(enable = "avx512f")
),
assert_instr(vpro)
)]
unsafe fn rotate_left_variable(x: u64x8) -> u64x8 {
x.rotate_left(u64x8::new(0, 1, 2, 3, 4, 5, 6, 7))
}

#[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))]
#[cfg_attr(
all(
any(target_arch = "x86", target_arch = "x86_64"),
target_feature(enable = "avx512f")
),
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))]
#[cfg_attr(
all(
any(target_arch = "x86", target_arch = "x86_64"),
target_feature(enable = "avx512f")
),
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))]
#[cfg_attr(
all(
any(target_arch = "x86", target_arch = "x86_64"),
target_feature(enable = "avx512f")
),
assert_instr(vpro)
)]
unsafe fn rotate_left_x2(x: u64x2) -> u64x2 {
x.rotate_left(u64x2::splat(12))
}

0 comments on commit 9759c78

Please sign in to comment.