@@ -1787,6 +1787,13 @@ pub unsafe fn _mm_cvtsd_si64(a: f64x2) -> i64 {
1787
1787
cvtsd2si64 ( a)
1788
1788
}
1789
1789
1790
+ /// Alias for [`_mm_cvtsd_si64`](fn._mm_cvtsd_si64_ss.html).
1791
+ #[ cfg( target_arch = "x86_64" ) ]
1792
+ #[ inline( always) ]
1793
+ #[ target_feature = "+sse2" ]
1794
+ #[ cfg_attr( test, assert_instr( cvtsd2si) ) ]
1795
+ pub unsafe fn _mm_cvtsd_si64x ( a : f64x2 ) -> i64 { _mm_cvtsd_si64 ( a) }
1796
+
1790
1797
/// Convert the lower double-precision (64-bit) floating-point element in `b`
1791
1798
/// to a single-precision (32-bit) floating-point element, store the result in
1792
1799
/// the lower element of the return value, and copy the upper element from `a`
@@ -1798,6 +1805,14 @@ pub unsafe fn _mm_cvtsd_ss(a: f32x4, b: f64x2) -> f32x4 {
1798
1805
cvtsd2ss ( a, b)
1799
1806
}
1800
1807
1808
+ /// Return the lower double-precision (64-bit) floating-point element of "a".
1809
+ #[ inline( always) ]
1810
+ #[ target_feature = "+sse2" ]
1811
+ // no particular instruction to test
1812
+ pub unsafe fn _mm_cvtsd_f64 ( a : f64x2 ) -> f64 {
1813
+ a. extract ( 0 )
1814
+ }
1815
+
1801
1816
/// Convert the lower single-precision (32-bit) floating-point element in `b`
1802
1817
/// to a double-precision (64-bit) floating-point element, store the result in
1803
1818
/// the lower element of the return value, and copy the upper element from `a`
@@ -1837,6 +1852,13 @@ pub unsafe fn _mm_cvttsd_si64(a: f64x2) -> i64 {
1837
1852
cvttsd2si64 ( a)
1838
1853
}
1839
1854
1855
+ /// Alias for [`_mm_cvttsd_si64`](fn._mm_cvttsd_si64_ss.html).
1856
+ #[ cfg( target_arch = "x86_64" ) ]
1857
+ #[ inline( always) ]
1858
+ #[ target_feature = "+sse2" ]
1859
+ #[ cfg_attr( test, assert_instr( cvttsd2si) ) ]
1860
+ pub unsafe fn _mm_cvttsd_si64x ( a : f64x2 ) -> i64 { _mm_cvttsd_si64 ( a) }
1861
+
1840
1862
/// Convert packed single-precision (32-bit) floating-point elements in `a` to
1841
1863
/// packed 32-bit integers with truncation.
1842
1864
#[ inline( always) ]
@@ -3979,8 +4001,14 @@ mod tests {
3979
4001
3980
4002
let r = sse2:: _mm_cvtsd_si64 ( f64x2:: new ( f64:: MAX , f64:: MIN ) ) ;
3981
4003
assert_eq ! ( r, i64 :: MIN ) ;
4004
+ }
4005
+
4006
+ #[ cfg( target_arch = "x86_64" ) ]
4007
+ #[ simd_test = "sse2" ]
4008
+ unsafe fn _mm_cvtsd_si64x ( ) {
4009
+ use std:: { f64, i64} ;
3982
4010
3983
- let r = sse2:: _mm_cvtsd_si64 ( f64x2:: new ( f64:: NAN , f64:: NAN ) ) ;
4011
+ let r = sse2:: _mm_cvtsd_si64x ( f64x2:: new ( f64:: NAN , f64:: NAN ) ) ;
3984
4012
assert_eq ! ( r, i64 :: MIN ) ;
3985
4013
}
3986
4014
@@ -4012,6 +4040,12 @@ mod tests {
4012
4040
) ;
4013
4041
}
4014
4042
4043
+ #[ simd_test = "sse2" ]
4044
+ unsafe fn _mm_cvtsd_f64 ( ) {
4045
+ let r = sse2:: _mm_cvtsd_f64 ( f64x2:: new ( -1.1 , 2.2 ) ) ;
4046
+ assert_eq ! ( r, -1.1 ) ;
4047
+ }
4048
+
4015
4049
#[ simd_test = "sse2" ]
4016
4050
unsafe fn _mm_cvtss_sd ( ) {
4017
4051
use std:: { f32, f64} ;
@@ -4058,14 +4092,18 @@ mod tests {
4058
4092
#[ cfg( target_arch = "x86_64" ) ]
4059
4093
#[ simd_test = "sse2" ]
4060
4094
unsafe fn _mm_cvttsd_si64 ( ) {
4061
- use std:: { f64, i64} ;
4062
-
4063
4095
let a = f64x2:: new ( -1.1 , 2.2 ) ;
4064
4096
let r = sse2:: _mm_cvttsd_si64 ( a) ;
4065
4097
assert_eq ! ( r, -1_i64 ) ;
4098
+ }
4099
+
4100
+ #[ cfg( target_arch = "x86_64" ) ]
4101
+ #[ simd_test = "sse2" ]
4102
+ unsafe fn _mm_cvttsd_si64x ( ) {
4103
+ use std:: { f64, i64} ;
4066
4104
4067
4105
let a = f64x2:: new ( f64:: NEG_INFINITY , f64:: NAN ) ;
4068
- let r = sse2:: _mm_cvttsd_si64 ( a) ;
4106
+ let r = sse2:: _mm_cvttsd_si64x ( a) ;
4069
4107
assert_eq ! ( r, i64 :: MIN ) ;
4070
4108
}
4071
4109
0 commit comments