Avoid subtraction overflow in test_mm_store{,1,r}_ps functions

This overflow was found while testing core_arch with miri
This commit is contained in:
Eduardo Sánchez Muñoz 2023-09-29 17:00:02 +02:00 committed by Amanieu d'Antras
parent fe8004cd5e
commit b8b79f2e7a

View file

@ -3153,7 +3153,7 @@ mod tests {
let mut p = vals.as_mut_ptr();
if (p as usize) & 0xf != 0 {
ofs = ((16 - (p as usize)) & 0xf) >> 2;
ofs = (16 - ((p as usize) & 0xf)) >> 2;
p = p.add(ofs);
}
@ -3179,7 +3179,7 @@ mod tests {
// Align p to 16-byte boundary
if (p as usize) & 0xf != 0 {
ofs = ((16 - (p as usize)) & 0xf) >> 2;
ofs = (16 - ((p as usize) & 0xf)) >> 2;
p = p.add(ofs);
}
@ -3205,7 +3205,7 @@ mod tests {
// Align p to 16-byte boundary
if (p as usize) & 0xf != 0 {
ofs = ((16 - (p as usize)) & 0xf) >> 2;
ofs = (16 - ((p as usize) & 0xf)) >> 2;
p = p.add(ofs);
}