Skip to content
Permalink
Browse files

Use popcount only on x86.

  • Loading branch information...
qnikst committed Mar 13, 2019
1 parent 43d7197 commit e1d08491988f01cda6cec1aa019226f555791f66
Showing with 3 additions and 3 deletions.
  1. +3 −3 imhamt/src/bitmap.rs
@@ -61,7 +61,7 @@ impl SmallBitmap {
self.0 == 0
}

#[target_feature(enable = "popcnt")]
#[cfg_attr(target_arch = "x86", target_feature(enable = "popcnt"))]
unsafe fn present_fast(&self) -> usize {
self.0.count_ones() as usize
}
@@ -79,7 +79,7 @@ impl SmallBitmap {

/// Get the sparse array index from a level index
#[inline]
#[target_feature(enable = "popcnt")]
#[cfg_attr(target_arch = "x86", target_feature(enable = "popcnt"))]
unsafe fn get_index_sparse_fast(&self, b: LevelIndex) -> ArrayIndex {
let mask = b.mask();
if self.0 & mask == 0 {
@@ -95,7 +95,7 @@ impl SmallBitmap {
}

#[inline]
#[target_feature(enable = "popcnt")]
#[cfg_attr(target_arch = "x86", target_feature(enable = "popcnt"))]
unsafe fn get_sparse_pos_fast(&self, b: LevelIndex) -> ArrayIndex {
let mask = b.mask();
ArrayIndex::create((self.0 & (mask - 1)).count_ones() as usize)

1 comment on commit e1d0849

@gufmar

This comment has been minimized.

Copy link

gufmar commented on e1d0849 Mar 15, 2019

this solved critical compilation errors on ARM systems. thanks!

Please sign in to comment.
You can’t perform that action at this time.