From: Stefan Weil <sw@weilnetz.de>
To: Richard Henderson <rth@twiddle.net>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] tci: Support deposit operations
Date: Fri, 14 Sep 2012 21:12:43 +0200 [thread overview]
Message-ID: <505381AB.3070506@weilnetz.de> (raw)
In-Reply-To: <1347286108.8336.6.camel@pebble.twiddle.home>
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
prev parent reply other threads:[~2012-09-14 19:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-08 14:12 [Qemu-devel] [PATCH] tci: Support deposit operations Stefan Weil
2012-09-10 14:08 ` Richard Henderson
2012-09-14 19:12 ` Stefan Weil [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=505381AB.3070506@weilnetz.de \
--to=sw@weilnetz.de \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.