Skip to content

Commit afba6fc

Browse files
authored
Uncomment _mm256_mpsadbw_epu8 (rust-lang#128)
Just needed some `constify_imm8!` treatment Closes rust-lang#59
1 parent b2028d5 commit afba6fc

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

Diff for: ci/run.sh

-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
set -ex
44

5-
# FIXME(rust-lang/rust#45201) shouldn't need to specify one codegen unit
6-
export RUSTFLAGS="$RUSTFLAGS -C codegen-units=1"
7-
85
# Tests are all super fast anyway, and they fault often enough on travis that
96
# having only one thread increases debuggability to be worth it.
107
export RUST_TEST_THREADS=1

Diff for: src/x86/avx2.rs

+5-8
Original file line numberDiff line numberDiff line change
@@ -573,9 +573,6 @@ pub unsafe fn _mm256_movemask_epi8(a: i8x32) -> i32 {
573573
pmovmskb(a)
574574
}
575575

576-
/*
577-
LLVM ERROR: Cannot select: intrinsic %llvm.x86.avx2.mpsadbw
578-
579576
/// Compute the sum of absolute differences (SADs) of quadruplets of unsigned
580577
/// 8-bit integers in `a` compared to those in `b`, and store the 16-bit
581578
/// results in dst. Eight SADs are performed for each 128-bit lane using one
@@ -585,11 +582,13 @@ LLVM ERROR: Cannot select: intrinsic %llvm.x86.avx2.mpsadbw
585582
/// starting at the offset specified in `imm8`.
586583
#[inline(always)]
587584
#[target_feature = "+avx2"]
588-
#[cfg_attr(test, assert_instr(vmpsadbw))]
585+
#[cfg_attr(test, assert_instr(vmpsadbw, imm8 = 0))]
589586
pub unsafe fn _mm256_mpsadbw_epu8(a: u8x32, b: u8x32, imm8: i32) -> u16x16 {
590-
mpsadbw(a, b, imm8)
587+
macro_rules! call {
588+
($imm8:expr) => (mpsadbw(a, b, $imm8))
589+
}
590+
constify_imm8!(imm8, call)
591591
}
592-
*/
593592

594593
/// Multiply the low 32-bit integers from each packed 64-bit element in
595594
/// `a` and `b`
@@ -1767,7 +1766,6 @@ mod tests {
17671766
assert_eq!(r, e);
17681767
}
17691768

1770-
/*
17711769
#[simd_test = "avx2"]
17721770
unsafe fn _mm256_mpsadbw_epu8() {
17731771
let a = u8x32::splat(2);
@@ -1776,7 +1774,6 @@ mod tests {
17761774
let e = u16x16::splat(8);
17771775
assert_eq!(r, e);
17781776
}
1779-
*/
17801777

17811778
#[simd_test = "avx2"]
17821779
unsafe fn _mm256_mul_epi32() {

0 commit comments

Comments
 (0)