Skip to content
This repository has been archived by the owner on Aug 15, 2024. It is now read-only.

Commit

Permalink
Fix avx512 poseidon2 compilation config (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xVolosnikov authored Aug 1, 2024
1 parent 981490c commit eb51b6b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
13 changes: 6 additions & 7 deletions src/implementations/poseidon2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@ use crate::field::goldilocks::GoldilocksField;
pub mod params;

pub mod state_generic_impl;
#[cfg(not(all(
feature = "include_packed_simd",
any(
target_feature = "neon",
target_feature = "avx2",
#[cfg(not(any(
all(
target_feature = "avx512bw",
target_feature = "avx512cd",
target_feature = "avx512dq",
target_feature = "avx512f",
target_feature = "avx512vl",
),
all(
feature = "include_packed_simd",
any(target_feature = "neon", target_feature = "avx2")
)
)))]
pub use state_generic_impl::*;
Expand Down Expand Up @@ -48,7 +49,6 @@ pub mod state_vectorized_double;
pub use state_vectorized_double::*;

#[cfg(all(
feature = "include_packed_simd",
target_feature = "avx512bw",
target_feature = "avx512cd",
target_feature = "avx512dq",
Expand All @@ -58,7 +58,6 @@ pub use state_vectorized_double::*;
pub mod state_avx512;

#[cfg(all(
feature = "include_packed_simd",
target_feature = "avx512bw",
target_feature = "avx512cd",
target_feature = "avx512dq",
Expand Down
5 changes: 0 additions & 5 deletions src/implementations/poseidon2/state_avx512.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ impl Aligned {
}
}

// we also need holder for SIMD targets, because u64x4 has smaller alignment than u64x8
#[derive(Clone, Copy)]
#[repr(C, align(64))]
struct U128x4Holder([packed_simd::u128x4; 3]);

impl std::fmt::Debug for State {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{:?}", self.0)
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
#![feature(iter_array_chunks)]
// #![recursion_limit = "1024"]
#![feature(avx512_target_feature)]
#![cfg_attr(target_feature = "avx512bw", feature(stdarch_x86_avx512))]
#![feature(associated_type_defaults)]
#![feature(trait_alias)]
#![feature(vec_push_within_capacity)]
Expand Down

0 comments on commit eb51b6b

Please sign in to comment.