Skip to content

Commit

Permalink
Mark simd_shuffle intrinsics as rustc_args_required_const
Browse files Browse the repository at this point in the history
This change was made in `stdarch` but not `packed_simd`. See rust-lang/rust#69280 for background.
  • Loading branch information
ecstatic-morse authored and hsivonen committed Sep 10, 2020
1 parent 3541e38 commit 736c677
Showing 1 changed file with 6 additions and 0 deletions.
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

0 comments on commit 736c677

Please sign in to comment.