run tests only in architectures that support them

This commit is contained in:
gnzlbg 2017-09-19 16:30:59 +02:00 committed by Andrew Gallant
parent 045f931b1a
commit ad5ff722de
8 changed files with 10 additions and 13 deletions

View file

@ -1,7 +1,7 @@
#![allow(dead_code)]
#![feature(
const_fn, link_llvm_intrinsics, platform_intrinsics, repr_simd, simd_ffi,
target_feature,
target_feature, cfg_target_feature
)]
/// Platform independent SIMD vector types and operations.

View file

@ -31,7 +31,7 @@ extern "C" {
}
#[cfg(test)]
#[cfg(all(test, target_feature = "avx", any(target_arch = "x86", target_arch = "x86_64")))]
mod tests {
use v256::*;
use x86::avx;
@ -65,7 +65,4 @@ mod tests {
let e = f64x4::new(-4.0,8.0,-4.0,12.0);
assert_eq!(r, e);
}
}
}

View file

@ -1044,7 +1044,7 @@ extern "C" {
}
#[cfg(test)]
#[cfg(all(test, target_feature = "avx2", any(target_arch = "x86", target_arch = "x86_64")))]
mod tests {
use v256::*;
use v128::*;

View file

@ -66,7 +66,7 @@ extern {
fn movmskps(a: f32x4) -> i32;
}
#[cfg(test)]
#[cfg(all(test, target_feature = "sse", any(target_arch = "x86", target_arch = "x86_64")))]
mod tests {
use v128::*;
use x86::sse;

View file

@ -1716,7 +1716,7 @@ extern {
fn movmskpd(a: f64x2) -> i32;
}
#[cfg(test)]
#[cfg(all(test, target_feature = "sse2", any(target_arch = "x86", target_arch = "x86_64")))]
mod tests {
use std::os::raw::c_void;

View file

@ -16,13 +16,13 @@ extern {
fn pblendvb(a: __m128i, b: __m128i, mask: __m128i) -> __m128i;
}
#[cfg(test)]
#[cfg(all(test, target_feature = "sse4.1", any(target_arch = "x86", target_arch = "x86_64")))]
mod tests {
use v128::*;
use x86::sse41;
#[test]
#[target_feature = "+sse4.2"]
#[target_feature = "+sse4.1"]
fn _mm_blendv_epi8() {
let a = i8x16::new(
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);

View file

@ -304,7 +304,7 @@ extern {
fn pcmpestri128(a: __m128i, la: i32, b: __m128i, lb: i32, imm8: i8) -> i32;
}
#[cfg(test)]
#[cfg(all(test, target_feature = "sse4.2", any(target_arch = "x86", target_arch = "x86_64")))]
mod tests {
use v128::*;
use x86::{__m128i, sse42};

View file

@ -50,7 +50,7 @@ extern {
fn pshufb128(a: u8x16, b: u8x16) -> u8x16;
}
#[cfg(test)]
#[cfg(all(test, target_feature = "ssse3", any(target_arch = "x86", target_arch = "x86_64")))]
mod tests {
use v128::*;
use x86::ssse3 as ssse3;