Skip to content

Commit

Permalink
Clean up SIMD code
Browse files Browse the repository at this point in the history
  • Loading branch information
valadaptive committed Dec 3, 2024
1 parent 91f8da7 commit 8bf404a
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions crates/ntscrs/src/f32x4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ pub trait F32x4:

/// Safety:
/// You must ensure that whatever flavor of SIMD vector you're creating is supported by the current CPU.
#[inline(always)]
unsafe fn load4(src: &[f32; 4]) -> Self {
Self::load(src.as_slice())
}
Expand All @@ -43,12 +44,6 @@ pub trait F32x4:
fn store(self, dst: &mut [f32]);
fn store1(self, dst: &mut f32);

/// Safety:
/// You must ensure that whatever flavor of SIMD vector you're creating is supported by the current CPU.
unsafe fn zero() -> Self {
Self::set1(0.0)
}

/// Safety:
/// You must ensure that whatever flavor of SIMD vector you're creating is supported by the current CPU.
unsafe fn set1(src: f32) -> Self;
Expand Down Expand Up @@ -86,10 +81,6 @@ pub mod x86_64 {
pub type AvxF32x4 = IntelF32x4<true>;
pub type SseF32x4 = IntelF32x4<false>;

const fn _mm_shuffle(x: i32, y: i32, z: i32, w: i32) -> i32 {
(x << 0) | (y << 2) | (z << 4) | (w << 6)
}

impl<const USE_AVX2: bool> From<__m128> for IntelF32x4<USE_AVX2> {
#[inline(always)]
fn from(src: __m128) -> Self {
Expand Down

0 comments on commit 8bf404a

Please sign in to comment.