Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop using old-style simd_shuffle #350

Merged
merged 3 commits into from
Jul 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/run-ci-script.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,10 @@ jobs:
~/.rustup/toolchains
key: ${{ runner.os }}-cargo-${{ hashFiles('**/rust-toolchain') }}
- name: Install Toolchain
uses: dtolnay/rust-toolchain@master
uses: dtolnay/rust-toolchain@nightly
with:
# FIXME: change to nightly once https://github.com/rust-lang/packed_simd/pull/350 is merged
# needs to be kept in sync with the toolchain files
toolchain: nightly-2023-06-14
targets: ${{ inputs.target }}
components: rustfmt
- name: Generate Lockfile
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly-2023-06-14
nightly
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
Loading