Skip to content

Commit 9c89c32

Browse files
committed
Don't use SSE4.1 instructions unless the target supports it
Fixes #48. Enabling the SIMD code path now requires building with `RUSTFLAGS="-C target-feature=+sse4.1"` or similar.
1 parent dd7cbe2 commit 9c89c32

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// option. This file may not be copied, modified, or distributed
88
// except according to those terms.
99

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

1212
extern crate heapsize;
1313

src/side_offsets.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,13 +146,13 @@ impl SideOffsets2DSimdI32 {
146146
}
147147
}
148148

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

155-
#[cfg(target_arch = "x86_64")]
155+
#[cfg(target_feature = "sse4.1")]
156156
#[inline]
157157
pub fn is_zero(&self) -> bool {
158158
let is_zero: bool;

0 commit comments

Comments
 (0)