Skip to content

Commit b3380ef

Browse files
aabizrisebcrozet
authored andcommitted
feat: add portable_simd trait implementations for the x1 variants
1 parent e7fe5c2 commit b3380ef

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

src/simd/portable_simd_impl.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1498,82 +1498,99 @@ fn simd_complex_from_polar<N: SimdRealField>(r: N, theta: N) -> num_complex::Com
14981498
}
14991499

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

15101512
impl_int_simd!(
1513+
portable_simd::i16x1, i16, mask16x1, _0;
15111514
portable_simd::i16x2, i16, mask16x2, _0, _1;
15121515
portable_simd::i16x4, i16, mask16x4, _0, _1, _2, _3;
15131516
portable_simd::i16x8, i16, mask16x8, _0, _1, _2, _3, _4, _5, _6, _7;
15141517
portable_simd::i16x16, i16, mask16x16, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15;
15151518
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;
1519+
portable_simd::i32x1, i32, mask32x1, _0;
15161520
portable_simd::i32x2, i32, mask32x2, _0, _1;
15171521
portable_simd::i32x4, i32, mask32x4, _0, _1, _2, _3;
15181522
portable_simd::i32x8, i32, mask32x8, _0, _1, _2, _3, _4, _5, _6, _7;
15191523
portable_simd::i32x16, i32, mask32x16, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15;
1524+
portable_simd::i64x1, i64, mask64x1, _0;
15201525
portable_simd::i64x2, i64, mask64x2, _0, _1;
15211526
portable_simd::i64x4, i64, mask64x4, _0, _1, _2, _3;
15221527
portable_simd::i64x8, i64, mask64x8, _0, _1, _2, _3, _4, _5, _6, _7;
1528+
portable_simd::i8x1, i8, mask8x1, _0;
15231529
portable_simd::i8x2, i8, mask8x2, _0, _1;
15241530
portable_simd::i8x4, i8, mask8x4, _0, _1, _2, _3;
15251531
portable_simd::i8x8, i8, mask8x8, _0, _1, _2, _3, _4, _5, _6, _7;
15261532
portable_simd::i8x16, i8, mask8x16, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15;
15271533
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;
15281534
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;
1535+
portable_simd::isizex1, isize, masksizex1, _0;
15291536
portable_simd::isizex2, isize, masksizex2, _0, _1;
15301537
portable_simd::isizex4, isize, masksizex4, _0, _1, _2, _3;
15311538
portable_simd::isizex8, isize, masksizex8, _0, _1, _2, _3, _4, _5, _6, _7;
15321539
);
15331540

15341541
impl_uint_simd!(
1542+
portable_simd::u16x1, u16, mask16x1, _0;
15351543
portable_simd::u16x2, u16, mask16x2, _0, _1;
15361544
portable_simd::u16x4, u16, mask16x4, _0, _1, _2, _3;
15371545
portable_simd::u16x8, u16, mask16x8, _0, _1, _2, _3, _4, _5, _6, _7;
15381546
portable_simd::u16x16, u16, mask16x16, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15;
15391547
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;
1548+
portable_simd::u32x1, u32, mask32x1, _0;
15401549
portable_simd::u32x2, u32, mask32x2, _0, _1;
15411550
portable_simd::u32x4, u32, mask32x4, _0, _1, _2, _3;
15421551
portable_simd::u32x8, u32, mask32x8, _0, _1, _2, _3, _4, _5, _6, _7;
15431552
portable_simd::u32x16, u32, mask32x16, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15;
1553+
portable_simd::u64x1, u64, mask64x1, _0;
15441554
portable_simd::u64x2, u64, mask64x2, _0, _1;
15451555
portable_simd::u64x4, u64, mask64x4, _0, _1, _2, _3;
15461556
portable_simd::u64x8, u64, mask64x8, _0, _1, _2, _3, _4, _5, _6, _7;
1557+
portable_simd::u8x1, u8, mask8x1, _0;
15471558
portable_simd::u8x2, u8, mask8x2, _0, _1;
15481559
portable_simd::u8x4, u8, mask8x4, _0, _1, _2, _3;
15491560
portable_simd::u8x8, u8, mask8x8, _0, _1, _2, _3, _4, _5, _6, _7;
15501561
portable_simd::u8x16, u8, mask8x16, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15;
15511562
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;
15521563
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;
1564+
portable_simd::usizex1, usize, masksizex1, _0;
15531565
portable_simd::usizex2, usize, masksizex2, _0, _1;
15541566
portable_simd::usizex4, usize, masksizex4, _0, _1, _2, _3;
15551567
portable_simd::usizex8, usize, masksizex8, _0, _1, _2, _3, _4, _5, _6, _7;
15561568
);
15571569

15581570
impl_bool_simd!(
1571+
portable_simd::mask16x1, 1, _0;
15591572
portable_simd::mask16x2, 2, _0, _1;
15601573
portable_simd::mask16x4, 4, _0, _1, _2, _3;
15611574
portable_simd::mask16x8, 8, _0, _1, _2, _3, _4, _5, _6, _7;
15621575
portable_simd::mask16x16, 16, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15;
15631576
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;
1577+
portable_simd::mask32x1, 1, _0;
15641578
portable_simd::mask32x2, 2, _0, _1;
15651579
portable_simd::mask32x4, 4, _0, _1, _2, _3;
15661580
portable_simd::mask32x8, 8, _0, _1, _2, _3, _4, _5, _6, _7;
15671581
portable_simd::mask32x16, 16, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15;
1582+
portable_simd::mask64x1, 1, _0;
15681583
portable_simd::mask64x2, 2, _0, _1;
15691584
portable_simd::mask64x4, 4, _0, _1, _2, _3;
15701585
portable_simd::mask64x8, 8, _0, _1, _2, _3, _4, _5, _6, _7;
1586+
portable_simd::mask8x1, 1, _0;
15711587
portable_simd::mask8x2, 2, _0, _1;
15721588
portable_simd::mask8x4, 4, _0, _1, _2, _3;
15731589
portable_simd::mask8x8, 8, _0, _1, _2, _3, _4, _5, _6, _7;
15741590
portable_simd::mask8x16, 16, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15;
15751591
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;
15761592
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;
1593+
portable_simd::masksizex1, 1, _0;
15771594
portable_simd::masksizex2, 2, _0, _1;
15781595
portable_simd::masksizex4, 4, _0, _1, _2, _3;
15791596
portable_simd::masksizex8, 8, _0, _1, _2, _3, _4, _5, _6, _7;
@@ -1607,52 +1624,64 @@ impl_bool_simd!(
16071624
// Aliases //
16081625
//////////////////////////////////////////
16091626

1627+
pub type f32x1 = Simd<portable_simd::f32x1>;
16101628
pub type f32x2 = Simd<portable_simd::f32x2>;
16111629
pub type f32x4 = Simd<portable_simd::f32x4>;
16121630
pub type f32x8 = Simd<portable_simd::f32x8>;
16131631
pub type f32x16 = Simd<portable_simd::f32x16>;
1632+
pub type f64x1 = Simd<portable_simd::f64x1>;
16141633
pub type f64x2 = Simd<portable_simd::f64x2>;
16151634
pub type f64x4 = Simd<portable_simd::f64x4>;
16161635
pub type f64x8 = Simd<portable_simd::f64x8>;
1636+
pub type i16x1 = Simd<portable_simd::i16x1>;
16171637
pub type i16x2 = Simd<portable_simd::i16x2>;
16181638
pub type i16x4 = Simd<portable_simd::i16x4>;
16191639
pub type i16x8 = Simd<portable_simd::i16x8>;
16201640
pub type i16x16 = Simd<portable_simd::i16x16>;
16211641
pub type i16x32 = Simd<portable_simd::i16x32>;
1642+
pub type i32x1 = Simd<portable_simd::i32x1>;
16221643
pub type i32x2 = Simd<portable_simd::i32x2>;
16231644
pub type i32x4 = Simd<portable_simd::i32x4>;
16241645
pub type i32x8 = Simd<portable_simd::i32x8>;
16251646
pub type i32x16 = Simd<portable_simd::i32x16>;
1647+
pub type i64x1 = Simd<portable_simd::i64x1>;
16261648
pub type i64x2 = Simd<portable_simd::i64x2>;
16271649
pub type i64x4 = Simd<portable_simd::i64x4>;
16281650
pub type i64x8 = Simd<portable_simd::i64x8>;
1651+
pub type i8x1 = Simd<portable_simd::i8x1>;
16291652
pub type i8x2 = Simd<portable_simd::i8x2>;
16301653
pub type i8x4 = Simd<portable_simd::i8x4>;
16311654
pub type i8x8 = Simd<portable_simd::i8x8>;
16321655
pub type i8x16 = Simd<portable_simd::i8x16>;
16331656
pub type i8x32 = Simd<portable_simd::i8x32>;
16341657
pub type i8x64 = Simd<portable_simd::i8x64>;
1658+
pub type isizex1 = Simd<portable_simd::isizex1>;
16351659
pub type isizex2 = Simd<portable_simd::isizex2>;
16361660
pub type isizex4 = Simd<portable_simd::isizex4>;
16371661
pub type isizex8 = Simd<portable_simd::isizex8>;
1662+
pub type u16x1 = Simd<portable_simd::u16x1>;
16381663
pub type u16x2 = Simd<portable_simd::u16x2>;
16391664
pub type u16x4 = Simd<portable_simd::u16x4>;
16401665
pub type u16x8 = Simd<portable_simd::u16x8>;
16411666
pub type u16x16 = Simd<portable_simd::u16x16>;
16421667
pub type u16x32 = Simd<portable_simd::u16x32>;
1668+
pub type u32x1 = Simd<portable_simd::u32x1>;
16431669
pub type u32x2 = Simd<portable_simd::u32x2>;
16441670
pub type u32x4 = Simd<portable_simd::u32x4>;
16451671
pub type u32x8 = Simd<portable_simd::u32x8>;
16461672
pub type u32x16 = Simd<portable_simd::u32x16>;
1673+
pub type u64x1 = Simd<portable_simd::u64x1>;
16471674
pub type u64x2 = Simd<portable_simd::u64x2>;
16481675
pub type u64x4 = Simd<portable_simd::u64x4>;
16491676
pub type u64x8 = Simd<portable_simd::u64x8>;
1677+
pub type u8x1 = Simd<portable_simd::u8x1>;
16501678
pub type u8x2 = Simd<portable_simd::u8x2>;
16511679
pub type u8x4 = Simd<portable_simd::u8x4>;
16521680
pub type u8x8 = Simd<portable_simd::u8x8>;
16531681
pub type u8x16 = Simd<portable_simd::u8x16>;
16541682
pub type u8x32 = Simd<portable_simd::u8x32>;
16551683
pub type u8x64 = Simd<portable_simd::u8x64>;
1684+
pub type usizex1 = Simd<portable_simd::usizex1>;
16561685
pub type usizex2 = Simd<portable_simd::usizex2>;
16571686
pub type usizex4 = Simd<portable_simd::usizex4>;
16581687
pub type usizex8 = Simd<portable_simd::usizex8>;

0 commit comments

Comments
 (0)