From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1Auhve-0003en-HE for qemu-devel@nongnu.org; Sat, 21 Feb 2004 19:57:06 -0500 Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1Auhv5-0002ZW-TC for qemu-devel@nongnu.org; Sat, 21 Feb 2004 19:57:03 -0500 Received: from [62.210.158.41] (helo=moscou.magic.fr) by monty-python.gnu.org with esmtp (Exim 4.30) id 1Auhus-0002YW-9E for qemu-devel@nongnu.org; Sat, 21 Feb 2004 19:56:18 -0500 Received: from 10.0.0.2 (ppp-181.net-555.magic.fr [62.210.255.181]) by moscou.magic.fr (8.11.6/8.10.1) with ESMTP id i1M0u7b10062 for ; Sun, 22 Feb 2004 01:56:08 +0100 (CET) From: "J. Mayer" In-Reply-To: <1077409581.23168.8.camel@rapid> References: <4037E495.40803@wanadoo.fr> <1077409581.23168.8.camel@rapid> Content-Type: text/plain Message-Id: <1077411378.15655.11.camel@rapid> Mime-Version: 1.0 Date: Sun, 22 Feb 2004 01:56:19 +0100 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [BUG] signed 16 bits word load for bigendian targets. Reply-To: qemu-devel@nongnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org If the LSB is negative, the result is false. Here's the patch: Index: cpu-all.h =================================================================== RCS file: /cvsroot/qemu/qemu/cpu-all.h,v retrieving revision 1.20 diff -u -d -w -B -b -d -p -r1.20 cpu-all.h --- cpu-all.h 16 Feb 2004 21:57:02 -0000 1.20 +++ cpu-all.h 22 Feb 2004 00:53:28 -0000 @@ -202,7 +202,7 @@ static inline int lduw_raw(void *ptr) static inline int ldsw_raw(void *ptr) { int8_t *b = (int8_t *) ptr; - return (b[0]<<8|b[1]); + return (b[0]<<8 | (uint8_t)b[1]); } -- J. Mayer Never organized