@@ -2056,6 +2056,30 @@ pub unsafe fn _mm_undefined_si128() -> __m128i {
2056
2056
mem:: transmute ( i32x4:: splat ( mem:: uninitialized ( ) ) )
2057
2057
}
2058
2058
2059
+ /// The resulting `f64x2` element is composed by the low-order values of
2060
+ /// the two `f64x2` interleaved input elements, i.e.:
2061
+ ///
2062
+ /// * The [127:64] bits are copied from the [127:64] bits of the second input
2063
+ /// * The [63:0] bits are copied from the [127:64] bits of the first input
2064
+ #[ inline( always) ]
2065
+ #[ target_feature = "+sse2" ]
2066
+ #[ cfg_attr( test, assert_instr( unpckhpd) ) ]
2067
+ pub unsafe fn _mm_unpackhi_pd ( a : f64x2 , b : f64x2 ) -> f64x2 {
2068
+ simd_shuffle2 ( a, b, [ 1 , 3 ] )
2069
+ }
2070
+
2071
+ /// The resulting `f64x2` element is composed by the high-order values of
2072
+ /// the two `f64x2` interleaved input elements, i.e.:
2073
+ ///
2074
+ /// * The [127:64] bits are copied from the [63:0] bits of the second input
2075
+ /// * The [63:0] bits are copied from the [63:0] bits of the first input
2076
+ #[ inline( always) ]
2077
+ #[ target_feature = "+sse2" ]
2078
+ #[ cfg_attr( test, assert_instr( unpcklpd) ) ]
2079
+ pub unsafe fn _mm_unpacklo_pd ( a : f64x2 , b : f64x2 ) -> f64x2 {
2080
+ simd_shuffle2 ( a, b, [ 0 , 2 ] )
2081
+ }
2082
+
2059
2083
#[ allow( improper_ctypes) ]
2060
2084
extern "C" {
2061
2085
#[ link_name = "llvm.x86.sse2.pause" ]
@@ -4174,4 +4198,20 @@ mod tests {
4174
4198
let r = sse2:: _mm_load_pd1 ( & d) ;
4175
4199
assert_eq ! ( r, f64x2:: new( d, d) ) ;
4176
4200
}
4201
+
4202
+ #[ simd_test = "sse2" ]
4203
+ unsafe fn _mm_unpackhi_pd ( ) {
4204
+ let a = f64x2:: new ( 1.0 , 2.0 ) ;
4205
+ let b = f64x2:: new ( 3.0 , 4.0 ) ;
4206
+ let r = sse2:: _mm_unpackhi_pd ( a, b) ;
4207
+ assert_eq ! ( r, f64x2:: new( 2.0 , 4.0 ) ) ;
4208
+ }
4209
+
4210
+ #[ simd_test = "sse2" ]
4211
+ unsafe fn _mm_unpacklo_pd ( ) {
4212
+ let a = f64x2:: new ( 1.0 , 2.0 ) ;
4213
+ let b = f64x2:: new ( 3.0 , 4.0 ) ;
4214
+ let r = sse2:: _mm_unpacklo_pd ( a, b) ;
4215
+ assert_eq ! ( r, f64x2:: new( 1.0 , 3.0 ) ) ;
4216
+ }
4177
4217
}
0 commit comments