From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:41432) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCbJr-0004Fq-6C for qemu-devel@nongnu.org; Fri, 14 Sep 2012 15:12:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TCbJl-0004Yj-C8 for qemu-devel@nongnu.org; Fri, 14 Sep 2012 15:12:51 -0400 Received: from v220110690675601.yourvserver.net ([78.47.199.172]:34515) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCbJl-0004Yc-5O for qemu-devel@nongnu.org; Fri, 14 Sep 2012 15:12:45 -0400 Message-ID: <505381AB.3070506@weilnetz.de> Date: Fri, 14 Sep 2012 21:12:43 +0200 From: Stefan Weil MIME-Version: 1.0 References: <1347113540-32047-1-git-send-email-sw@weilnetz.de> <1347286108.8336.6.camel@pebble.twiddle.home> In-Reply-To: <1347286108.8336.6.camel@pebble.twiddle.home> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] tci: Support deposit operations List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: qemu-devel@nongnu.org Am 10.09.2012 16:08, schrieb Richard Henderson: > On Sat, 2012-09-08 at 16:12 +0200, Stefan Weil wrote: >> + tmp16 = *tb_ptr++; >> + tmp8 = *tb_ptr++; >> + tmp32 = (((1<< tmp8) - 1)<< tmp16); >> + tci_write_reg32(t0, (t1& ~tmp32) | ((t2<< tmp16)& >> tmp32)); > > Use the deposit* functions from bitops.h? > > > r~ Well, that would justify their existence in bitops.h, wouldn't it? When I wrote deposit for TCI (November 2011), there still was no bitops.h, and I was just too lazy to modify and test the code again. Now I tested code with both my version (with a small correction for the 64 bit variant) and with the deposit* functions. Both variants give identical results. The deposit* variant creates larger (and I expect also less efficient) code. I doubt that the effect will be measurable in a system emulation. Results with 64 bit Debian Linux: my variant 6909 0 128 7037 1b7d bin/ndebug/x86-tci/i386-linux-user/tci.o 6975 0 128 7103 1bbf bin/ndebug/x86-tci/i386-softmmu/tci.o 6917 0 128 7045 1b85 bin/ndebug/x86-tci/x86_64-linux-user/tci.o 6972 0 128 7100 1bbc bin/ndebug/x86-tci/x86_64-softmmu/tci.o deposit* 6935 0 128 7063 1b97 bin/ndebug/x86-tci/i386-linux-user/tci.o 7000 0 128 7128 1bd8 bin/ndebug/x86-tci/i386-softmmu/tci.o 6963 0 128 7091 1bb3 bin/ndebug/x86-tci/x86_64-linux-user/tci.o 6997 0 128 7125 1bd5 bin/ndebug/x86-tci/x86_64-softmmu/tci.o Other emulation targets show similar differences. On a Windows host, the difference was smaller, but still in favour of my code. Regards, Stefan