From c983e511ebcf8bce92a3ecdc5ad1c5935a4e6f35 Mon Sep 17 00:00:00 2001 From: sarah el kazdadi Date: Wed, 14 Feb 2024 10:30:21 +0100 Subject: [PATCH] fix(nightly): update pulp and nightly toolchain --- Cargo.toml | 3 ++- src/dit4.rs | 1 - src/fft128/f128_impl.rs | 4 ++-- src/fft128/mod.rs | 4 ++-- src/fft_simd.rs | 28 ++++++++++++++++------------ src/lib.rs | 2 +- src/unordered.rs | 2 -- toolchain.txt | 2 +- 8 files changed, 24 insertions(+), 22 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 048957b..e2e046f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ aligned-vec = { version = "0.5", default-features = false } bytemuck = "1" dyn-stack = { version = "0.9", default-features = false } num-complex = { version = "0.4", features = ["bytemuck"] } -pulp = { version = "0.11", default-features = false } +pulp = { version = "0.18.7", default-features = false } serde = { version = "1.0", optional = true, default-features = false } [features] @@ -40,6 +40,7 @@ rug = "1.19.1" [[bench]] name = "fft" harness = false +required-features = ["serde"] [package.metadata.docs.rs] all-features = true diff --git a/src/dit4.rs b/src/dit4.rs index 54fa82c..9cb87c6 100644 --- a/src/dit4.rs +++ b/src/dit4.rs @@ -76,7 +76,6 @@ fn stockham_core_1x4( let (a, b, c, d) = simd.transpose(abcd0, abcd1, abcd2, abcd3); - let a = a; let b = simd.mul(w1, b); let c = simd.mul(w2, c); let d = simd.mul(w3, d); diff --git a/src/fft128/f128_impl.rs b/src/fft128/f128_impl.rs index 6cfb039..fa051fd 100644 --- a/src/fft128/f128_impl.rs +++ b/src/fft128/f128_impl.rs @@ -621,9 +621,9 @@ impl f128 { #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] #[cfg_attr(docsrs, doc(cfg(any(target_arch = "x86", target_arch = "x86_64"))))] pub mod x86 { - use pulp::x86::{f64x4, V3}; + use pulp::{f64x4, x86::V3}; #[cfg(feature = "nightly")] - use pulp::x86::{f64x8, V4}; + use pulp::{f64x8, x86::V4}; #[inline(always)] pub(crate) fn quick_two_sum_f64x4(simd: V3, a: f64x4, b: f64x4) -> (f64x4, f64x4) { diff --git a/src/fft128/mod.rs b/src/fft128/mod.rs index 6869b95..77467d9 100644 --- a/src/fft128/mod.rs +++ b/src/fft128/mod.rs @@ -12,14 +12,14 @@ use pulp::{as_arrays, as_arrays_mut, cast}; #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] use crate::fft128::f128_impl::x86::V3F128Ext; #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] -use pulp::x86::{f64x4, V3}; +use pulp::{f64x4, x86::V3}; #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] #[cfg(feature = "nightly")] use crate::fft128::f128_impl::x86::V4F128Ext; #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] #[cfg(feature = "nightly")] -use pulp::x86::{f64x8, V4}; +use pulp::{f64x8, x86::V4}; trait FftSimdF128: Copy { type Reg: Copy + core::fmt::Debug; diff --git a/src/fft_simd.rs b/src/fft_simd.rs index af7ac39..263b349 100644 --- a/src/fft_simd.rs +++ b/src/fft_simd.rs @@ -1,16 +1,18 @@ use crate::c64; use core::{fmt::Debug, marker::PhantomData}; -#[derive(Copy, Clone, Debug)] -#[repr(C)] -pub struct c64x1(c64); +#[cfg(any(target_arch = "x86", target_arch = "x86_64"))] #[derive(Copy, Clone, Debug)] #[repr(C)] pub struct c64x2(c64, c64); + +#[cfg(any(target_arch = "x86", target_arch = "x86_64"))] +#[cfg(feature = "nightly")] #[derive(Copy, Clone, Debug)] #[repr(C)] pub struct c64x4(c64, c64, c64, c64); +#[cfg(any(target_arch = "x86", target_arch = "x86_64"))] const __ASSERT_POD: () = { #[allow(unknown_lints)] #[allow(clippy::extra_unused_type_parameters)] @@ -20,18 +22,25 @@ const __ASSERT_POD: () = { assert_pod_zeroable::(); // no padding - assert!(core::mem::size_of::() == core::mem::size_of::() * 1); assert!(core::mem::size_of::() == core::mem::size_of::() * 2); + #[cfg(feature = "nightly")] assert!(core::mem::size_of::() == core::mem::size_of::() * 4); }; // SAFETY: c64 is Zeroable -unsafe impl bytemuck::Zeroable for c64x1 {} +#[cfg(any(target_arch = "x86", target_arch = "x86_64"))] unsafe impl bytemuck::Zeroable for c64x2 {} + +#[cfg(any(target_arch = "x86", target_arch = "x86_64"))] +#[cfg(feature = "nightly")] unsafe impl bytemuck::Zeroable for c64x4 {} -// SAFETY: c64 is Pod, c64x1, c64x2, c64x4 are all repr(C) and have no padding -unsafe impl bytemuck::Pod for c64x1 {} + +#[cfg(any(target_arch = "x86", target_arch = "x86_64"))] +// SAFETY: c64 is Pod, c64x2, c64x4 are all repr(C) and have no padding unsafe impl bytemuck::Pod for c64x2 {} + +#[cfg(any(target_arch = "x86", target_arch = "x86_64"))] +#[cfg(feature = "nightly")] unsafe impl bytemuck::Pod for c64x4 {} pub trait Pod: Copy + Debug + bytemuck::Pod {} @@ -110,11 +119,6 @@ pub trait FftSimdExt: FftSimd { } } - #[inline(always)] - fn mul_neg_j(self, fwd: bool, xy: c64xN) -> c64xN { - self.mul_j(!fwd, xy) - } - #[inline(always)] fn mul_exp_pi_over_8(self, fwd: bool, xy: c64xN) -> c64xN { let r = self.splat_f64(core::f64::consts::FRAC_1_SQRT_2); diff --git a/src/lib.rs b/src/lib.rs index 146fdc6..1a3cf9f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -237,6 +237,6 @@ mod dit16; pub mod ordered; pub mod unordered; -#[cfg(any(feature = "fft128"))] +#[cfg(feature = "fft128")] #[cfg_attr(docsrs, doc(cfg(feature = "fft128")))] pub mod fft128; diff --git a/src/unordered.rs b/src/unordered.rs index ce139a0..dc68055 100644 --- a/src/unordered.rs +++ b/src/unordered.rs @@ -77,7 +77,6 @@ fn inv_butterfly_x4( w2: c64xN, w3: c64xN, ) -> (c64xN, c64xN, c64xN, c64xN) { - let z0 = z0; let z1 = simd.mul(w1, z1); let z2 = simd.mul(w2, z2); let z3 = simd.mul(w3, z3); @@ -172,7 +171,6 @@ fn inv_butterfly_x8( w6: c64xN, w7: c64xN, ) -> (c64xN, c64xN, c64xN, c64xN, c64xN, c64xN, c64xN, c64xN) { - let z0 = z0; let z1 = simd.mul(w1, z1); let z2 = simd.mul(w2, z2); let z3 = simd.mul(w3, z3); diff --git a/toolchain.txt b/toolchain.txt index 595cdb7..36e57ce 100644 --- a/toolchain.txt +++ b/toolchain.txt @@ -1 +1 @@ -nightly-2023-01-30 +nightly-2024-02-08