From: Peter Maydell Date: Fri, 13 Aug 2021 16:11:47 +0000 (+0100) Subject: target/arm: Fix MVE VSLI by 0 and VSRI by
X-Git-Tag: v6.2.0-rc0~136^2~41 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c88ff88498ea95e78d5fbd192de5123c1d88f9a8;p=thirdparty%2Fqemu.git target/arm: Fix MVE VSLI by 0 and VSRI by
In the MVE shift-and-insert insns, we special case VSLI by 0 and VSRI by
. VSRI by
means "don't update the destination", which is what we've implemented. However VSLI by 0 is "set destination to the input", so we don't want to use the same special-casing that we do for VSRI by
. Since the generic logic gives the right answer for a shift by 0, just use that. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- diff --git a/target/arm/mve_helper.c b/target/arm/mve_helper.c index db5d6220854..f14fa914b68 100644 --- a/target/arm/mve_helper.c +++ b/target/arm/mve_helper.c @@ -1279,11 +1279,12 @@ DO_2SHIFT_S(vrshli_s, DO_VRSHLS) uint16_t mask; \ uint64_t shiftmask; \ unsigned e; \ - if (shift == 0 || shift == ESIZE * 8) { \ + if (shift == ESIZE * 8) { \ /* \ - * Only VSLI can shift by 0; only VSRI can shift by
. \ - * The generic logic would give the right answer for 0 but \ - * fails for
. \ + * Only VSRI can shift by
; it should mean "don't \ + * update the destination". The generic logic can't handle \ + * this because it would try to shift by an out-of-range \ + * amount, so special case it here. \ */ \ goto done; \ } \