wide/
macros.rs

1macro_rules! int_uint_consts {
2  ($type:ty, $lanes:expr, $simd:ty, $bits:expr) => {
3    // ensure the size of the SIMD type is the same as the size of the array and number of bits is OK
4    const _: () = assert!(
5      core::mem::size_of::<$simd>() == core::mem::size_of::<[$type; $lanes]>()
6        && core::mem::size_of::<$simd>() * 8 == $bits as usize
7    );
8
9    impl $simd {
10      pub const ONE: $simd = <$simd>::new([1; $lanes]);
11      pub const ZERO: $simd = <$simd>::new([0; $lanes]);
12      pub const MAX: $simd = <$simd>::new([<$type>::MAX; $lanes]);
13      pub const MIN: $simd = <$simd>::new([<$type>::MIN; $lanes]);
14
15      /// The number of lanes in this SIMD vector.
16      pub const LANES: u16 = $lanes;
17
18      /// The size of this SIMD vector in bits.
19      pub const BITS: u16 = $bits;
20    }
21  };
22}