Skip to content

Commit

Permalink
ssse3: _mm_abs_pi8 failing
Browse files Browse the repository at this point in the history
Intrinsic has incorrect return type!
<8 x i8> (<8 x i8>)* @llvm.x86.ssse3.pabs.b
  • Loading branch information
gwenn committed Nov 26, 2017
1 parent 259d479 commit cc0191c
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions coresimd/src/x86/i586/ssse3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,18 @@
use stdsimd_test::assert_instr;

use simd_llvm::simd_shuffle16;
use v64::*;
use v128::*;

/// Compute the absolute value of packed 8-bit integers in `a` and
/// return the unsigned results.
#[inline(always)]
#[target_feature = "+ssse3"]
#[cfg_attr(test, assert_instr(pabsb))]
pub unsafe fn _mm_abs_pi8(a: i8x8) -> u8x8 {
pabsb(a)
}

/// Compute the absolute value of packed 8-bit signed integers in `a` and
/// return the unsigned results.
#[inline(always)]
Expand Down Expand Up @@ -235,6 +245,9 @@ pub unsafe fn _mm_sign_epi32(a: i32x4, b: i32x4) -> i32x4 {

#[allow(improper_ctypes)]
extern "C" {
#[link_name = "llvm.x86.ssse3.pabs.b"]
fn pabsb(a: i8x8) -> u8x8;

#[link_name = "llvm.x86.ssse3.pabs.b.128"]
fn pabsb128(a: i8x16) -> u8x16;

Expand Down Expand Up @@ -285,9 +298,16 @@ extern "C" {
mod tests {
use stdsimd_test::simd_test;

use v64::*;
use v128::*;
use x86::i586::ssse3;

#[simd_test = "ssse3"]
unsafe fn _mm_abs_pi8() {
let r = ssse3::_mm_abs_pi8(i8x8::splat(-5));
assert_eq!(r, u8x8::splat(5));
}

#[simd_test = "ssse3"]
unsafe fn _mm_abs_epi8() {
let r = ssse3::_mm_abs_epi8(i8x16::splat(-5));
Expand Down

0 comments on commit cc0191c

Please sign in to comment.