[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH for-6.2 08/53] target/arm: Fix calculation of LTP mask when LR is
From: |
Peter Maydell |
Subject: |
[PATCH for-6.2 08/53] target/arm: Fix calculation of LTP mask when LR is 0 |
Date: |
Thu, 29 Jul 2021 12:14:27 +0100 |
In mve_element_mask(), we calculate a mask for tail predication which
should have a number of 1 bits based on the value of LR. However,
our MAKE_64BIT_MASK() macro has undefined behaviour when passed a
zero length. Special case this to give the all-zeroes mask we
require.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/mve_helper.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/target/arm/mve_helper.c b/target/arm/mve_helper.c
index 1a4b2ef8075..bc67b86e700 100644
--- a/target/arm/mve_helper.c
+++ b/target/arm/mve_helper.c
@@ -64,7 +64,8 @@ static uint16_t mve_element_mask(CPUARMState *env)
*/
int masklen = env->regs[14] << env->v7m.ltpsize;
assert(masklen <= 16);
- mask &= MAKE_64BIT_MASK(0, masklen);
+ uint16_t ltpmask = masklen ? MAKE_64BIT_MASK(0, masklen) : 0;
+ mask &= ltpmask;
}
if ((env->condexec_bits & 0xf) == 0) {
--
2.20.1
- [PATCH for-6.2 00/53] target/arm: MVE slices 3 and 4, Peter Maydell, 2021/07/29
- [PATCH for-6.2 02/53] target/arm: Print MVE VPR in CPU dumps, Peter Maydell, 2021/07/29
- [PATCH for-6.2 03/53] target/arm: Fix MVE VSLI by 0 and VSRI by <dt>, Peter Maydell, 2021/07/29
- [PATCH for-6.2 04/53] target/arm: Fix signed VADDV, Peter Maydell, 2021/07/29
- [PATCH for-6.2 01/53] target/arm: Note that we handle VMOVL as a special case of VSHLL, Peter Maydell, 2021/07/29
- [PATCH for-6.2 05/53] target/arm: Fix mask handling for MVE narrowing operations, Peter Maydell, 2021/07/29
- [PATCH for-6.2 09/53] target/arm: Factor out mve_eci_mask(), Peter Maydell, 2021/07/29
- [PATCH for-6.2 06/53] target/arm: Fix 48-bit saturating shifts, Peter Maydell, 2021/07/29
- [PATCH for-6.2 08/53] target/arm: Fix calculation of LTP mask when LR is 0,
Peter Maydell <=
- [PATCH for-6.2 10/53] target/arm: Fix VPT advance when ECI is non-zero, Peter Maydell, 2021/07/29
- [PATCH for-6.2 07/53] target/arm: Fix MVE 48-bit SQRSHRL for small right shifts, Peter Maydell, 2021/07/29
- [PATCH for-6.2 11/53] target/arm: Fix VLDRB/H/W for predicated elements, Peter Maydell, 2021/07/29
- [PATCH for-6.2 13/53] target/arm: Implement MVE incrementing/decrementing dup insns, Peter Maydell, 2021/07/29
- [PATCH for-6.2 16/53] target/arm: Implement MVE integer vector-vs-scalar comparisons, Peter Maydell, 2021/07/29
- [PATCH for-6.2 12/53] target/arm: Implement MVE VMULL (polynomial), Peter Maydell, 2021/07/29
- [PATCH for-6.2 14/53] target/arm: Factor out gen_vpst(), Peter Maydell, 2021/07/29
- [PATCH for-6.2 21/53] target/arm: Implement MVE integer min/max across vector, Peter Maydell, 2021/07/29