@@ -330,14 +330,22 @@ pub unsafe fn _mm_cvtepi16_epi32(a: i16x8) -> i32x4 {
330
330
simd_shuffle4 :: < _ , :: v64:: i16x4 > ( a, a, [ 0 , 1 , 2 , 3 ] ) . as_i32x4 ( )
331
331
}
332
332
333
- /// Sign extend packed 16-bit integers in a to packed 64-bit integers
333
+ /// Sign extend packed 16-bit integers in `a` to packed 64-bit integers
334
334
#[ inline( always) ]
335
335
#[ target_feature = "+sse4.1" ]
336
336
#[ cfg_attr( test, assert_instr( pmovsxwq) ) ]
337
337
pub unsafe fn _mm_cvtepi16_epi64 ( a : i16x8 ) -> i64x2 {
338
338
simd_shuffle2 :: < _ , :: v32:: i16x2 > ( a, a, [ 0 , 1 ] ) . as_i64x2 ( )
339
339
}
340
340
341
+ /// Sign extend packed 32-bit integers in `a` to packed 64-bit integers
342
+ #[ inline( always) ]
343
+ #[ target_feature = "+sse4.1" ]
344
+ #[ cfg_attr( test, assert_instr( pmovsxdq) ) ]
345
+ pub unsafe fn _mm_cvtepi32_epi64 ( a : i32x4 ) -> i64x2 {
346
+ simd_shuffle2 :: < _ , :: v64:: i32x2 > ( a, a, [ 0 , 1 ] ) . as_i64x2 ( )
347
+ }
348
+
341
349
/// Returns the dot product of two f64x2 vectors.
342
350
///
343
351
/// `imm8[1:0]` is the broadcast mask, and `imm8[5:4]` is the condition mask.
@@ -1020,6 +1028,18 @@ mod tests {
1020
1028
let e = i64x2:: splat ( -10 ) ;
1021
1029
assert_eq ! ( r, e) ;
1022
1030
}
1031
+
1032
+ #[ simd_test = "sse4.1" ]
1033
+ unsafe fn _mm_cvtepi32_epi64 ( ) {
1034
+ let a = i32x4:: splat ( 10 ) ;
1035
+ let r = sse41:: _mm_cvtepi32_epi64 ( a) ;
1036
+ let e = i64x2:: splat ( 10 ) ;
1037
+ assert_eq ! ( r, e) ;
1038
+ let a = i32x4:: splat ( -10 ) ;
1039
+ let r = sse41:: _mm_cvtepi32_epi64 ( a) ;
1040
+ let e = i64x2:: splat ( -10 ) ;
1041
+ assert_eq ! ( r, e) ;
1042
+ }
1023
1043
1024
1044
#[ simd_test = "sse4.1" ]
1025
1045
unsafe fn _mm_dp_pd ( ) {
0 commit comments