@@ -346,6 +346,30 @@ pub unsafe fn _mm_cvtepi32_epi64(a: i32x4) -> i64x2 {
346
346
simd_shuffle2 :: < _ , :: v64:: i32x2 > ( a, a, [ 0 , 1 ] ) . as_i64x2 ( )
347
347
}
348
348
349
+ /// Zero extend packed unsigned 8-bit integers in `a` to packed 16-bit integers
350
+ #[ inline( always) ]
351
+ #[ target_feature = "+sse4.1" ]
352
+ #[ cfg_attr( test, assert_instr( pmovzxbw) ) ]
353
+ pub unsafe fn _mm_cvtepu8_epi16 ( a : u8x16 ) -> i16x8 {
354
+ simd_shuffle8 :: < _ , :: v64:: u8x8 > ( a, a, [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 ] ) . as_i16x8 ( )
355
+ }
356
+
357
+ /// Zero extend packed unsigned 8-bit integers in `a` to packed 16-bit integers
358
+ #[ inline( always) ]
359
+ #[ target_feature = "+sse4.1" ]
360
+ #[ cfg_attr( test, assert_instr( pmovzxbd) ) ]
361
+ pub unsafe fn _mm_cvtepu8_epi32 ( a : u8x16 ) -> i32x4 {
362
+ simd_shuffle4 :: < _ , :: v32:: u8x4 > ( a, a, [ 0 , 1 , 2 , 3 ] ) . as_i32x4 ( )
363
+ }
364
+
365
+ /// Zero extend packed unsigned 8-bit integers in `a` to packed 16-bit integers
366
+ #[ inline( always) ]
367
+ #[ target_feature = "+sse4.1" ]
368
+ #[ cfg_attr( test, assert_instr( pmovzxbq) ) ]
369
+ pub unsafe fn _mm_cvtepu8_epi64 ( a : u8x16 ) -> i64x2 {
370
+ simd_shuffle2 :: < _ , :: v16:: u8x2 > ( a, a, [ 0 , 1 ] ) . as_i64x2 ( )
371
+ }
372
+
349
373
/// Returns the dot product of two f64x2 vectors.
350
374
///
351
375
/// `imm8[1:0]` is the broadcast mask, and `imm8[5:4]` is the condition mask.
@@ -1041,6 +1065,32 @@ mod tests {
1041
1065
assert_eq ! ( r, e) ;
1042
1066
}
1043
1067
1068
+ #[ simd_test = "sse4.1" ]
1069
+ unsafe fn _mm_cvtepu8_epi16 ( ) {
1070
+ let a = u8x16:: splat ( 10 ) ;
1071
+ let r = sse41:: _mm_cvtepu8_epi16 ( a) ;
1072
+ let e = i16x8:: splat ( 10 ) ;
1073
+ assert_eq ! ( r, e) ;
1074
+ }
1075
+
1076
+ #[ simd_test = "sse4.1" ]
1077
+ unsafe fn _mm_cvtepu8_epi32 ( ) {
1078
+ let a = u8x16:: splat ( 10 ) ;
1079
+ let r = sse41:: _mm_cvtepu8_epi32 ( a) ;
1080
+ let e = i32x4:: splat ( 10 ) ;
1081
+ assert_eq ! ( r, e) ;
1082
+ }
1083
+
1084
+ #[ simd_test = "sse4.1" ]
1085
+ unsafe fn _mm_cvtepu8_epi64 ( ) {
1086
+ let a = u8x16:: splat ( 10 ) ;
1087
+ let r = sse41:: _mm_cvtepu8_epi64 ( a) ;
1088
+ let e = i64x2:: splat ( 10 ) ;
1089
+ assert_eq ! ( r, e) ;
1090
+ }
1091
+
1092
+
1093
+
1044
1094
#[ simd_test = "sse4.1" ]
1045
1095
unsafe fn _mm_dp_pd ( ) {
1046
1096
let a = f64x2:: new ( 2.0 , 3.0 ) ;
0 commit comments