Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
# These are the names of specific Rust versions detected in
# `build.rs`. Each of these represents the minimum Rust version for
# which a particular feature is supported.
"zerocopy-simd-x86-avx12-1-89-0",
"zerocopy-core-error-1-81-0",
"zerocopy-diagnostic-on-unimplemented-1-78-0",
"zerocopy-generic-bounds-in-const-fn-1-61-0",
Expand Down Expand Up @@ -85,6 +86,8 @@ jobs:
features: "--all-features"
- toolchain: "stable"
features: "--all-features"
- toolchain: "zerocopy-simd-x86-avx12-1-89-0"
features: "--all-features"
- toolchain: "zerocopy-core-error-1-81-0"
features: "--all-features"
- toolchain: "zerocopy-diagnostic-on-unimplemented-1-78-0"
Expand All @@ -108,7 +111,9 @@ jobs:
# Exclue any combination of zerocopy-derive and any toolchain version
# other than "msrv", "stable", and "nightly". These other versions
# exist to exercise zerocopy behavior which differs by toolchain;
# zerocopy-derive doesn't behave different on these toolchains.
# zerocopy-derive doesn't behave differently on these toolchains.
- crate: "zerocopy-derive"
toolchain: "zerocopy-simd-x86-avx12-1-89-0"
- crate: "zerocopy-derive"
toolchain: "zerocopy-core-error-1-81-0"
- crate: "zerocopy-derive"
Expand Down
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ exclude = [".*"]
# used in the codebase to make it less likely for us to make mistakes when
# writing `doc_cfg` attributes.

# From 1.89.0, Rust supports x86 AVX-12 SIMD types (previously gated by the
# `stdarch_x86_avx512` feature).
zerocopy-simd-x86-avx12-1-89-0 = "1.89.0"

# From 1.81.0, Rust supports the `core::error::Error` trait.
zerocopy-core-error-1-81-0 = "1.81.0"

Expand Down
16 changes: 10 additions & 6 deletions src/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1026,16 +1026,20 @@ mod simd {
#[cfg(target_arch = "x86")]
x86, x86, __m128, __m128d, __m128i, __m256, __m256d, __m256i
);
#[cfg(zerocopy_simd_x86_avx12_1_89_0)]
simd_arch_mod!(
#[cfg(all(feature = "simd-nightly", target_arch = "x86"))]
#[cfg(target_arch = "x86")]
#[cfg_attr(doc_cfg, doc(cfg(rust = "1.89.0")))]
x86, x86_nightly, __m512bh, __m512, __m512d, __m512i
);
simd_arch_mod!(
#[cfg(target_arch = "x86_64")]
x86_64, x86_64, __m128, __m128d, __m128i, __m256, __m256d, __m256i
);
#[cfg(zerocopy_simd_x86_avx12_1_89_0)]
simd_arch_mod!(
#[cfg(all(feature = "simd-nightly", target_arch = "x86_64"))]
#[cfg(target_arch = "x86_64")]
#[cfg_attr(doc_cfg, doc(cfg(rust = "1.89.0")))]
x86_64, x86_64_nightly, __m512bh, __m512, __m512d, __m512i
);
simd_arch_mod!(
Expand Down Expand Up @@ -2023,19 +2027,19 @@ mod tests {
#[cfg(target_arch = "x86")]
test_simd_arch_mod!(x86, __m128, __m128d, __m128i, __m256, __m256d, __m256i);

#[cfg(all(feature = "simd-nightly", target_arch = "x86"))]
#[cfg(all(zerocopy_simd_x86_avx12_1_89_0, target_arch = "x86"))]
test_simd_arch_mod!(x86, __m512bh, __m512, __m512d, __m512i);

#[cfg(target_arch = "x86_64")]
test_simd_arch_mod!(x86_64, __m128, __m128d, __m128i, __m256, __m256d, __m256i);

#[cfg(all(feature = "simd-nightly", target_arch = "x86_64"))]
#[cfg(all(zerocopy_simd_x86_avx12_1_89_0, target_arch = "x86_64"))]
test_simd_arch_mod!(x86_64, __m512bh, __m512, __m512d, __m512i);

#[cfg(target_arch = "wasm32")]
test_simd_arch_mod!(wasm32, v128);

#[cfg(all(feature = "simd-nightly", target_arch = "powerpc"))]
#[cfg(all(zerocopy_simd_x86_avx12_1_89_0, target_arch = "powerpc"))]
test_simd_arch_mod!(
powerpc,
vector_bool_long,
Expand All @@ -2044,7 +2048,7 @@ mod tests {
vector_unsigned_long
);

#[cfg(all(feature = "simd-nightly", target_arch = "powerpc64"))]
#[cfg(all(zerocopy_simd_x86_avx12_1_89_0, target_arch = "powerpc64"))]
test_simd_arch_mod!(
powerpc64,
vector_bool_long,
Expand Down
21 changes: 0 additions & 21 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,27 +303,6 @@
clippy::indexing_slicing,
))]
#![cfg_attr(not(any(test, kani, feature = "std")), no_std)]
// NOTE: This attribute should have the effect of causing CI to fail if
// `stdarch_x86_avx512` - which is currently stable in 1.89.0-nightly as of this
// writing on 2025-06-10 - has its stabilization rolled back.
//
// FIXME(#2583): Remove once `stdarch_x86_avx512` is stabilized in 1.89.0, and
// 1.89.0 has been released as stable.
#![cfg_attr(
all(feature = "simd-nightly", any(target_arch = "x86", target_arch = "x86_64")),
expect(stable_features)
)]
// FIXME(#2583): Remove once `stdarch_x86_avx512` is stabilized in 1.89.0, and
// 1.89.0 has been released as stable. Replace with version detection for 1.89.0
// (see #2574 for a draft implementation).
#![cfg_attr(
all(feature = "simd-nightly", any(target_arch = "x86", target_arch = "x86_64")),
feature(stdarch_x86_avx512)
)]
#![cfg_attr(
all(feature = "simd-nightly", target_arch = "arm"),
feature(stdarch_arm_dsp, stdarch_arm_neon_intrinsics)
)]
#![cfg_attr(
all(feature = "simd-nightly", any(target_arch = "powerpc", target_arch = "powerpc64")),
feature(stdarch_powerpc)
Expand Down
Loading