From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IlmQL-00018v-8v for qemu-devel@nongnu.org; Sat, 27 Oct 2007 10:14:01 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IlmQI-00011a-Cr for qemu-devel@nongnu.org; Sat, 27 Oct 2007 10:14:00 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IlmQI-00011D-2Q for qemu-devel@nongnu.org; Sat, 27 Oct 2007 10:13:58 -0400 Received: from honiara.magic.fr ([195.154.193.36]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IlmQH-000646-Qa for qemu-devel@nongnu.org; Sat, 27 Oct 2007 10:13:58 -0400 Subject: Re: [Qemu-devel] Mips 64 emulation not compiling From: "J. Mayer" In-Reply-To: <47233CA5.3070509@brainaid.de> References: <1193222474.16781.236.camel@rapid> <20071027111939.GH29176@networkno.de> <1193487891.16781.280.camel@rapid> <47233CA5.3070509@brainaid.de> Content-Type: text/plain Date: Sat, 27 Oct 2007 16:12:50 +0200 Message-Id: <1193494370.16781.308.camel@rapid> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit 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: Blue Swirl , Christian Eddie Dost On Sat, 2007-10-27 at 15:27 +0200, Christian "Eddie" Dost wrote: > The sparc64 popc works in O(lg(n)) No, it has a fix cost, whatever the operand is. It has another advantage: it does not need any intermediate variable, which is great when running on CISC host in the Qemu execution environmnent. > , the "optimized" code below work in > O(n). Yes. But it's false.... It shoudl be val &= val - 1 instead of val ^= val - 1... [...] I did tests on my PC, which will imho close the debate: the Sparc implementation is at least 50 % faster. I did generate 2 ^ 29 random numbers to achieve this test (and checked that the repartition was OK). -- J. Mayer Never organized