@@ -889,6 +889,17 @@ pub unsafe fn _mm256_cvtps_pd(a: __m128) -> __m256d {
889889 simd_cast ( a)
890890}
891891
892+ /// Returns the first element of the input vector of `[4 x double]`.
893+ ///
894+ /// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cvtsd_f64)
895+ #[ inline]
896+ #[ target_feature( enable = "avx" ) ]
897+ #[ cfg_attr( test, assert_instr( vmovsd) ) ]
898+ #[ stable( feature = "simd_x86" , since = "1.27.0" ) ]
899+ pub unsafe fn _mm256_cvtsd_f64 ( a : __m256d ) -> f64 {
900+ simd_extract ! ( a, 0 )
901+ }
902+
892903/// Converts packed double-precision (64-bit) floating-point elements in `a`
893904/// to packed 32-bit integers with truncation.
894905///
@@ -2937,7 +2948,7 @@ pub unsafe fn _mm256_storeu2_m128i(hiaddr: *mut __m128i, loaddr: *mut __m128i, a
29372948/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cvtss_f32)
29382949#[ inline]
29392950#[ target_feature( enable = "avx" ) ]
2940- // #[cfg_attr(test, assert_instr(movss ))] FIXME
2951+ #[ cfg_attr( test, assert_instr( vmovss ) ) ]
29412952#[ stable( feature = "simd_x86" , since = "1.27.0" ) ]
29422953pub unsafe fn _mm256_cvtss_f32 ( a : __m256 ) -> f32 {
29432954 simd_extract ! ( a, 0 )
@@ -3640,6 +3651,13 @@ mod tests {
36403651 assert_eq_m256d ( r, e) ;
36413652 }
36423653
3654+ #[ simd_test( enable = "avx" ) ]
3655+ unsafe fn test_mm256_cvtsd_f64 ( ) {
3656+ let a = _mm256_setr_pd ( 1. , 2. , 3. , 4. ) ;
3657+ let r = _mm256_cvtsd_f64 ( a) ;
3658+ assert_eq ! ( r, 1. ) ;
3659+ }
3660+
36433661 #[ simd_test( enable = "avx" ) ]
36443662 unsafe fn test_mm256_cvttpd_epi32 ( ) {
36453663 let a = _mm256_setr_pd ( 4. , 9. , 16. , 25. ) ;
0 commit comments