Skip to content

Commit

Permalink
Don't use SSE4.1 instructions unless the target supports it
Browse files Browse the repository at this point in the history
Fixes servo#48.

Enabling the SIMD code path now requires building with
`RUSTFLAGS="-C target-feature=+sse4.1"` or similar.
  • Loading branch information
mbrubeck committed Jun 14, 2016
1 parent dd7cbe2 commit 9c89c32
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![cfg_attr(feature = "unstable", feature(asm, repr_simd, test))]
#![cfg_attr(feature = "unstable", feature(asm, cfg_target_feature, repr_simd, test))]

extern crate heapsize;

Expand Down
4 changes: 2 additions & 2 deletions src/side_offsets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,13 @@ impl SideOffsets2DSimdI32 {
}
}

#[cfg(not(target_arch = "x86_64"))]
#[cfg(not(target_feature = "sse4.1"))]
#[inline]
pub fn is_zero(&self) -> bool {
self.top == 0 && self.right == 0 && self.bottom == 0 && self.left == 0
}

#[cfg(target_arch = "x86_64")]
#[cfg(target_feature = "sse4.1")]
#[inline]
pub fn is_zero(&self) -> bool {
let is_zero: bool;
Expand Down

0 comments on commit 9c89c32

Please sign in to comment.