Skip to content

Commit 3bef713

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 3bef713

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "euclid"
3-
version = "0.6.8"
3+
version = "0.6.9"
44
authors = ["The Servo Project Developers"]
55
description = "Geometry primitives"
66
documentation = "http://doc.servo.org/euclid/"

src/lib.rs

+1-1
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

+2-2
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)