This is reported by Coverity. The algorithm description at
ftp://ftp.icm.edu.pl/packages/ggi/doc/hw/sparc/Sparc.pdf suggests
that the 32-bit parts of rs2, after the left shift, is treated
as a 64-bit integer. Bits 32 and above are used to do the
saturating truncation.
Use a cast to unsigned in order to placate ubsan for negative
inputs, and do so in the other fpack* instructions too.
Signed-off-by: Paolo Bonzini<address@hidden>
---
target-sparc/vis_helper.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)