Skip to content

Commit

Permalink
Stop using old-style simd_shuffle
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Jul 27, 2023
1 parent 2ffcc96 commit a79edf4
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions src/codegen/llvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,8 @@ use crate::sealed::Shuffle;
#[allow(unused_imports)] // FIXME: spurious warning?
use crate::sealed::Simd;

// Shuffle intrinsics: expanded in users' crates, therefore public.
extern "platform-intrinsic" {
pub fn simd_shuffle2<T, U>(x: T, y: T, idx: [u32; 2]) -> U;
pub fn simd_shuffle4<T, U>(x: T, y: T, idx: [u32; 4]) -> U;
pub fn simd_shuffle8<T, U>(x: T, y: T, idx: [u32; 8]) -> U;
pub fn simd_shuffle16<T, U>(x: T, y: T, idx: [u32; 16]) -> U;
pub fn simd_shuffle32<T, U>(x: T, y: T, idx: [u32; 32]) -> U;
pub fn simd_shuffle64<T, U>(x: T, y: T, idx: [u32; 64]) -> U;
fn simd_shuffle<T, I, U>(x: T, y: T, idx: I) -> U;
}

#[allow(clippy::missing_safety_doc)]
Expand All @@ -22,7 +16,7 @@ where
T: Simd,
<T as Simd>::Element: Shuffle<[u32; 2], Output = U>,
{
simd_shuffle2(x, y, IDX)
simd_shuffle(x, y, IDX)
}

#[allow(clippy::missing_safety_doc)]
Expand All @@ -32,7 +26,7 @@ where
T: Simd,
<T as Simd>::Element: Shuffle<[u32; 4], Output = U>,
{
simd_shuffle4(x, y, IDX)
simd_shuffle(x, y, IDX)
}

#[allow(clippy::missing_safety_doc)]
Expand All @@ -42,7 +36,7 @@ where
T: Simd,
<T as Simd>::Element: Shuffle<[u32; 8], Output = U>,
{
simd_shuffle8(x, y, IDX)
simd_shuffle(x, y, IDX)
}

#[allow(clippy::missing_safety_doc)]
Expand All @@ -52,7 +46,7 @@ where
T: Simd,
<T as Simd>::Element: Shuffle<[u32; 16], Output = U>,
{
simd_shuffle16(x, y, IDX)
simd_shuffle(x, y, IDX)
}

#[allow(clippy::missing_safety_doc)]
Expand All @@ -62,7 +56,7 @@ where
T: Simd,
<T as Simd>::Element: Shuffle<[u32; 32], Output = U>,
{
simd_shuffle32(x, y, IDX)
simd_shuffle(x, y, IDX)
}

#[allow(clippy::missing_safety_doc)]
Expand All @@ -72,7 +66,7 @@ where
T: Simd,
<T as Simd>::Element: Shuffle<[u32; 64], Output = U>,
{
simd_shuffle64(x, y, IDX)
simd_shuffle(x, y, IDX)
}

extern "platform-intrinsic" {
Expand Down

0 comments on commit a79edf4

Please sign in to comment.