mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-29 12:36:35 +03:00
sse3: _mm_movedup_pd
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
use x86::__m128i;
|
||||
use simd_llvm::simd_shuffle2;
|
||||
use v128::*;
|
||||
|
||||
#[cfg(test)]
|
||||
@@ -68,6 +69,15 @@ pub unsafe fn _mm_lddqu_si128(mem_addr: *const __m128i) -> __m128i {
|
||||
lddqu(mem_addr as *const _)
|
||||
}
|
||||
|
||||
/// Duplicate the low double-precision (64-bit) floating-point element
|
||||
/// from `a`.
|
||||
#[inline(always)]
|
||||
#[target_feature = "+sse3"]
|
||||
#[cfg_attr(test, assert_instr(movddup))]
|
||||
pub unsafe fn _mm_movedup_pd(a: f64x2) -> f64x2 {
|
||||
simd_shuffle2(a, a, [0, 0])
|
||||
}
|
||||
|
||||
#[allow(improper_ctypes)]
|
||||
extern {
|
||||
#[link_name = "llvm.x86.sse3.addsub.ps"]
|
||||
@@ -148,4 +158,11 @@ unsafe fn _mm_lddqu_si128() {
|
||||
let r = sse3::_mm_lddqu_si128(&a);
|
||||
assert_eq!(a, r);
|
||||
}
|
||||
|
||||
#[simd_test = "sse3"]
|
||||
unsafe fn _mm_movedup_pd() {
|
||||
let a = f64x2::new(-1.0, 5.0);
|
||||
let r = sse3::_mm_movedup_pd(a);
|
||||
assert_eq!(r, f64x2::new(-1.0, -1.0));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user