8278171: [vectorapi] Mask incorrectly computed for zero extending cast

Reviewed-by: psandoz
This commit is contained in:
merykitty 2021-12-03 17:07:11 +00:00 committed by Paul Sandoz
parent fbf096eea4
commit 2e30fa936d
2 changed files with 322 additions and 1 deletions

View file

@ -707,7 +707,7 @@ abstract class AbstractVector<E> extends Vector<E> {
return v.convert0('C', rspi);
}
// extend in place, but remove unwanted sign extension
long mask = -1L >>> sizeChange;
long mask = -1L >>> -dsp.elementSize();
return (AbstractVector<F>)
v.convert0('C', rspi)
.lanewise(AND, rspi.broadcast(mask));