@@ -52,13 +52,13 @@ macro_rules! impl_bool_simd (
5252 ( $( $t: ty, $lanes: literal, $( $i: ident) ,* ; ) * ) => { $(
5353 impl fmt:: Display for Simd <$t> {
5454 fn fmt( & self , f: & mut fmt:: Formatter <' _>) -> fmt:: Result {
55- if Self :: lanes ( ) == 1 {
55+ if Self :: LANES == 1 {
5656 return self . extract( 0 ) . fmt( f) ;
5757 }
5858
5959 write!( f, "({}" , self . extract( 0 ) ) ?;
6060
61- for i in 1 ..Self :: lanes ( ) {
61+ for i in 1 ..Self :: LANES {
6262 write!( f, ", {}" , self . extract( i) ) ?;
6363 }
6464
@@ -76,14 +76,10 @@ macro_rules! impl_bool_simd (
7676 impl PrimitiveSimdValue for Simd <$t> { }
7777
7878 impl SimdValue for Simd <$t> {
79+ const LANES : usize = $lanes;
7980 type Element = bool ;
8081 type SimdBool = Simd <$t>;
8182
82- #[ inline( always) ]
83- fn lanes( ) -> usize {
84- $lanes
85- }
86-
8783 #[ inline( always) ]
8884 fn splat( val: Self :: Element ) -> Self {
8985 Simd ( <$t>:: splat( val) )
@@ -263,7 +259,7 @@ macro_rules! impl_scalar_subset_of_simd (
263259 fn is_in_subset( c: & Simd <N2 >) -> bool {
264260 let elt0 = c. extract( 0 ) ;
265261 elt0. is_in_subset( ) &&
266- ( 1 ..Simd :: <N2 >:: lanes ( ) ) . all( |i| c. extract( i) == elt0)
262+ ( 1 ..Simd :: <N2 >:: LANES ) . all( |i| c. extract( i) == elt0)
267263 }
268264 }
269265 ) * }
@@ -277,13 +273,13 @@ macro_rules! impl_simd_value (
277273 ( $( $t: ty, $elt: ty, $bool: ty, $( $i: ident) ,* ; ) * ) => ( $(
278274 impl fmt:: Display for Simd <$t> {
279275 fn fmt( & self , f: & mut fmt:: Formatter <' _>) -> fmt:: Result {
280- if Self :: lanes ( ) == 1 {
276+ if Self :: LANES == 1 {
281277 return self . extract( 0 ) . fmt( f) ;
282278 }
283279
284280 write!( f, "({}" , self . extract( 0 ) ) ?;
285281
286- for i in 1 ..Self :: lanes ( ) {
282+ for i in 1 ..Self :: LANES {
287283 write!( f, ", {}" , self . extract( i) ) ?;
288284 }
289285
@@ -301,14 +297,10 @@ macro_rules! impl_simd_value (
301297 impl PrimitiveSimdValue for Simd <$t> { }
302298
303299 impl SimdValue for Simd <$t> {
300+ const LANES : usize = <$t>:: LEN ;
304301 type Element = $elt;
305302 type SimdBool = $bool;
306303
307- #[ inline( always) ]
308- fn lanes( ) -> usize {
309- <$t>:: LEN
310- }
311-
312304 #[ inline( always) ]
313305 fn splat( val: Self :: Element ) -> Self {
314306 Simd ( <$t>:: splat( val) )
@@ -351,7 +343,7 @@ macro_rules! impl_uint_simd (
351343 ///
352344 /// # Panics
353345 ///
354- /// If `slice.len() < Self::lanes() `.
346+ /// If `slice.len() < Self::LANES `.
355347 #[ inline]
356348 pub fn from_slice_unaligned( slice: & [ $elt] ) -> Self {
357349 Simd ( <$t>:: from_slice( slice) )
@@ -1075,7 +1067,7 @@ macro_rules! impl_float_simd (
10751067 #[ inline( always) ]
10761068 fn simd_horizontal_product( self ) -> Self :: Element {
10771069 let mut prod = self . extract( 0 ) ;
1078- for ii in 1 ..Self :: lanes ( ) {
1070+ for ii in 1 ..Self :: LANES {
10791071 prod *= self . extract( ii)
10801072 }
10811073 prod
@@ -1589,9 +1581,9 @@ impl_bool_simd!(
15891581//
15901582//macro_rules! impl_simd_complex_from(
15911583// ($($t: ty, $elt: ty $(, $i: expr)*;)*) => ($(
1592- // impl From<[num_complex::Complex<$elt>; <$t>::lanes() ]> for num_complex::Complex<Simd<$t>> {
1584+ // impl From<[num_complex::Complex<$elt>; <$t>::LANES ]> for num_complex::Complex<Simd<$t>> {
15931585// #[inline(always)]
1594- // fn from(vals: [num_complex::Complex<$elt>; <$t>::lanes() ]) -> Self {
1586+ // fn from(vals: [num_complex::Complex<$elt>; <$t>::LANES ]) -> Self {
15951587// num_complex::Complex {
15961588// re: <$t>::from([$(vals[$i].re),*]),
15971589// im: <$t>::from([$(vals[$i].im),*]),
0 commit comments