aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2013-12-01 15:23:00 +0000
committerPeter Maydell <peter.maydell@linaro.org>2013-12-01 15:23:00 +0000
commit7a3e1f07c4c6cd2daabed712f47718ce5f8a17a2 (patch)
tree965d67dcff903fe537cc820aa988ac46888fbd65
parent8ae1aa47f0ec7475d69de3d63e8eb9e85e1e4862 (diff)
downloadqemu-arm-a64-wip.tar.gz
BUGFIX arithmetic in disas_pc_rel_adra64-wip
Fix a bug where we weren't signextending the immediate properly. Isn't C great?
-rw-r--r--target-arm/translate-a64.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/target-arm/translate-a64.c b/target-arm/translate-a64.c
index 161f18bb66..15c2fde759 100644
--- a/target-arm/translate-a64.c
+++ b/target-arm/translate-a64.c
@@ -1827,7 +1827,7 @@ static void disas_pc_rel_adr(DisasContext *s, uint32_t insn)
int64_t offset; /* SignExtend(immhi:immlo) -> offset */
page = insn & (1 << 31) ? 1 : 0;
- offset = sextract32(insn, 5, 19) << 2 | extract32(insn, 29, 2);
+ offset = ((int64_t)sextract32(insn, 5, 19) << 2) | extract32(insn, 29, 2);
rd = extract32(insn, 0, 5);
base = s->pc - 4;