@@ -1795,6 +1795,13 @@ pub unsafe fn _mm_cvtsd_si64(a: f64x2) -> i64 {
1795
1795
cvtsd2si64 ( a)
1796
1796
}
1797
1797
1798
+ /// Alias for [`_mm_cvtsd_si64`](fn._mm_cvtsd_si64_ss.html).
1799
+ #[ cfg( target_arch = "x86_64" ) ]
1800
+ #[ inline( always) ]
1801
+ #[ target_feature = "+sse2" ]
1802
+ #[ cfg_attr( test, assert_instr( cvtsd2si) ) ]
1803
+ pub unsafe fn _mm_cvtsd_si64x ( a : f64x2 ) -> i64 { _mm_cvtsd_si64 ( a) }
1804
+
1798
1805
/// Convert the lower double-precision (64-bit) floating-point element in `b`
1799
1806
/// to a single-precision (32-bit) floating-point element, store the result in
1800
1807
/// the lower element of the return value, and copy the upper element from `a`
@@ -1806,6 +1813,14 @@ pub unsafe fn _mm_cvtsd_ss(a: f32x4, b: f64x2) -> f32x4 {
1806
1813
cvtsd2ss ( a, b)
1807
1814
}
1808
1815
1816
+ /// Return the lower double-precision (64-bit) floating-point element of "a".
1817
+ #[ inline( always) ]
1818
+ #[ target_feature = "+sse2" ]
1819
+ // no particular instruction to test
1820
+ pub unsafe fn _mm_cvtsd_f64 ( a : f64x2 ) -> f64 {
1821
+ a. extract ( 0 )
1822
+ }
1823
+
1809
1824
/// Convert the lower single-precision (32-bit) floating-point element in `b`
1810
1825
/// to a double-precision (64-bit) floating-point element, store the result in
1811
1826
/// the lower element of the return value, and copy the upper element from `a`
@@ -1845,6 +1860,13 @@ pub unsafe fn _mm_cvttsd_si64(a: f64x2) -> i64 {
1845
1860
cvttsd2si64 ( a)
1846
1861
}
1847
1862
1863
+ /// Alias for [`_mm_cvttsd_si64`](fn._mm_cvttsd_si64_ss.html).
1864
+ #[ cfg( target_arch = "x86_64" ) ]
1865
+ #[ inline( always) ]
1866
+ #[ target_feature = "+sse2" ]
1867
+ #[ cfg_attr( test, assert_instr( cvttsd2si) ) ]
1868
+ pub unsafe fn _mm_cvttsd_si64x ( a : f64x2 ) -> i64 { _mm_cvttsd_si64 ( a) }
1869
+
1848
1870
/// Convert packed single-precision (32-bit) floating-point elements in `a` to
1849
1871
/// packed 32-bit integers with truncation.
1850
1872
#[ inline( always) ]
@@ -4022,6 +4044,12 @@ mod tests {
4022
4044
) ;
4023
4045
}
4024
4046
4047
+ #[ simd_test = "sse2" ]
4048
+ unsafe fn _mm_cvtsd_f64 ( ) {
4049
+ let r = sse2:: _mm_cvtsd_f64 ( f64x2:: new ( -1.1 , 2.2 ) ) ;
4050
+ assert_eq ! ( r, -1.1 ) ;
4051
+ }
4052
+
4025
4053
#[ simd_test = "sse2" ]
4026
4054
unsafe fn _mm_cvtss_sd ( ) {
4027
4055
use std:: { f32, f64} ;
0 commit comments