Skip to content

Commit

Permalink
fix(nightly): update pulp and nightly toolchain
Browse files Browse the repository at this point in the history
  • Loading branch information
sarah el kazdadi committed Feb 14, 2024
1 parent a20e8d6 commit e63f931
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 22 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -40,6 +40,7 @@ rug = "1.19.1"
[[bench]]
name = "fft"
harness = false
required-features = ["serde"]

[package.metadata.docs.rs]
all-features = true
Expand Down
1 change: 0 additions & 1 deletion src/dit4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ fn stockham_core_1x4<c64xN: Pod>(

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);
Expand Down
4 changes: 2 additions & 2 deletions src/fft128/f128_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions src/fft128/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
17 changes: 5 additions & 12 deletions src/fft_simd.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
use crate::c64;
use core::{fmt::Debug, marker::PhantomData};

#[derive(Copy, Clone, Debug)]
#[repr(C)]
pub struct c64x1(c64);
#[derive(Copy, Clone, Debug)]
#[repr(C)]
pub struct c64x2(c64, c64);
#[cfg(feature = "nightly")]
#[derive(Copy, Clone, Debug)]
#[repr(C)]
pub struct c64x4(c64, c64, c64, c64);
Expand All @@ -20,18 +18,18 @@ const __ASSERT_POD: () = {
assert_pod_zeroable::<c64>();

// no padding
assert!(core::mem::size_of::<c64x1>() == core::mem::size_of::<c64>() * 1);
assert!(core::mem::size_of::<c64x2>() == core::mem::size_of::<c64>() * 2);
#[cfg(feature = "nightly")]
assert!(core::mem::size_of::<c64x4>() == core::mem::size_of::<c64>() * 4);
};

// SAFETY: c64 is Zeroable
unsafe impl bytemuck::Zeroable for c64x1 {}
unsafe impl bytemuck::Zeroable for c64x2 {}
#[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 {}
// SAFETY: c64 is Pod, c64x2, c64x4 are all repr(C) and have no padding
unsafe impl bytemuck::Pod for c64x2 {}
#[cfg(feature = "nightly")]
unsafe impl bytemuck::Pod for c64x4 {}

pub trait Pod: Copy + Debug + bytemuck::Pod {}
Expand Down Expand Up @@ -110,11 +108,6 @@ pub trait FftSimdExt<c64xN: Pod>: FftSimd<c64xN> {
}
}

#[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);
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
2 changes: 0 additions & 2 deletions src/unordered.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ fn inv_butterfly_x4<c64xN: Pod>(
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);
Expand Down Expand Up @@ -172,7 +171,6 @@ fn inv_butterfly_x8<c64xN: Pod>(
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);
Expand Down
2 changes: 1 addition & 1 deletion toolchain.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly-2023-01-30
nightly-2024-02-14

0 comments on commit e63f931

Please sign in to comment.