File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -98,6 +98,11 @@ mod neon {
9898
9999 #[ inline]
100100 unsafe fn right_shift_32 < const N : i32 > ( el : DataType ) -> DataType {
101+ const {
102+ assert ! ( N >= 0 ) ;
103+ assert ! ( N <= 32 ) ;
104+ }
105+
101106 // We unroll here because vshrq_n_u32 only accepts constants from 1 to 32.
102107 match N {
103108 0 => el,
@@ -132,14 +137,19 @@ mod neon {
132137 29 => vshrq_n_u32 :: < 29 > ( el) ,
133138 30 => vshrq_n_u32 :: < 30 > ( el) ,
134139 31 => vshrq_n_u32 :: < 31 > ( el) ,
135- 32 => vshrq_n_u32 :: < 32 > ( el ) ,
140+ 32 => vdupq_n_u32 ( 0 ) ,
136141 _ => core:: hint:: unreachable_unchecked ( ) ,
137142 }
138143 }
139144
140145 #[ inline]
141146 unsafe fn left_shift_32 < const N : i32 > ( el : DataType ) -> DataType {
142- // We unroll here because vshlq_n_u32 only accepts constants from 1 to 32.
147+ const {
148+ assert ! ( N >= 0 ) ;
149+ assert ! ( N <= 32 ) ;
150+ }
151+
152+ // We unroll here because vshlq_n_u32 only accepts constants from 0 to 31.
143153 match N {
144154 0 => el,
145155 1 => vshlq_n_u32 :: < 1 > ( el) ,
@@ -178,11 +188,7 @@ mod neon {
178188 }
179189 }
180190
181- #[ inline]
182- unsafe fn op_or ( left : DataType , right : DataType ) -> DataType {
183- // Bitwise OR of two vectors
184- vorrq_u32 ( left, right)
185- }
191+ use vorrq_u32 as op_or;
186192
187193 #[ inline]
188194 unsafe fn op_and ( left : DataType , right : DataType ) -> DataType {
You can’t perform that action at this time.
0 commit comments