Skip to content
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: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## Unreleased
- Add single-lanes portable-simd trait implementations.

## Release v0.9.1 (05 Sept. 2025)
- `into_arr`, `from_arr`, `map`, `zip_map` are now public on `WideF32x4`, `WideF32x8` and `WideF64x4`.
- `from_arr` and `into_arr` are now public on `WideBoolF32x4`, `WideBoolF32x8`, `WideBoolF64x4`.
Expand Down
36 changes: 36 additions & 0 deletions src/simd/portable_simd_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ macro_rules! impl_bool_simd (

write!(f, "({}", self.extract(0))?;

// Suppress warning for single-lanes values.
#[allow(clippy::reversed_empty_ranges)]
for i in 1..Self::LANES {
write!(f, ", {}", self.extract(i))?;
}
Expand Down Expand Up @@ -279,6 +281,8 @@ macro_rules! impl_simd_value (

write!(f, "({}", self.extract(0))?;

// Suppress warning for single-lanes values.
#[allow(clippy::reversed_empty_ranges)]
for i in 1..Self::LANES {
write!(f, ", {}", self.extract(i))?;
}
Expand Down Expand Up @@ -1070,6 +1074,9 @@ macro_rules! impl_float_simd (
#[inline(always)]
fn simd_horizontal_product(self) -> Self::Element {
let mut prod = self.extract(0);

// Suppress warning for single-lanes values.
#[allow(clippy::reversed_empty_ranges)]
for ii in 1..Self::LANES {
prod *= self.extract(ii)
}
Expand Down Expand Up @@ -1498,82 +1505,99 @@ fn simd_complex_from_polar<N: SimdRealField>(r: N, theta: N) -> num_complex::Com
}

impl_float_simd!(
portable_simd::f32x1, f32, portable_simd::i32x1, mask32x1, _0;
portable_simd::f32x2, f32, portable_simd::i32x2, mask32x2, _0, _1;
portable_simd::f32x4, f32, portable_simd::i32x4, mask32x4, _0, _1, _2, _3;
portable_simd::f32x8, f32, portable_simd::i32x8, mask32x8, _0, _1, _2, _3, _4, _5, _6, _7;
portable_simd::f32x16, f32, portable_simd::i32x16, mask32x16, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15;
portable_simd::f64x1, f64, portable_simd::i64x1, mask64x1, _0;
portable_simd::f64x2, f64, portable_simd::i64x2, mask64x2, _0, _1;
portable_simd::f64x4, f64, portable_simd::i64x4, mask64x4, _0, _1, _2, _3;
portable_simd::f64x8, f64, portable_simd::i64x8, mask64x8, _0, _1, _2, _3, _4, _5, _6, _7;
);

impl_int_simd!(
portable_simd::i16x1, i16, mask16x1, _0;
portable_simd::i16x2, i16, mask16x2, _0, _1;
portable_simd::i16x4, i16, mask16x4, _0, _1, _2, _3;
portable_simd::i16x8, i16, mask16x8, _0, _1, _2, _3, _4, _5, _6, _7;
portable_simd::i16x16, i16, mask16x16, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15;
portable_simd::i16x32, i16, mask16x32, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31;
portable_simd::i32x1, i32, mask32x1, _0;
portable_simd::i32x2, i32, mask32x2, _0, _1;
portable_simd::i32x4, i32, mask32x4, _0, _1, _2, _3;
portable_simd::i32x8, i32, mask32x8, _0, _1, _2, _3, _4, _5, _6, _7;
portable_simd::i32x16, i32, mask32x16, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15;
portable_simd::i64x1, i64, mask64x1, _0;
portable_simd::i64x2, i64, mask64x2, _0, _1;
portable_simd::i64x4, i64, mask64x4, _0, _1, _2, _3;
portable_simd::i64x8, i64, mask64x8, _0, _1, _2, _3, _4, _5, _6, _7;
portable_simd::i8x1, i8, mask8x1, _0;
portable_simd::i8x2, i8, mask8x2, _0, _1;
portable_simd::i8x4, i8, mask8x4, _0, _1, _2, _3;
portable_simd::i8x8, i8, mask8x8, _0, _1, _2, _3, _4, _5, _6, _7;
portable_simd::i8x16, i8, mask8x16, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15;
portable_simd::i8x32, i8, mask8x32, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31;
portable_simd::i8x64, i8, mask8x64, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63;
portable_simd::isizex1, isize, masksizex1, _0;
portable_simd::isizex2, isize, masksizex2, _0, _1;
portable_simd::isizex4, isize, masksizex4, _0, _1, _2, _3;
portable_simd::isizex8, isize, masksizex8, _0, _1, _2, _3, _4, _5, _6, _7;
);

impl_uint_simd!(
portable_simd::u16x1, u16, mask16x1, _0;
portable_simd::u16x2, u16, mask16x2, _0, _1;
portable_simd::u16x4, u16, mask16x4, _0, _1, _2, _3;
portable_simd::u16x8, u16, mask16x8, _0, _1, _2, _3, _4, _5, _6, _7;
portable_simd::u16x16, u16, mask16x16, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15;
portable_simd::u16x32, u16, mask16x32, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31;
portable_simd::u32x1, u32, mask32x1, _0;
portable_simd::u32x2, u32, mask32x2, _0, _1;
portable_simd::u32x4, u32, mask32x4, _0, _1, _2, _3;
portable_simd::u32x8, u32, mask32x8, _0, _1, _2, _3, _4, _5, _6, _7;
portable_simd::u32x16, u32, mask32x16, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15;
portable_simd::u64x1, u64, mask64x1, _0;
portable_simd::u64x2, u64, mask64x2, _0, _1;
portable_simd::u64x4, u64, mask64x4, _0, _1, _2, _3;
portable_simd::u64x8, u64, mask64x8, _0, _1, _2, _3, _4, _5, _6, _7;
portable_simd::u8x1, u8, mask8x1, _0;
portable_simd::u8x2, u8, mask8x2, _0, _1;
portable_simd::u8x4, u8, mask8x4, _0, _1, _2, _3;
portable_simd::u8x8, u8, mask8x8, _0, _1, _2, _3, _4, _5, _6, _7;
portable_simd::u8x16, u8, mask8x16, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15;
portable_simd::u8x32, u8, mask8x32, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31;
portable_simd::u8x64, u8, mask8x64, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63;
portable_simd::usizex1, usize, masksizex1, _0;
portable_simd::usizex2, usize, masksizex2, _0, _1;
portable_simd::usizex4, usize, masksizex4, _0, _1, _2, _3;
portable_simd::usizex8, usize, masksizex8, _0, _1, _2, _3, _4, _5, _6, _7;
);

impl_bool_simd!(
portable_simd::mask16x1, 1, _0;
portable_simd::mask16x2, 2, _0, _1;
portable_simd::mask16x4, 4, _0, _1, _2, _3;
portable_simd::mask16x8, 8, _0, _1, _2, _3, _4, _5, _6, _7;
portable_simd::mask16x16, 16, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15;
portable_simd::mask16x32, 32, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31;
portable_simd::mask32x1, 1, _0;
portable_simd::mask32x2, 2, _0, _1;
portable_simd::mask32x4, 4, _0, _1, _2, _3;
portable_simd::mask32x8, 8, _0, _1, _2, _3, _4, _5, _6, _7;
portable_simd::mask32x16, 16, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15;
portable_simd::mask64x1, 1, _0;
portable_simd::mask64x2, 2, _0, _1;
portable_simd::mask64x4, 4, _0, _1, _2, _3;
portable_simd::mask64x8, 8, _0, _1, _2, _3, _4, _5, _6, _7;
portable_simd::mask8x1, 1, _0;
portable_simd::mask8x2, 2, _0, _1;
portable_simd::mask8x4, 4, _0, _1, _2, _3;
portable_simd::mask8x8, 8, _0, _1, _2, _3, _4, _5, _6, _7;
portable_simd::mask8x16, 16, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15;
portable_simd::mask8x32, 32, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31;
portable_simd::mask8x64, 64, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63;
portable_simd::masksizex1, 1, _0;
portable_simd::masksizex2, 2, _0, _1;
portable_simd::masksizex4, 4, _0, _1, _2, _3;
portable_simd::masksizex8, 8, _0, _1, _2, _3, _4, _5, _6, _7;
Expand Down Expand Up @@ -1607,52 +1631,64 @@ impl_bool_simd!(
// Aliases //
//////////////////////////////////////////

pub type f32x1 = Simd<portable_simd::f32x1>;
pub type f32x2 = Simd<portable_simd::f32x2>;
pub type f32x4 = Simd<portable_simd::f32x4>;
pub type f32x8 = Simd<portable_simd::f32x8>;
pub type f32x16 = Simd<portable_simd::f32x16>;
pub type f64x1 = Simd<portable_simd::f64x1>;
pub type f64x2 = Simd<portable_simd::f64x2>;
pub type f64x4 = Simd<portable_simd::f64x4>;
pub type f64x8 = Simd<portable_simd::f64x8>;
pub type i16x1 = Simd<portable_simd::i16x1>;
pub type i16x2 = Simd<portable_simd::i16x2>;
pub type i16x4 = Simd<portable_simd::i16x4>;
pub type i16x8 = Simd<portable_simd::i16x8>;
pub type i16x16 = Simd<portable_simd::i16x16>;
pub type i16x32 = Simd<portable_simd::i16x32>;
pub type i32x1 = Simd<portable_simd::i32x1>;
pub type i32x2 = Simd<portable_simd::i32x2>;
pub type i32x4 = Simd<portable_simd::i32x4>;
pub type i32x8 = Simd<portable_simd::i32x8>;
pub type i32x16 = Simd<portable_simd::i32x16>;
pub type i64x1 = Simd<portable_simd::i64x1>;
pub type i64x2 = Simd<portable_simd::i64x2>;
pub type i64x4 = Simd<portable_simd::i64x4>;
pub type i64x8 = Simd<portable_simd::i64x8>;
pub type i8x1 = Simd<portable_simd::i8x1>;
pub type i8x2 = Simd<portable_simd::i8x2>;
pub type i8x4 = Simd<portable_simd::i8x4>;
pub type i8x8 = Simd<portable_simd::i8x8>;
pub type i8x16 = Simd<portable_simd::i8x16>;
pub type i8x32 = Simd<portable_simd::i8x32>;
pub type i8x64 = Simd<portable_simd::i8x64>;
pub type isizex1 = Simd<portable_simd::isizex1>;
pub type isizex2 = Simd<portable_simd::isizex2>;
pub type isizex4 = Simd<portable_simd::isizex4>;
pub type isizex8 = Simd<portable_simd::isizex8>;
pub type u16x1 = Simd<portable_simd::u16x1>;
pub type u16x2 = Simd<portable_simd::u16x2>;
pub type u16x4 = Simd<portable_simd::u16x4>;
pub type u16x8 = Simd<portable_simd::u16x8>;
pub type u16x16 = Simd<portable_simd::u16x16>;
pub type u16x32 = Simd<portable_simd::u16x32>;
pub type u32x1 = Simd<portable_simd::u32x1>;
pub type u32x2 = Simd<portable_simd::u32x2>;
pub type u32x4 = Simd<portable_simd::u32x4>;
pub type u32x8 = Simd<portable_simd::u32x8>;
pub type u32x16 = Simd<portable_simd::u32x16>;
pub type u64x1 = Simd<portable_simd::u64x1>;
pub type u64x2 = Simd<portable_simd::u64x2>;
pub type u64x4 = Simd<portable_simd::u64x4>;
pub type u64x8 = Simd<portable_simd::u64x8>;
pub type u8x1 = Simd<portable_simd::u8x1>;
pub type u8x2 = Simd<portable_simd::u8x2>;
pub type u8x4 = Simd<portable_simd::u8x4>;
pub type u8x8 = Simd<portable_simd::u8x8>;
pub type u8x16 = Simd<portable_simd::u8x16>;
pub type u8x32 = Simd<portable_simd::u8x32>;
pub type u8x64 = Simd<portable_simd::u8x64>;
pub type usizex1 = Simd<portable_simd::usizex1>;
pub type usizex2 = Simd<portable_simd::usizex2>;
pub type usizex4 = Simd<portable_simd::usizex4>;
pub type usizex8 = Simd<portable_simd::usizex8>;
Expand Down
Loading