File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -159,12 +159,15 @@ pub fn _mm256_bsrli_epi128<const IMM8: i32>(a: __m256i) -> __m256i {
159159 let a = BitVec :: to_i128x2 (a );
160160 let a = i128x2 :: from_fn (| i | {
161161 let tmp = IMM8 % 256 ;
162- let tmp = tmp % 16 ;
163- ((a [i ] as u128 ) >> (tmp * 8 )) as i128
162+ if tmp > 15 {0 } else {
163+ ((a [i ] as u128 ) >> (tmp * 8 )) as i128
164+ }
164165 });
165166 BitVec :: from_i128x2 (a )
166167 }
167168 ```
169+ There is no test for the specification, and thus it has to be manually reviewed to ensure that it perfectly captures the
170+ behaviour described by the documentation.
168171
169172
170173
Original file line number Diff line number Diff line change @@ -12,8 +12,9 @@ pub fn _mm256_bsrli_epi128<const IMM8: i32>(a: __m256i) -> __m256i {
1212 let a = BitVec :: to_i128x2 ( a) ;
1313 let a = i128x2:: from_fn ( |i| {
1414 let tmp = IMM8 % 256 ;
15- let tmp = tmp % 16 ;
16- ( ( a[ i] as u128 ) >> ( tmp * 8 ) ) as i128
15+ if tmp > 15 { 0 } else {
16+ ( ( a[ i] as u128 ) >> ( tmp * 8 ) ) as i128
17+ }
1718 } ) ;
1819 BitVec :: from_i128x2 ( a)
1920}
You can’t perform that action at this time.
0 commit comments