File tree Expand file tree Collapse file tree 1 file changed +14
-17
lines changed Expand file tree Collapse file tree 1 file changed +14
-17
lines changed Original file line number Diff line number Diff line change 1818//! [wiki_avx]: https://en.wikipedia.org/wiki/Advanced_Vector_Extensions
1919//! [wiki_fma]: https://en.wikipedia.org/wiki/Fused_multiply-accumulate
2020
21-
22-
2321use crate :: core_arch:: { simd:: * , x86:: * } ;
2422use crate :: intrinsics:: simd:: * ;
2523
@@ -170,8 +168,7 @@ pub fn _mm256_adds_epu16(a: __m256i, b: __m256i) -> __m256i {
170168#[ stable( feature = "simd_x86" , since = "1.27.0" ) ]
171169pub fn _mm256_alignr_epi8 < const IMM8 : i32 > ( a : __m256i , b : __m256i ) -> __m256i {
172170 static_assert_uimm_bits ! ( IMM8 , 8 ) ;
173-
174-
171+
175172 // If palignr is shifting the pair of vectors more than the size of two
176173 // lanes, emit zero.
177174 if IMM8 >= 32 {
@@ -185,20 +182,20 @@ pub fn _mm256_alignr_epi8<const IMM8: i32>(a: __m256i, b: __m256i) -> __m256i {
185182 ( a, b)
186183 } ;
187184 unsafe {
188- if IMM8 == 16 {
189- return transmute ( a)
190- }
185+ if IMM8 == 16 {
186+ return transmute ( a) ;
187+ }
191188 }
192189 const fn mask ( shift : u32 , i : u32 ) -> u32 {
193- let shift = shift % 16 ;
194- let mod_i = i% 16 ;
195- if mod_i < ( 16 - shift) {
196- i + shift
197- } else {
198- i + 16 + shift
199- }
200- }
201-
190+ let shift = shift % 16 ;
191+ let mod_i = i % 16 ;
192+ if mod_i < ( 16 - shift) {
193+ i + shift
194+ } else {
195+ i + 16 + shift
196+ }
197+ }
198+
202199 unsafe {
203200 let r: i8x32 = simd_shuffle ! (
204201 b. as_i8x32( ) ,
@@ -220,7 +217,7 @@ pub fn _mm256_alignr_epi8<const IMM8: i32>(a: __m256i, b: __m256i) -> __m256i {
220217 mask( IMM8 as u32 , 13 ) ,
221218 mask( IMM8 as u32 , 14 ) ,
222219 mask( IMM8 as u32 , 15 ) ,
223- mask( IMM8 as u32 , 16 ) ,
220+ mask( IMM8 as u32 , 16 ) ,
224221 mask( IMM8 as u32 , 17 ) ,
225222 mask( IMM8 as u32 , 18 ) ,
226223 mask( IMM8 as u32 , 19 ) ,
You can’t perform that action at this time.
0 commit comments