From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HGHSN-0005nZ-P9 for qemu-devel@nongnu.org; Sun, 11 Feb 2007 11:21:39 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HGHSM-0005mW-7O for qemu-devel@nongnu.org; Sun, 11 Feb 2007 11:21:39 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HGHSL-0005mI-OO for qemu-devel@nongnu.org; Sun, 11 Feb 2007 11:21:37 -0500 Received: from smtpout0139.sc1.he.tucows.com ([64.97.136.139] helo=n066.sc1.he.tucows.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1HGHSL-0002vU-Ei for qemu-devel@nongnu.org; Sun, 11 Feb 2007 11:21:37 -0500 Received: from [192.168.0.12] (81.107.204.70) by n066.sc1.he.tucows.com (7.2.069.1) (authenticated as matthew.howkins@virgin.net) id 45CB412C00026251 for qemu-devel@nongnu.org; Sun, 11 Feb 2007 16:21:30 +0000 From: Matthew Howkins Content-Type: multipart/mixed; boundary="=-6UP+j1e8L3jKkWU8B+7t" Date: Sun, 11 Feb 2007 16:21:05 +0000 Message-Id: <1171210865.20672.12.camel@localhost> Mime-Version: 1.0 Subject: [Qemu-devel] [PATCH] [ARM] Fix C-flag for ASR when shift==0 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 --=-6UP+j1e8L3jKkWU8B+7t Content-Type: text/plain Content-Transfer-Encoding: 7bit There is a bug in the ARM emulation of data-processing instructions with ASR when the shift==0. The current QEMU CVS incorrectly modifies the C-flag, when it should be preserved. The attached patch corrects this. Matthew --=-6UP+j1e8L3jKkWU8B+7t Content-Disposition: attachment; filename=qemu_arm_asr_reg.patch Content-Type: text/x-patch; name=qemu_arm_asr_reg.patch; charset=UTF-8 Content-Transfer-Encoding: 7bit Index: target-arm/op.c =================================================================== RCS file: /sources/qemu/qemu/target-arm/op.c,v retrieving revision 1.21 diff -u -r1.21 op.c --- target-arm/op.c 26 Jun 2006 19:55:19 -0000 1.21 +++ target-arm/op.c 11 Feb 2007 16:08:22 -0000 @@ -667,7 +667,7 @@ if (shift >= 32) { env->CF = (T1 >> 31) & 1; T1 = (int32_t)T1 >> 31; - } else { + } else if (shift != 0) { env->CF = (T1 >> (shift - 1)) & 1; T1 = (int32_t)T1 >> shift; } --=-6UP+j1e8L3jKkWU8B+7t--