Lokathor / wide

A crate to help you go wide. By which I mean use SIMD stuff.
https://docs.rs/wide
zlib License
251 stars 22 forks source link

Adds boolean methods to u32x4 and u32x8 #161

Open andyquinterom opened 1 month ago

andyquinterom commented 1 month ago

Closes #160

Lokathor commented 1 month ago

This looks good so far, but you should puy a doc comment on each of these which explains what's going on

mcroomp commented 1 month ago

Do you think it would be cleaner to use the i32 versions of these since the implementation is identical, avoid code duplication ie:

   #[inline]
  #[must_use]
  pub fn move_mask(self) -> i32 {
    // no need to reinvent the wheel
    i32x4::move_mask(cast(self))
  }

  #[inline]
  #[must_use]
  pub fn any(self) -> bool {
    i32x4::any(cast(self))
  }

  #[inline]
  #[must_use]
  pub fn all(self) -> bool {
    i32x4::all(cast(self))
  }

  #[inline]
  #[must_use]
  pub fn none(self) -> bool {
    i32x4::none(cast(self))
  }
Lokathor commented 1 month ago

Yeah that's probably good.