Add _mm_cvtepi32_epi64 and fix typo

This commit is contained in:
André Oliveira 2017-11-06 14:35:32 +00:00 committed by gnzlbg
parent 60c2608cce
commit 48027e994b

View file

@ -330,7 +330,7 @@ pub unsafe fn _mm_cvtepi16_epi32(a: i16x8) -> i32x4 {
simd_shuffle4::<_, ::v64::i16x4>(a, a, [0, 1, 2, 3]).as_i32x4()
}
/// Sign extend packed 16-bit integers in a to packed 64-bit integers
/// Sign extend packed 16-bit integers in `a` to packed 64-bit integers
#[inline(always)]
#[target_feature = "+sse4.1"]
#[cfg_attr(test, assert_instr(pmovsxwq))]
@ -338,6 +338,14 @@ pub unsafe fn _mm_cvtepi16_epi64(a: i16x8) -> i64x2 {
simd_shuffle2::<_, ::v32::i16x2>(a, a, [0, 1]).as_i64x2()
}
/// Sign extend packed 32-bit integers in `a` to packed 64-bit integers
#[inline(always)]
#[target_feature = "+sse4.1"]
#[cfg_attr(test, assert_instr(pmovsxdq))]
pub unsafe fn _mm_cvtepi32_epi64(a: i32x4) -> i64x2 {
simd_shuffle2::<_, ::v64::i32x2>(a, a, [0, 1]).as_i64x2()
}
/// Returns the dot product of two f64x2 vectors.
///
/// `imm8[1:0]` is the broadcast mask, and `imm8[5:4]` is the condition mask.
@ -1020,6 +1028,18 @@ mod tests {
let e = i64x2::splat(-10);
assert_eq!(r, e);
}
#[simd_test = "sse4.1"]
unsafe fn _mm_cvtepi32_epi64() {
let a = i32x4::splat(10);
let r = sse41::_mm_cvtepi32_epi64(a);
let e = i64x2::splat(10);
assert_eq!(r, e);
let a = i32x4::splat(-10);
let r = sse41::_mm_cvtepi32_epi64(a);
let e = i64x2::splat(-10);
assert_eq!(r, e);
}
#[simd_test = "sse4.1"]
unsafe fn _mm_dp_pd() {