Skip to content

Commit 437bb8c

Browse files
mbrubecknical
authored andcommitted
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 88e4b3e commit 437bb8c

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.16.2"
3+
version = "0.16.3"
44
authors = ["The Servo Project Developers"]
55
description = "Geometry primitives"
66
documentation = "https://docs.rs/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, fn_must_use))]
10+
#![cfg_attr(feature = "unstable", feature(asm, cfg_target_feature, repr_simd, test, fn_must_use))]
1111

1212
//! A collection of strongly typed math tools for computer graphics with an inclination
1313
//! towards 2d graphics and layout.

src/side_offsets.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -202,13 +202,13 @@ impl SideOffsets2DSimdI32 {
202202
}
203203
}
204204

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

211-
#[cfg(target_arch = "x86_64")]
211+
#[cfg(target_feature = "sse4.1")]
212212
#[inline]
213213
pub fn is_zero(&self) -> bool {
214214
let is_zero: bool;

0 commit comments

Comments
 (0)