diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2011-04-11 16:26:22 +0100 |
---|---|---|
committer | Aurelien Jarno <aurelien@aurel32.net> | 2011-04-12 23:33:33 +0200 |
commit | 56907d776e1133bf4f633e4e542267d23d2c09cf (patch) | |
tree | aabb305886af86f3179b6c79ff544f71f900bf8e /target-arm/translate.c | |
parent | fc2a9b37849d25d21d161c1319581420499ab4b2 (diff) | |
download | qemu-56907d776e1133bf4f633e4e542267d23d2c09cf.zip qemu-56907d776e1133bf4f633e4e542267d23d2c09cf.tar.gz qemu-56907d776e1133bf4f633e4e542267d23d2c09cf.tar.bz2 |
target-arm: Treat UNPREDICTABLE VTBL, VTBX case as UNDEF
Catch the UNPREDICTABLE case for Neon VTBL,VTBX, and UNDEF it
rather than allowing the helper function to index off the end
of the register file.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'target-arm/translate.c')
-rw-r--r-- | target-arm/translate.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/target-arm/translate.c b/target-arm/translate.c index b647c7b..be25c8f 100644 --- a/target-arm/translate.c +++ b/target-arm/translate.c @@ -6023,7 +6023,14 @@ static int disas_neon_data_insn(CPUState * env, DisasContext *s, uint32_t insn) } } else if ((insn & (1 << 10)) == 0) { /* VTBL, VTBX. */ - int n = ((insn >> 5) & 0x18) + 8; + int n = ((insn >> 8) & 3) + 1; + if ((rn + n) > 32) { + /* This is UNPREDICTABLE; we choose to UNDEF to avoid the + * helper function running off the end of the register file. + */ + return 1; + } + n <<= 3; if (insn & (1 << 6)) { tmp = neon_load_reg(rd, 0); } else { |