Skip to content

Mark simd_shuffle intrinsics as rustc_args_required_const #278

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

Merged
merged 2 commits into from
Sep 25, 2020
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
6 changes: 6 additions & 0 deletions src/codegen/llvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,37 @@ extern "platform-intrinsic" {
// FIXME: Passing this intrinsics an `idx` array with an index that is
// out-of-bounds will produce a monomorphization-time error.
// https://github.com/rust-lang-nursery/packed_simd/issues/21
#[rustc_args_required_const(2)]
pub fn simd_shuffle2<T, U>(x: T, y: T, idx: [u32; 2]) -> U
where
T: Simd,
<T as Simd>::Element: Shuffle<[u32; 2], Output = U>;

#[rustc_args_required_const(2)]
pub fn simd_shuffle4<T, U>(x: T, y: T, idx: [u32; 4]) -> U
where
T: Simd,
<T as Simd>::Element: Shuffle<[u32; 4], Output = U>;

#[rustc_args_required_const(2)]
pub fn simd_shuffle8<T, U>(x: T, y: T, idx: [u32; 8]) -> U
where
T: Simd,
<T as Simd>::Element: Shuffle<[u32; 8], Output = U>;

#[rustc_args_required_const(2)]
pub fn simd_shuffle16<T, U>(x: T, y: T, idx: [u32; 16]) -> U
where
T: Simd,
<T as Simd>::Element: Shuffle<[u32; 16], Output = U>;

#[rustc_args_required_const(2)]
pub fn simd_shuffle32<T, U>(x: T, y: T, idx: [u32; 32]) -> U
where
T: Simd,
<T as Simd>::Element: Shuffle<[u32; 32], Output = U>;

#[rustc_args_required_const(2)]
pub fn simd_shuffle64<T, U>(x: T, y: T, idx: [u32; 64]) -> U
where
T: Simd,
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@

#![feature(
repr_simd,
rustc_attrs,
const_fn,
platform_intrinsics,
stdsimd,
Expand Down