@@ -889,6 +889,17 @@ pub unsafe fn _mm256_cvtps_pd(a: __m128) -> __m256d {
889
889
simd_cast ( a)
890
890
}
891
891
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
+
892
903
/// Converts packed double-precision (64-bit) floating-point elements in `a`
893
904
/// to packed 32-bit integers with truncation.
894
905
///
@@ -2937,7 +2948,7 @@ pub unsafe fn _mm256_storeu2_m128i(hiaddr: *mut __m128i, loaddr: *mut __m128i, a
2937
2948
/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_cvtss_f32)
2938
2949
#[ inline]
2939
2950
#[ target_feature( enable = "avx" ) ]
2940
- // #[cfg_attr(test, assert_instr(movss ))] FIXME
2951
+ #[ cfg_attr( test, assert_instr( vmovss ) ) ]
2941
2952
#[ stable( feature = "simd_x86" , since = "1.27.0" ) ]
2942
2953
pub unsafe fn _mm256_cvtss_f32 ( a : __m256 ) -> f32 {
2943
2954
simd_extract ! ( a, 0 )
@@ -3640,6 +3651,13 @@ mod tests {
3640
3651
assert_eq_m256d ( r, e) ;
3641
3652
}
3642
3653
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
+
3643
3661
#[ simd_test( enable = "avx" ) ]
3644
3662
unsafe fn test_mm256_cvttpd_epi32 ( ) {
3645
3663
let a = _mm256_setr_pd ( 4. , 9. , 16. , 25. ) ;
0 commit comments