From: Paul Brook <paul@nowt.org>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] qemu/target-arm translate.c
Date: Wed, 14 Jun 2006 14:36:07 +0000 [thread overview]
Message-ID: <E1FqWTX-0004Zm-SR@savannah.gnu.org> (raw)
CVSROOT: /sources/qemu
Module name: qemu
Changes by: Paul Brook <pbrook> 06/06/14 14:36:07
Modified files:
target-arm : translate.c
Log message:
ARM postincrememnt addressing fix.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/target-arm/translate.c?cvsroot=qemu&r1=1.42&r2=1.43
Patches:
Index: translate.c
===================================================================
RCS file: /sources/qemu/qemu/target-arm/translate.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -b -r1.42 -r1.43
--- translate.c 22 May 2006 23:06:04 -0000 1.42
+++ translate.c 14 Jun 2006 14:36:07 -0000 1.43
@@ -383,19 +383,23 @@
}
}
-static inline void gen_add_datah_offset(DisasContext *s, unsigned int insn)
+static inline void gen_add_datah_offset(DisasContext *s, unsigned int insn,
+ int extra)
{
int val, rm;
if (insn & (1 << 22)) {
/* immediate */
val = (insn & 0xf) | ((insn >> 4) & 0xf0);
+ val += extra;
if (!(insn & (1 << 23)))
val = -val;
if (val != 0)
gen_op_addl_T1_im(val);
} else {
/* register */
+ if (extra)
+ gen_op_addl_T1_im(extra);
rm = (insn) & 0xf;
gen_movl_T2_reg(s, rm);
if (!(insn & (1 << 23)))
@@ -1530,12 +1534,14 @@
}
}
} else {
+ int address_offset;
/* Misc load/store */
rn = (insn >> 16) & 0xf;
rd = (insn >> 12) & 0xf;
gen_movl_T1_reg(s, rn);
if (insn & (1 << 24))
- gen_add_datah_offset(s, insn);
+ gen_add_datah_offset(s, insn, 0);
+ address_offset = 0;
if (insn & (1 << 20)) {
/* load */
switch(sh) {
@@ -1560,8 +1566,6 @@
gen_op_addl_T1_im(4);
gen_movl_T0_reg(s, rd + 1);
gen_ldst(stl, s);
- if ((insn & (1 << 24)) || (insn & (1 << 20)))
- gen_op_addl_T1_im(-4);
} else {
/* load */
gen_ldst(ldl, s);
@@ -1569,18 +1573,19 @@
gen_op_addl_T1_im(4);
gen_ldst(ldl, s);
gen_movl_reg_T0(s, rd + 1);
- if ((insn & (1 << 24)) || (insn & (1 << 20)))
- gen_op_addl_T1_im(-4);
}
+ address_offset = -4;
} else {
/* store */
gen_movl_T0_reg(s, rd);
gen_ldst(stw, s);
}
if (!(insn & (1 << 24))) {
- gen_add_datah_offset(s, insn);
+ gen_add_datah_offset(s, insn, address_offset);
gen_movl_reg_T1(s, rn);
} else if (insn & (1 << 21)) {
+ if (address_offset)
+ gen_op_addl_T1_im(address_offset);
gen_movl_reg_T1(s, rn);
}
}
next reply other threads:[~2006-06-14 14:36 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-14 14:36 Paul Brook [this message]
-- strict thread matches above, loose matches on Subject: below --
2007-11-11 14:36 [Qemu-devel] qemu/target-arm translate.c Paul Brook
2007-06-11 18:59 Paul Brook
2007-06-10 13:53 Andrzej Zaborowski
2007-03-17 1:43 Paul Brook
2007-02-14 20:17 Paul Brook
2006-10-25 17:43 Paul Brook
2006-05-22 23:06 Fabrice Bellard
2006-04-09 14:38 Paul Brook
2006-02-11 16:20 Paul Brook
2006-02-07 3:34 Paul Brook
2005-12-18 16:55 Fabrice Bellard
2005-12-04 18:56 Fabrice Bellard
2005-11-21 23:30 Fabrice Bellard
2005-11-06 19:36 Fabrice Bellard
2005-08-21 10:14 Fabrice Bellard
2005-05-13 22:50 Fabrice Bellard
2005-04-23 18:46 Fabrice Bellard
2005-04-23 18:27 Fabrice Bellard
2005-01-03 23:53 Fabrice Bellard
2003-11-03 22:25 Fabrice Bellard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1FqWTX-0004Zm-SR@savannah.gnu.org \
--to=paul@nowt.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).