Skip to content

Commit fc13ee1

Browse files
authored
Merge pull request from GHSA-xm67-587q-r2vw
This commit fixes an off-by-one error in the subtraction of indices when shuffling a vector with itself. Lanes 16-and-above are mapped to select from the first vector since the first and second element are the same, but the subtraction was with 15 rather than 16 by accident.
1 parent c00d3f0 commit fc13ee1

File tree

1 file changed

+1
-1
lines changed
  • cranelift/codegen/src/isa/x64/lower

1 file changed

+1
-1
lines changed

cranelift/codegen/src/isa/x64/lower/isle.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,7 @@ impl Context for IsleContext<'_, '_, MInst, X64Backend> {
756756
fn shuffle_0_31_mask(&mut self, mask: &VecMask) -> VCodeConstant {
757757
let mask = mask
758758
.iter()
759-
.map(|&b| if b > 15 { b.wrapping_sub(15) } else { b })
759+
.map(|&b| if b > 15 { b.wrapping_sub(16) } else { b })
760760
.map(|b| if b > 15 { 0b10000000 } else { b })
761761
.collect();
762762
self.lower_ctx

0 commit comments

Comments
 (0)