@@ -697,15 +697,15 @@ pub unsafe fn _mm_cvtps_epi32(a: f32x4) -> i32x4 {
697
697
/// `0`.
698
698
#[ inline( always) ]
699
699
#[ target_feature = "+sse2" ]
700
- // no particular instruction to test
700
+ # [ cfg_attr ( all ( test , target_arch = "x86_64" ) , assert_instr ( movd ) ) ]
701
701
pub unsafe fn _mm_cvtsi32_si128 ( a : i32 ) -> i32x4 {
702
702
i32x4:: new ( a, 0 , 0 , 0 )
703
703
}
704
704
705
705
/// Return the lowest element of `a`.
706
706
#[ inline( always) ]
707
707
#[ target_feature = "+sse2" ]
708
- // no particular instruction to test
708
+ # [ cfg_attr ( all ( test , not ( windows ) ) , assert_instr ( movd ) ) ] // FIXME mov on windows
709
709
pub unsafe fn _mm_cvtsi128_si32 ( a : i32x4 ) -> i32 {
710
710
a. extract ( 0 )
711
711
}
@@ -826,7 +826,11 @@ pub unsafe fn _mm_setzero_si128() -> __m128i {
826
826
/// Load 64-bit integer from memory into first element of returned vector.
827
827
#[ inline( always) ]
828
828
#[ target_feature = "+sse2" ]
829
- // no particular instruction to test
829
+ // FIXME movsd on windows
830
+ #[ cfg_attr( all( test, not( windows) ,
831
+ not( all( target_os = "linux" , target_arch = "x86_64" ) ) ,
832
+ target_arch = "x86_64" ) ,
833
+ assert_instr( movq) ) ]
830
834
pub unsafe fn _mm_loadl_epi64 ( mem_addr : * const i64x2 ) -> i64x2 {
831
835
i64x2:: new ( ( * mem_addr) . extract ( 0 ) , 0 )
832
836
}
@@ -901,7 +905,11 @@ pub unsafe fn _mm_storeu_si128(mem_addr: *mut __m128i, a: __m128i) {
901
905
/// `mem_addr` does not need to be aligned on any particular boundary.
902
906
#[ inline( always) ]
903
907
#[ target_feature = "+sse2" ]
904
- // no particular instruction to test
908
+ // FIXME mov on windows, movlps on i686
909
+ #[ cfg_attr( all( test, not( windows) ,
910
+ not( all( target_os = "linux" , target_arch = "x86_64" ) ) ,
911
+ target_arch = "x86_64" ) ,
912
+ assert_instr( movq) ) ]
905
913
pub unsafe fn _mm_storel_epi64 ( mem_addr : * mut __m128i , a : __m128i ) {
906
914
ptr:: copy_nonoverlapping (
907
915
& a as * const _ as * const u8 ,
@@ -934,7 +942,9 @@ pub unsafe fn _mm_stream_si32(mem_addr: *mut i32, a: i32) {
934
942
/// element is zero.
935
943
#[ inline( always) ]
936
944
#[ target_feature = "+sse2" ]
937
- // no particular instruction to test
945
+ // FIXME movd on windows, movd on i686
946
+ #[ cfg_attr( all( test, not( windows) , target_arch = "x86_64" ) ,
947
+ assert_instr( movq) ) ]
938
948
pub unsafe fn _mm_move_epi64 ( a : i64x2 ) -> i64x2 {
939
949
simd_shuffle2 ( a, i64x2:: splat ( 0 ) , [ 0 , 2 ] )
940
950
}
@@ -1752,7 +1762,7 @@ pub unsafe fn _mm_cvtsd_ss(a: f32x4, b: f64x2) -> f32x4 {
1752
1762
/// Return the lower double-precision (64-bit) floating-point element of "a".
1753
1763
#[ inline( always) ]
1754
1764
#[ target_feature = "+sse2" ]
1755
- // no particular instruction to test
1765
+ # [ cfg_attr ( all ( test , windows ) , assert_instr ( movsd ) ) ] // FIXME movq/movlps/mov on other platform
1756
1766
pub unsafe fn _mm_cvtsd_f64 ( a : f64x2 ) -> f64 {
1757
1767
a. extract ( 0 )
1758
1768
}
@@ -1839,6 +1849,7 @@ pub unsafe fn _mm_setr_pd(a: f64, b: f64) -> f64x2 {
1839
1849
/// zeros.
1840
1850
#[ inline( always) ]
1841
1851
#[ target_feature = "+sse2" ]
1852
+ #[ cfg_attr( test, assert_instr( xorps) ) ] // FIXME xorpd expected
1842
1853
pub unsafe fn _mm_setzero_pd ( ) -> f64x2 {
1843
1854
f64x2:: splat ( 0_f64 )
1844
1855
}
@@ -1991,6 +2002,7 @@ pub unsafe fn _mm_storel_pd(mem_addr: *mut f64, a: f64x2) {
1991
2002
/// into both elements of returned vector.
1992
2003
#[ inline( always) ]
1993
2004
#[ target_feature = "+sse2" ]
2005
+ //#[cfg_attr(test, assert_instr(movapd))] FIXME movapd expected
1994
2006
pub unsafe fn _mm_load1_pd ( mem_addr : * const f64 ) -> f64x2 {
1995
2007
let d = * mem_addr;
1996
2008
f64x2:: new ( d, d)
@@ -2000,6 +2012,7 @@ pub unsafe fn _mm_load1_pd(mem_addr: *const f64) -> f64x2 {
2000
2012
/// into both elements of returned vector.
2001
2013
#[ inline( always) ]
2002
2014
#[ target_feature = "+sse2" ]
2015
+ //#[cfg_attr(test, assert_instr(movapd))] FIXME movapd expected
2003
2016
pub unsafe fn _mm_load_pd1 ( mem_addr : * const f64 ) -> f64x2 {
2004
2017
let d = * mem_addr;
2005
2018
f64x2:: new ( d, d)
0 commit comments