@@ -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) ]
@@ -3989,8 +4011,14 @@ mod tests {
3989
4011
3990
4012
let r = sse2:: _mm_cvtsd_si64 ( f64x2:: new ( f64:: MAX , f64:: MIN ) ) ;
3991
4013
assert_eq ! ( r, i64 :: MIN ) ;
4014
+ }
4015
+
4016
+ #[ cfg( target_arch = "x86_64" ) ]
4017
+ #[ simd_test = "sse2" ]
4018
+ unsafe fn _mm_cvtsd_si64x ( ) {
4019
+ use std:: { f64, i64} ;
3992
4020
3993
- let r = sse2:: _mm_cvtsd_si64 ( f64x2:: new ( f64:: NAN , f64:: NAN ) ) ;
4021
+ let r = sse2:: _mm_cvtsd_si64x ( f64x2:: new ( f64:: NAN , f64:: NAN ) ) ;
3994
4022
assert_eq ! ( r, i64 :: MIN ) ;
3995
4023
}
3996
4024
@@ -4022,6 +4050,12 @@ mod tests {
4022
4050
) ;
4023
4051
}
4024
4052
4053
+ #[ simd_test = "sse2" ]
4054
+ unsafe fn _mm_cvtsd_f64 ( ) {
4055
+ let r = sse2:: _mm_cvtsd_f64 ( f64x2:: new ( -1.1 , 2.2 ) ) ;
4056
+ assert_eq ! ( r, -1.1 ) ;
4057
+ }
4058
+
4025
4059
#[ simd_test = "sse2" ]
4026
4060
unsafe fn _mm_cvtss_sd ( ) {
4027
4061
use std:: { f32, f64} ;
@@ -4068,14 +4102,18 @@ mod tests {
4068
4102
#[ cfg( target_arch = "x86_64" ) ]
4069
4103
#[ simd_test = "sse2" ]
4070
4104
unsafe fn _mm_cvttsd_si64 ( ) {
4071
- use std:: { f64, i64} ;
4072
-
4073
4105
let a = f64x2:: new ( -1.1 , 2.2 ) ;
4074
4106
let r = sse2:: _mm_cvttsd_si64 ( a) ;
4075
4107
assert_eq ! ( r, -1_i64 ) ;
4108
+ }
4109
+
4110
+ #[ cfg( target_arch = "x86_64" ) ]
4111
+ #[ simd_test = "sse2" ]
4112
+ unsafe fn _mm_cvttsd_si64x ( ) {
4113
+ use std:: { f64, i64} ;
4076
4114
4077
4115
let a = f64x2:: new ( f64:: NEG_INFINITY , f64:: NAN ) ;
4078
- let r = sse2:: _mm_cvttsd_si64 ( a) ;
4116
+ let r = sse2:: _mm_cvttsd_si64x ( a) ;
4079
4117
assert_eq ! ( r, i64 :: MIN ) ;
4080
4118
}
4081
4119
0 commit comments