summaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorPeter Maydell2021-08-13 18:11:49 +0200
committerPeter Maydell2021-08-25 11:48:49 +0200
commit41704cc262d6f451470c2074560bc7309064865d (patch)
tree33a779fe8b0a830ed58cfd90cb02bffd7ebd7cb7 /target
parenttarget/arm: Fix VPT advance when ECI is non-zero (diff)
downloadqemu-41704cc262d6f451470c2074560bc7309064865d.tar.gz
qemu-41704cc262d6f451470c2074560bc7309064865d.tar.xz
qemu-41704cc262d6f451470c2074560bc7309064865d.zip
target/arm: Fix VLDRB/H/W for predicated elements
For vector loads, predicated elements are zeroed, instead of retaining their previous values (as happens for most data processing operations). This means we need to distinguish "beat not executed due to ECI" (don't touch destination element) from "beat executed but predicated out" (zero destination element). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'target')
-rw-r--r--target/arm/mve_helper.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/target/arm/mve_helper.c b/target/arm/mve_helper.c
index bc89ce94d5..be8b954531 100644
--- a/target/arm/mve_helper.c
+++ b/target/arm/mve_helper.c
@@ -146,12 +146,13 @@ static void mve_advance_vpt(CPUARMState *env)
env->v7m.vpr = vpr;
}
-
+/* For loads, predicated lanes are zeroed instead of keeping their old values */
#define DO_VLDR(OP, MSIZE, LDTYPE, ESIZE, TYPE) \
void HELPER(mve_##OP)(CPUARMState *env, void *vd, uint32_t addr) \
{ \
TYPE *d = vd; \
uint16_t mask = mve_element_mask(env); \
+ uint16_t eci_mask = mve_eci_mask(env); \
unsigned b, e; \
/* \
* R_SXTM allows the dest reg to become UNKNOWN for abandoned \
@@ -159,8 +160,9 @@ static void mve_advance_vpt(CPUARMState *env)
* then take an exception. \
*/ \
for (b = 0, e = 0; b < 16; b += ESIZE, e++) { \
- if (mask & (1 << b)) { \
- d[H##ESIZE(e)] = cpu_##LDTYPE##_data_ra(env, addr, GETPC()); \
+ if (eci_mask & (1 << b)) { \
+ d[H##ESIZE(e)] = (mask & (1 << b)) ? \
+ cpu_##LDTYPE##_data_ra(env, addr, GETPC()) : 0; \
} \
addr += MSIZE; \
} \