Skip to content

Commit

Permalink
always inline rotates
Browse files Browse the repository at this point in the history
  • Loading branch information
TheIronBorn committed Jul 6, 2018
1 parent 86b1f48 commit 31823d7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions coresimd/ppsv/api/rotates.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
//! Implements integer rotates.
#![allow(unused)]

// inline(always) to encourage the compiler to generate rotate instructions
// where available
macro_rules! impl_vector_rotates {
($id:ident, $elem_ty:ident) => {
impl $id {
Expand All @@ -11,7 +13,7 @@ macro_rules! impl_vector_rotates {
/// Please note this isn't the same operation as `<<`!. Also note it
/// isn't equivalent to `slice::rotate_left`, it doesn't move the vector's
/// lanes around. (that can be implemented with vector shuffles).
#[inline]
#[inline(always)]
pub fn rotate_left(self, n: $id) -> $id {
const LANE_WIDTH: $elem_ty = ::mem::size_of::<$elem_ty>() as $elem_ty * 8;
// Protect against undefined behavior for over-long bit shifts
Expand All @@ -26,7 +28,7 @@ macro_rules! impl_vector_rotates {
/// Please note this isn't the same operation as `>>`!. Also note it
/// isn't similar to `slice::rotate_right`, it doesn't move the vector's
/// lanes around. (that can be implemented with vector shuffles).
#[inline]
#[inline(always)]
pub fn rotate_right(self, n: $id) -> $id {
const LANE_WIDTH: $elem_ty = ::mem::size_of::<$elem_ty>() as $elem_ty * 8;
// Protect against undefined behavior for over-long bit shifts
Expand Down
2 changes: 1 addition & 1 deletion crates/coresimd/tests/rotate_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#![feature(avx512_target_feature)]
#![feature(abi_vectorcall)]

extern crate stdsimd_test;
extern crate stdsimd;
extern crate stdsimd_test;

use stdsimd::simd::*;
use stdsimd_test::assert_instr;
Expand Down

0 comments on commit 31823d7

Please sign in to comment.