Skip to content

Commit fecab7b

Browse files
committed
skip some assert_instr on windows
1 parent 361c5ea commit fecab7b

File tree

6 files changed

+38
-24
lines changed

6 files changed

+38
-24
lines changed

coresimd/x86/avx.rs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,7 +1078,8 @@ pub unsafe fn _mm256_cvttps_epi32(a: __m256) -> __m256i {
10781078
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_extractf128_ps)
10791079
#[inline]
10801080
#[target_feature(enable = "avx")]
1081-
#[cfg_attr(test, assert_instr(vextractf128, imm8 = 1))]
1081+
#[cfg_attr(all(test, not(target_os = "windows")),
1082+
assert_instr(vextractf128, imm8 = 1))]
10821083
#[rustc_args_required_const(1)]
10831084
#[stable(feature = "simd_x86", since = "1.27.0")]
10841085
pub unsafe fn _mm256_extractf128_ps(a: __m256, imm8: i32) -> __m128 {
@@ -1094,7 +1095,8 @@ pub unsafe fn _mm256_extractf128_ps(a: __m256, imm8: i32) -> __m128 {
10941095
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_extractf128_pd)
10951096
#[inline]
10961097
#[target_feature(enable = "avx")]
1097-
#[cfg_attr(test, assert_instr(vextractf128, imm8 = 1))]
1098+
#[cfg_attr(all(test, not(target_os = "windows")),
1099+
assert_instr(vextractf128, imm8 = 1))]
10981100
#[rustc_args_required_const(1)]
10991101
#[stable(feature = "simd_x86", since = "1.27.0")]
11001102
pub unsafe fn _mm256_extractf128_pd(a: __m256d, imm8: i32) -> __m128d {
@@ -1109,7 +1111,8 @@ pub unsafe fn _mm256_extractf128_pd(a: __m256d, imm8: i32) -> __m128d {
11091111
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_extractf128_si256)
11101112
#[inline]
11111113
#[target_feature(enable = "avx")]
1112-
#[cfg_attr(test, assert_instr(vextractf128, imm8 = 1))]
1114+
#[cfg_attr(all(test, not(target_os = "windows")),
1115+
assert_instr(vextractf128, imm8 = 1))]
11131116
#[rustc_args_required_const(1)]
11141117
#[stable(feature = "simd_x86", since = "1.27.0")]
11151118
pub unsafe fn _mm256_extractf128_si256(a: __m256i, imm8: i32) -> __m128i {
@@ -1510,7 +1513,8 @@ pub unsafe fn _mm256_broadcast_pd(a: &__m128d) -> __m256d {
15101513
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_insertf128_ps)
15111514
#[inline]
15121515
#[target_feature(enable = "avx")]
1513-
#[cfg_attr(test, assert_instr(vinsertf128, imm8 = 1))]
1516+
#[cfg_attr(all(test, not(target_os = "windows")),
1517+
assert_instr(vinsertf128, imm8 = 1))]
15141518
#[rustc_args_required_const(2)]
15151519
#[stable(feature = "simd_x86", since = "1.27.0")]
15161520
pub unsafe fn _mm256_insertf128_ps(a: __m256, b: __m128, imm8: i32) -> __m256 {
@@ -1528,7 +1532,8 @@ pub unsafe fn _mm256_insertf128_ps(a: __m256, b: __m128, imm8: i32) -> __m256 {
15281532
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_insertf128_pd)
15291533
#[inline]
15301534
#[target_feature(enable = "avx")]
1531-
#[cfg_attr(test, assert_instr(vinsertf128, imm8 = 1))]
1535+
#[cfg_attr(all(test, not(target_os = "windows")),
1536+
assert_instr(vinsertf128, imm8 = 1))]
15321537
#[rustc_args_required_const(2)]
15331538
#[stable(feature = "simd_x86", since = "1.27.0")]
15341539
pub unsafe fn _mm256_insertf128_pd(
@@ -1546,7 +1551,8 @@ pub unsafe fn _mm256_insertf128_pd(
15461551
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_insertf128_si256)
15471552
#[inline]
15481553
#[target_feature(enable = "avx")]
1549-
#[cfg_attr(test, assert_instr(vinsertf128, imm8 = 1))]
1554+
#[cfg_attr(all(test, not(target_os = "windows")),
1555+
assert_instr(vinsertf128, imm8 = 1))]
15501556
#[rustc_args_required_const(2)]
15511557
#[stable(feature = "simd_x86", since = "1.27.0")]
15521558
pub unsafe fn _mm256_insertf128_si256(

coresimd/x86/avx2.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,7 +1030,8 @@ pub unsafe fn _mm256_cvtepu8_epi64(a: __m128i) -> __m256i {
10301030
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_extracti128_si256)
10311031
#[inline]
10321032
#[target_feature(enable = "avx2")]
1033-
#[cfg_attr(test, assert_instr(vextractf128, imm8 = 1))]
1033+
#[cfg_attr(all(test, not(target_os = "windows")),
1034+
assert_instr(vextractf128, imm8 = 1))]
10341035
#[rustc_args_required_const(1)]
10351036
#[stable(feature = "simd_x86", since = "1.27.0")]
10361037
pub unsafe fn _mm256_extracti128_si256(a: __m256i, imm8: i32) -> __m128i {
@@ -1945,7 +1946,8 @@ pub unsafe fn _mm256_mask_i64gather_pd(
19451946
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_inserti128_si256)
19461947
#[inline]
19471948
#[target_feature(enable = "avx2")]
1948-
#[cfg_attr(test, assert_instr(vinsertf128, imm8 = 1))]
1949+
#[cfg_attr(all(test, not(target_os = "windows")),
1950+
assert_instr(vinsertf128, imm8 = 1))]
19491951
#[rustc_args_required_const(2)]
19501952
#[stable(feature = "simd_x86", since = "1.27.0")]
19511953
pub unsafe fn _mm256_inserti128_si256(

coresimd/x86/sse.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,7 @@ pub unsafe fn _mm_unpacklo_ps(a: __m128, b: __m128) -> __m128 {
10731073
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_movehl_ps)
10741074
#[inline]
10751075
#[target_feature(enable = "sse")]
1076-
#[cfg_attr(test, assert_instr(movhlps))]
1076+
#[cfg_attr(all(test, not(target_os = "windows")), assert_instr(movhlps))]
10771077
#[stable(feature = "simd_x86", since = "1.27.0")]
10781078
pub unsafe fn _mm_movehl_ps(a: __m128, b: __m128) -> __m128 {
10791079
// TODO; figure why this is a different instruction on Windows?
@@ -1086,7 +1086,7 @@ pub unsafe fn _mm_movehl_ps(a: __m128, b: __m128) -> __m128 {
10861086
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_movelh_ps)
10871087
#[inline]
10881088
#[target_feature(enable = "sse")]
1089-
#[cfg_attr(test, assert_instr(movlhps))]
1089+
#[cfg_attr(all(test, not(target_os = "windows")), assert_instr(movlhps))]
10901090
#[stable(feature = "simd_x86", since = "1.27.0")]
10911091
pub unsafe fn _mm_movelh_ps(a: __m128, b: __m128) -> __m128 {
10921092
simd_shuffle4(a, b, [0, 1, 4, 5])
@@ -1347,7 +1347,8 @@ pub unsafe fn _mm_loadr_ps(p: *const f32) -> __m128 {
13471347
// fine.
13481348
// On i586 (no SSE2) it just generates plain MOV instructions.
13491349
#[cfg_attr(
1350-
all(test, any(target_arch = "x86_64", target_feature = "sse2")),
1350+
all(test, any(target_arch = "x86_64", target_feature = "sse2"),
1351+
not(target_os = "windows")),
13511352
// assert_instr(movhpd)
13521353
assert_instr(movhps) // LLVM7 prefers single-precision instructions
13531354
)]
@@ -1378,7 +1379,8 @@ pub unsafe fn _mm_storeh_pi(p: *mut __m64, a: __m128) {
13781379
#[target_feature(enable = "sse")]
13791380
// On i586 the codegen just generates plane MOVs. No need to test for that.
13801381
#[cfg_attr(
1381-
all(test, any(target_arch = "x86_64", target_feature = "sse2")),
1382+
all(test, any(target_arch = "x86_64", target_feature = "sse2"),
1383+
not(target_os = "windows")),
13821384
assert_instr(movlps)
13831385
)]
13841386
pub unsafe fn _mm_storel_pi(p: *mut __m64, a: __m128) {

coresimd/x86/sse2.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -973,7 +973,8 @@ pub unsafe fn _mm_cvtsi32_si128(a: i32) -> __m128i {
973973
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtsi128_si32)
974974
#[inline]
975975
#[target_feature(enable = "sse2")]
976-
#[cfg_attr(test, assert_instr(movd))]
976+
#[cfg_attr(all(test, not(target_os = "windows")),
977+
assert_instr(movd))]
977978
#[stable(feature = "simd_x86", since = "1.27.0")]
978979
pub unsafe fn _mm_cvtsi128_si32(a: __m128i) -> i32 {
979980
simd_extract(a.as_i32x4(), 0)
@@ -1664,7 +1665,8 @@ pub unsafe fn _mm_unpacklo_epi32(a: __m128i, b: __m128i) -> __m128i {
16641665
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_unpacklo_epi64)
16651666
#[inline]
16661667
#[target_feature(enable = "sse2")]
1667-
#[cfg_attr(test, assert_instr(movlhps))]
1668+
#[cfg_attr(all(test, not(target_os = "windows")),
1669+
assert_instr(movlhps))]
16681670
#[stable(feature = "simd_x86", since = "1.27.0")]
16691671
pub unsafe fn _mm_unpacklo_epi64(a: __m128i, b: __m128i) -> __m128i {
16701672
mem::transmute::<i64x2, _>(simd_shuffle2(
@@ -2582,7 +2584,8 @@ pub unsafe fn _mm_stream_pd(mem_addr: *mut f64, a: __m128d) {
25822584
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_store_sd)
25832585
#[inline]
25842586
#[target_feature(enable = "sse2")]
2585-
#[cfg_attr(test, assert_instr(movlps))]
2587+
#[cfg_attr(all(test, not(target_os = "windows")),
2588+
assert_instr(movlps))]
25862589
#[stable(feature = "simd_x86", since = "1.27.0")]
25872590
pub unsafe fn _mm_store_sd(mem_addr: *mut f64, a: __m128d) {
25882591
*mem_addr = simd_extract(a, 0)
@@ -2660,7 +2663,8 @@ pub unsafe fn _mm_storer_pd(mem_addr: *mut f64, a: __m128d) {
26602663
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_storeh_pd)
26612664
#[inline]
26622665
#[target_feature(enable = "sse2")]
2663-
#[cfg_attr(test, assert_instr(movhpd))]
2666+
#[cfg_attr(all(test, not(target_os = "windows")),
2667+
assert_instr(movhpd))]
26642668
#[stable(feature = "simd_x86", since = "1.27.0")]
26652669
pub unsafe fn _mm_storeh_pd(mem_addr: *mut f64, a: __m128d) {
26662670
*mem_addr = simd_extract(a, 1);
@@ -2672,7 +2676,7 @@ pub unsafe fn _mm_storeh_pd(mem_addr: *mut f64, a: __m128d) {
26722676
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_storel_pd)
26732677
#[inline]
26742678
#[target_feature(enable = "sse2")]
2675-
#[cfg_attr(test, assert_instr(movlps))] // FIXME movlpd
2679+
#[cfg_attr(all(test, not(target_os = "windows")), assert_instr(movlps))]
26762680
#[stable(feature = "simd_x86", since = "1.27.0")]
26772681
pub unsafe fn _mm_storel_pd(mem_addr: *mut f64, a: __m128d) {
26782682
*mem_addr = simd_extract(a, 0);
@@ -2879,7 +2883,7 @@ pub unsafe fn _mm_unpackhi_pd(a: __m128d, b: __m128d) -> __m128d {
28792883
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_unpacklo_pd)
28802884
#[inline]
28812885
#[target_feature(enable = "sse2")]
2882-
#[cfg_attr(test, assert_instr(movlhps))]
2886+
#[cfg_attr(all(test, not(target_os = "windows")), assert_instr(movlhps))]
28832887
#[stable(feature = "simd_x86", since = "1.27.0")]
28842888
pub unsafe fn _mm_unpacklo_pd(a: __m128d, b: __m128d) -> __m128d {
28852889
simd_shuffle2(a, b, [0, 2])

coresimd/x86/sse41.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ pub unsafe fn _mm_blend_ps(a: __m128, b: __m128, imm4: i32) -> __m128 {
166166
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_extract_ps)
167167
#[inline]
168168
#[target_feature(enable = "sse4.1")]
169-
// TODO: Add test for Windows
170-
#[cfg_attr(test, assert_instr(extractps, imm8 = 0))]
169+
#[cfg_attr(all(test, not(target_os = "windows")),
170+
assert_instr(extractps, imm8 = 0))]
171171
#[rustc_args_required_const(1)]
172172
#[stable(feature = "simd_x86", since = "1.27.0")]
173173
pub unsafe fn _mm_extract_ps(a: __m128, imm8: i32) -> i32 {
@@ -195,8 +195,8 @@ pub unsafe fn _mm_extract_epi8(a: __m128i, imm8: i32) -> i32 {
195195
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_extract_epi32)
196196
#[inline]
197197
#[target_feature(enable = "sse4.1")]
198-
// TODO: Add test for Windows
199-
#[cfg_attr(test, assert_instr(extractps, imm8 = 1))]
198+
#[cfg_attr(all(test, not(target_os = "windows")),
199+
assert_instr(extractps, imm8 = 1))]
200200
#[rustc_args_required_const(1)]
201201
#[stable(feature = "simd_x86", since = "1.27.0")]
202202
pub unsafe fn _mm_extract_epi32(a: __m128i, imm8: i32) -> i32 {

coresimd/x86_64/sse41.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ use stdsimd_test::assert_instr;
1212
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_extract_epi64)
1313
#[inline]
1414
#[target_feature(enable = "sse4.1")]
15-
// TODO: Add test for Windows
16-
#[cfg_attr(test, assert_instr(pextrq, imm8 = 1))]
15+
#[cfg_attr(all(test, not(target_os = "windows")),
16+
assert_instr(pextrq, imm8 = 1))]
1717
#[rustc_args_required_const(1)]
1818
#[stable(feature = "simd_x86", since = "1.27.0")]
1919
pub unsafe fn _mm_extract_epi64(a: __m128i, imm8: i32) -> i64 {

0 commit comments

Comments
 (0)