diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2021-08-13 17:11:47 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2021-08-25 10:48:48 +0100 |
commit | c88ff88498ea95e78d5fbd192de5123c1d88f9a8 (patch) | |
tree | e0303a9ca47b3f24d7d3ec08192b2b7d162f99e9 /target/arm | |
parent | aa29190826f2f061ed3ffad0a6cabb30eaf7f8f0 (diff) | |
download | qemu-c88ff88498ea95e78d5fbd192de5123c1d88f9a8.zip qemu-c88ff88498ea95e78d5fbd192de5123c1d88f9a8.tar.gz qemu-c88ff88498ea95e78d5fbd192de5123c1d88f9a8.tar.bz2 |
target/arm: Fix MVE VSLI by 0 and VSRI by <dt>
In the MVE shift-and-insert insns, we special case VSLI by 0
and VSRI by <dt>. VSRI by <dt> 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 <dt>.
Since the generic logic gives the right answer for a shift
by 0, just use that.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'target/arm')
-rw-r--r-- | target/arm/mve_helper.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/target/arm/mve_helper.c b/target/arm/mve_helper.c index db5d622..f14fa91 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 <dt>. \ - * The generic logic would give the right answer for 0 but \ - * fails for <dt>. \ + * Only VSRI can shift by <dt>; 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; \ } \ |