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 {
159
159
let a = BitVec :: to_i128x2 (a );
160
160
let a = i128x2 :: from_fn (| i | {
161
161
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
+ }
164
165
});
165
166
BitVec :: from_i128x2 (a )
166
167
}
167
168
```
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.
168
171
169
172
170
173
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 {
12
12
let a = BitVec :: to_i128x2 ( a) ;
13
13
let a = i128x2:: from_fn ( |i| {
14
14
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
+ }
17
18
} ) ;
18
19
BitVec :: from_i128x2 ( a)
19
20
}
You can’t perform that action at this time.
0 commit comments