Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HHQTo-0000mH-0r for qemu-devel@nongnu.org; Wed, 14 Feb 2007 15:11:52 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HHQTk-0000m4-K9 for qemu-devel@nongnu.org; Wed, 14 Feb 2007 15:11:51 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HHQTk-0000m1-Dd for qemu-devel@nongnu.org; Wed, 14 Feb 2007 15:11:48 -0500 Received: from nevyn.them.org ([66.93.172.17]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1HHQTk-0003nQ-0p for qemu-devel@nongnu.org; Wed, 14 Feb 2007 15:11:48 -0500 Date: Wed, 14 Feb 2007 15:11:44 -0500 From: Daniel Jacobowitz Message-ID: <20070214201144.GA18379@caradoc.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] ARM post-decrement fix Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paul Brook I'm pretty sure that this is needed for "strd r4, [r9], -#8" to work. We start with 8, add -4 to offset for the 4 that was added (before the second 32-bit store), negate it as requested yielding -4, add it to the +4-adjusted offset, and get... net of zero. --- target-arm/translate.c (revision 163253) +++ target-arm/translate.c (local) @@ -391,9 +391,9 @@ static inline void gen_add_datah_offset( if (insn & (1 << 22)) { /* immediate */ val = (insn & 0xf) | ((insn >> 4) & 0xf0); - val += extra; if (!(insn & (1 << 23))) val = -val; + val += extra; if (val != 0) gen_op_addl_T1_im(val); } else { -- Daniel Jacobowitz CodeSourcery