Skip to content

Commit

Permalink
add workaround comment in Simd::splat
Browse files Browse the repository at this point in the history
  • Loading branch information
programmerjake committed Jun 6, 2022
1 parent c963615 commit f7412ad
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/core_simd/src/vector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ where
/// assert_eq!(v.as_array(), &[8, 8, 8, 8]);
/// ```
pub fn splat(value: T) -> Self {
// This is a workaround for `[value; LANES]` generating a loop:
// https://github.com/rust-lang/rust/issues/97804
struct Splat;
impl<const LANES: usize> Swizzle<1, LANES> for Splat {
const INDEX: [usize; LANES] = [0; LANES];
Expand Down

0 comments on commit f7412ad

Please sign in to comment.