From 832e79db941efd06929e671ce5cca0d3cb75ffdd Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Sat, 12 Jan 2019 20:46:06 -0800 Subject: [PATCH] Conditionally compile SIMD --- geometry/src/simd.rs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/geometry/src/simd.rs b/geometry/src/simd.rs index 14c4c0e9..b1e92ef9 100644 --- a/geometry/src/simd.rs +++ b/geometry/src/simd.rs @@ -8,22 +8,24 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[cfg(feature = "pf-no-simd")] +#![allow(dead_code)] + +#[cfg(any(feature = "pf-no-simd", all(not(target_arch = "x86"), not(target_arch = "x86_64"))))] pub type F32x4 = scalar::F32x4; -#[cfg(feature = "pf-no-simd")] +#[cfg(any(feature = "pf-no-simd", all(not(target_arch = "x86"), not(target_arch = "x86_64"))))] pub type I32x4 = scalar::I32x4; -#[cfg(feature = "pf-no-simd")] +#[cfg(any(feature = "pf-no-simd", all(not(target_arch = "x86"), not(target_arch = "x86_64"))))] pub type U32x4 = scalar::U32x4; -#[cfg(feature = "pf-no-simd")] +#[cfg(any(feature = "pf-no-simd", all(not(target_arch = "x86"), not(target_arch = "x86_64"))))] pub type U8x16 = scalar::U8x16; -#[cfg(not(feature = "pf-no-simd"))] +#[cfg(all(not(feature = "pf-no-simd"), any(target_arch = "x86", target_arch = "x86_64")))] pub type F32x4 = x86::F32x4; -#[cfg(not(feature = "pf-no-simd"))] +#[cfg(all(not(feature = "pf-no-simd"), any(target_arch = "x86", target_arch = "x86_64")))] pub type I32x4 = x86::I32x4; -#[cfg(not(feature = "pf-no-simd"))] +#[cfg(all(not(feature = "pf-no-simd"), any(target_arch = "x86", target_arch = "x86_64")))] pub type U32x4 = x86::U32x4; -#[cfg(not(feature = "pf-no-simd"))] +#[cfg(all(not(feature = "pf-no-simd"), any(target_arch = "x86", target_arch = "x86_64")))] pub type U8x16 = x86::U8x16; mod scalar { @@ -323,6 +325,7 @@ mod scalar { } } +#[cfg(any(not(feature = "pf-no-simd"), target_arch = "x86", target_arch = "x86_64"))] mod x86 { use std::arch::x86_64::{self, __m128, __m128d, __m128i}; use std::cmp::PartialEq;