From fa751db313e04b0b6c36dfa6d2978714a3386d78 Mon Sep 17 00:00:00 2001 From: Nicolas Sarlin Date: Tue, 19 Aug 2025 15:03:14 +0200 Subject: [PATCH 1/2] chore: use new stable avx512 types from rust 1.89 --- Cargo.toml | 2 +- src/pod.rs | 4 ++-- src/zeroable.rs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 98ade98..9ecd19b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,7 +37,7 @@ min_const_generics = [] # MSRV 1.51: support arrays via min_const_generics wasm_simd = [] # MSRV 1.54.0: support wasm simd types aarch64_simd = [] # MSRV 1.59.0: support aarch64 simd types -avx512_simd = [] # MSRV 1.72.0: support avx512 simd types +avx512_simd = [] # MSRV 1.89.0: support avx512 simd types must_cast = [] # MSRV 1.64.0: support the `must` module. must_cast_extra = ["must_cast"] # MSRV 1.83.0: support mutable references in const diff --git a/src/pod.rs b/src/pod.rs index ae1437c..a8ae19c 100644 --- a/src/pod.rs +++ b/src/pod.rs @@ -170,14 +170,14 @@ impl_unsafe_marker_for_simd!( ); impl_unsafe_marker_for_simd!( - #[cfg(all(target_arch = "x86", feature = "nightly_stdsimd"))] + #[cfg(all(target_arch = "x86", feature = "nightly_stdsimd", feature = "avx512_simd"))] unsafe impl Pod for x86::{ __m128bh, __m256bh, __m512bh } ); impl_unsafe_marker_for_simd!( - #[cfg(all(target_arch = "x86_64", feature = "nightly_stdsimd"))] + #[cfg(all(target_arch = "x86_64", feature = "nightly_stdsimd", feature = "avx512_simd"))] unsafe impl Pod for x86_64::{ __m128bh, __m256bh, __m512bh } diff --git a/src/zeroable.rs b/src/zeroable.rs index 0a2cdaa..e46c2d7 100644 --- a/src/zeroable.rs +++ b/src/zeroable.rs @@ -249,14 +249,14 @@ impl_unsafe_marker_for_simd!( ); impl_unsafe_marker_for_simd!( - #[cfg(all(target_arch = "x86", feature = "nightly_stdsimd"))] + #[cfg(all(target_arch = "x86", any(feature = "nightly_stdsimd", feature = "avx512_simd")))] unsafe impl Zeroable for x86::{ __m128bh, __m256bh, __m512bh } ); impl_unsafe_marker_for_simd!( - #[cfg(all(target_arch = "x86_64", feature = "nightly_stdsimd"))] + #[cfg(all(target_arch = "x86_64", any(feature = "nightly_stdsimd", feature = "avx512_simd")))] unsafe impl Zeroable for x86_64::{ __m128bh, __m256bh, __m512bh } From e4db80a8c55dacf3253217bcd46009c0bed52d13 Mon Sep 17 00:00:00 2001 From: Nicolas Sarlin Date: Wed, 20 Aug 2025 10:08:27 +0200 Subject: [PATCH 2/2] chore: remove uses of the `nightly_stdsimd` feature --- src/lib.rs | 7 ------- src/pod.rs | 8 ++++---- src/zeroable.rs | 8 ++++---- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 6877821..a4b3dd0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -8,13 +8,6 @@ #![cfg_attr(feature = "nightly_docs", feature(doc_cfg))] #![cfg_attr(feature = "nightly_portable_simd", feature(portable_simd))] #![cfg_attr(feature = "nightly_float", feature(f16, f128))] -#![cfg_attr( - all( - feature = "nightly_stdsimd", - any(target_arch = "x86_64", target_arch = "x86") - ), - feature(stdarch_x86_avx512) -)] //! This crate gives small utilities for casting between plain data types. //! diff --git a/src/pod.rs b/src/pod.rs index a8ae19c..846f281 100644 --- a/src/pod.rs +++ b/src/pod.rs @@ -156,28 +156,28 @@ where } impl_unsafe_marker_for_simd!( - #[cfg(all(target_arch = "x86", any(feature = "nightly_stdsimd", feature = "avx512_simd")))] + #[cfg(all(target_arch = "x86", feature = "avx512_simd"))] unsafe impl Pod for x86::{ __m512, __m512d, __m512i } ); impl_unsafe_marker_for_simd!( - #[cfg(all(target_arch = "x86_64", any(feature = "nightly_stdsimd", feature = "avx512_simd")))] + #[cfg(all(target_arch = "x86_64", feature = "avx512_simd"))] unsafe impl Pod for x86_64::{ __m512, __m512d, __m512i } ); impl_unsafe_marker_for_simd!( - #[cfg(all(target_arch = "x86", feature = "nightly_stdsimd", feature = "avx512_simd"))] + #[cfg(all(target_arch = "x86", feature = "avx512_simd"))] unsafe impl Pod for x86::{ __m128bh, __m256bh, __m512bh } ); impl_unsafe_marker_for_simd!( - #[cfg(all(target_arch = "x86_64", feature = "nightly_stdsimd", feature = "avx512_simd"))] + #[cfg(all(target_arch = "x86_64", feature = "avx512_simd"))] unsafe impl Pod for x86_64::{ __m128bh, __m256bh, __m512bh } diff --git a/src/zeroable.rs b/src/zeroable.rs index e46c2d7..d88ba0f 100644 --- a/src/zeroable.rs +++ b/src/zeroable.rs @@ -235,28 +235,28 @@ where } impl_unsafe_marker_for_simd!( - #[cfg(all(target_arch = "x86", any(feature = "nightly_stdsimd", feature = "avx512_simd")))] + #[cfg(all(target_arch = "x86", feature = "avx512_simd"))] unsafe impl Zeroable for x86::{ __m512, __m512d, __m512i } ); impl_unsafe_marker_for_simd!( - #[cfg(all(target_arch = "x86_64", any(feature = "nightly_stdsimd", feature = "avx512_simd")))] + #[cfg(all(target_arch = "x86_64", feature = "avx512_simd"))] unsafe impl Zeroable for x86_64::{ __m512, __m512d, __m512i } ); impl_unsafe_marker_for_simd!( - #[cfg(all(target_arch = "x86", any(feature = "nightly_stdsimd", feature = "avx512_simd")))] + #[cfg(all(target_arch = "x86", feature = "avx512_simd"))] unsafe impl Zeroable for x86::{ __m128bh, __m256bh, __m512bh } ); impl_unsafe_marker_for_simd!( - #[cfg(all(target_arch = "x86_64", any(feature = "nightly_stdsimd", feature = "avx512_simd")))] + #[cfg(all(target_arch = "x86_64", feature = "avx512_simd"))] unsafe impl Zeroable for x86_64::{ __m128bh, __m256bh, __m512bh }