@@ -40,7 +40,7 @@ macro_rules! ident_to_value (
4040///
4141/// This is needed to overcome the orphan rules.
4242#[ repr( align( 16 ) ) ]
43- #[ derive( Copy , Clone , PartialEq , Eq , Debug ) ]
43+ #[ derive( Copy , Clone , PartialEq , Eq , Debug , Default ) ]
4444#[ cfg_attr(
4545 feature = "rkyv" ,
4646 derive( rkyv:: Archive , rkyv:: Deserialize , rkyv:: Serialize ) ,
@@ -64,6 +64,15 @@ macro_rules! impl_bool_simd (
6464 ( $( $t: ty, $lanes: expr, $( $i: ident) ,* ; ) * ) => { $(
6565 impl_simd_value!( $t, bool , $lanes, AutoSimd <$t> $( , $i) * ; ) ;
6666
67+ impl AutoSimd <$t> {
68+ pub const ZERO : Self = AutoSimd ( [ false ; $lanes] ) ;
69+ pub const ONE : Self = AutoSimd ( [ true ; $lanes] ) ;
70+
71+ pub fn new( $( $i: bool ) ,* ) -> Self {
72+ AutoSimd ( [ $( $i) ,* ] )
73+ }
74+ }
75+
6776 impl From <[ bool ; $lanes] > for AutoSimd <$t> {
6877 #[ inline( always) ]
6978 fn from( vals: [ bool ; $lanes] ) -> Self {
@@ -280,12 +289,6 @@ macro_rules! impl_simd_value (
280289 }
281290 }
282291
283- impl AutoSimd <$t> {
284- pub fn new( $( $i: $elt) ,* ) -> Self {
285- AutoSimd ( [ $( $i) ,* ] )
286- }
287- }
288-
289292 impl PrimitiveSimdValue for AutoSimd <$t> { }
290293
291294 impl SimdValue for AutoSimd <$t> {
@@ -334,6 +337,15 @@ macro_rules! impl_uint_simd (
334337 ( $( $t: ty, $elt: ty, $lanes: expr, $bool: ty, $( $i: ident) ,* ; ) * ) => ( $(
335338 impl_simd_value!( $t, $elt, $lanes, $bool $( , $i) * ; ) ;
336339
340+ impl AutoSimd <$t> {
341+ pub const ZERO : Self = AutoSimd ( [ 0 as $elt; $lanes] ) ;
342+ pub const ONE : Self = AutoSimd ( [ 1 as $elt; $lanes] ) ;
343+
344+ pub fn new( $( $i: $elt) ,* ) -> Self {
345+ AutoSimd ( [ $( $i) ,* ] )
346+ }
347+ }
348+
337349 impl From <[ $elt; $lanes] > for AutoSimd <$t> {
338350 #[ inline( always) ]
339351 fn from( vals: [ $elt; $lanes] ) -> Self {
@@ -1534,7 +1546,7 @@ impl_bool_simd!(
15341546 [ bool ; 8 ] , 8 , _0, _1, _2, _3, _4, _5, _6, _7;
15351547 [ bool ; 16 ] , 16 , _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15;
15361548 [ bool ; 32 ] , 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;
1537- // [bool; 64], 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;
1549+ // [bool; 64], 64, 0, _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;
15381550) ;
15391551
15401552//
0 commit comments