All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: "Edgar E.Iglesias" <edgar.iglesias@gmail.com>
Cc: qemu-devel@nongnu.org, aurelien@aurel32.net,
	Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH 5/7] tcg-i386: Implement deposit operation.
Date: Wed, 26 Jan 2011 10:23:04 +0100	[thread overview]
Message-ID: <CB925427-781D-4117-804A-B705B322397E@suse.de> (raw)
In-Reply-To: <20110126085338.GA26088@laped.lan>


On 26.01.2011, at 09:53, Edgar E. Iglesias wrote:

> On Tue, Jan 25, 2011 at 02:07:15PM -0800, Richard Henderson wrote:
>> On 01/25/2011 08:48 AM, Edgar E. Iglesias wrote:
>>> OK, I see. Maybe we should try to emit an insn sequence more similar
>>> to what tcg was emitting (for the non 8 & 16-bit deposits)?
>>> That ought too at least give similar results as before for those and
>>> give us a speedup for the byte and word moves.
>> 
>> Please try this replacement version for tcg/i386/*.
>> 
>> I was able to run your cris testsuite, and stuff looked ok there.
>> But for some reason the microblaze kernel would not boot.  It seems
>> that the kernel commandline isn't in place properly and it isn't 
>> finding the disk image.
> 
> Yes, you need to build qemu with libfdt for that image to boot.
> IIRC, libfdt comes with the dtc package on some dists. In the future
> I'll see if can upload an image that boots without the need of
> devicetree manipulation in qemu.
> 
> I tried your new patch and got similar results as before. Maaybe slightly
> faster but within the noise.
> 
> I looked a little bit more at it and realized that I'm probably not doing
> a fair comparition with microblaze. The write_carry sequence actually
> bit deposits a bit into two locations with a sequence of tcg ops that
> is not much longer than the one to deposit a single bit. So I'm basically
> comparing the cost of a single tcg deposit sequence with the cost of two
> tcg deposit backend ops. I should probably just accept that the new
> deposit op is not worth using for that particular case.
> 
> It would be nice if somebody else also tested this patch. Before we
> agree on applying it.
> 
> One note, the tcg_scratch_alloc hunk from the previous version was
> missing on this one.

I'm using the deposit instruction on S/390 with the implementation patch for x86 where it appears to not improve performance:

Booting into initrd shell:

3.53s  w/ x86 deposit patch 
3.52s  w/o x86 deposit patch


But maybe this is the same problem as with the shift opcode that was reported earlier in the thread:

agraf@toonie:/studio/s390/qemu-s390> grep deposit target-s390x/translate.c 
    tcg_gen_deposit_i64(regs[reg], regs[reg], tmp, 0, 32);
    tcg_gen_deposit_i64(regs[reg], regs[reg], v, 0, 32);
    tcg_gen_deposit_i64(regs[reg], regs[reg], tmp, 0, 16);
    tcg_gen_deposit_i64(regs[reg], regs[reg], v, 0, 8);
        tcg_gen_deposit_i64(regs[r1], regs[r1], tmp, 48, 16);
        tcg_gen_deposit_i64(regs[r1], regs[r1], tmp, 32, 16);

The 0, 32 and 0, 16 versions should get accelerated pretty well while the 32, 16 and 48, 16 are not I assume?

I'm not saying that the deposit instruction doesn't make sense btw. Code cleanup wise it was awesome - 10 lines of tcg combined into a single call :). Maybe a simple andi and ori emission for unknown masks might make more sense though?


Alex

  reply	other threads:[~2011-01-26  9:23 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-11  3:23 [Qemu-devel] [PATCH 0/7] Define "deposit" tcg operation, v2 Richard Henderson
2011-01-11  3:23 ` [Qemu-devel] [PATCH 1/7] tcg: Define "deposit" as an optional operation Richard Henderson
2011-01-11 23:45   ` Aurelien Jarno
2011-01-12 11:00   ` Edgar E. Iglesias
2011-01-11  3:23 ` [Qemu-devel] [PATCH 2/7] tcg-ppc: Implement deposit operation Richard Henderson
2011-01-11 12:40   ` [Qemu-devel] " malc
2011-01-11 16:32     ` Richard Henderson
2011-01-11 19:11       ` malc
2011-01-11  3:23 ` [Qemu-devel] [PATCH 3/7] tcg-hppa: " Richard Henderson
2011-01-11  3:23 ` [Qemu-devel] [PATCH 4/7] tcg-ia64: " Richard Henderson
2011-01-11  3:23 ` [Qemu-devel] [PATCH 5/7] tcg-i386: " Richard Henderson
2011-01-25 12:27   ` Edgar E. Iglesias
2011-01-25 16:13     ` Richard Henderson
2011-01-25 16:48       ` Edgar E. Iglesias
2011-01-25 22:07         ` Richard Henderson
2011-01-26  8:53           ` Edgar E. Iglesias
2011-01-26  9:23             ` Alexander Graf [this message]
2011-01-26 15:50               ` Richard Henderson
2011-01-26 16:00                 ` Alexander Graf
2011-01-26 16:34                   ` Avi Kivity
2011-01-26 16:40                   ` Richard Henderson
2011-01-26 16:50                     ` Alexander Graf
2011-01-26 18:21                       ` Richard Henderson
2011-01-26 18:27                         ` Alexander Graf
2011-01-26 18:55                           ` Richard Henderson
2011-01-26 19:01                             ` Alexander Graf
2011-01-26 19:05                               ` Richard Henderson
2011-01-26 19:09                                 ` Alexander Graf
2011-01-26 19:19                                   ` Richard Henderson
2011-01-26 19:27                                     ` Alexander Graf
2011-01-31  8:33     ` Aurelien Jarno
2011-02-08 18:05       ` Richard Henderson
2011-02-09  7:41         ` [Qemu-devel] " Paolo Bonzini
2011-02-09 17:24           ` Blue Swirl
2011-01-11  3:23 ` [Qemu-devel] [PATCH 6/7] target-i386: Use " Richard Henderson
2011-01-12 11:01   ` Edgar E. Iglesias
2011-01-20 11:06   ` Aurelien Jarno
2011-01-11  3:23 ` [Qemu-devel] [PATCH 7/7] target-ppc: " Richard Henderson
2011-01-11 23:45 ` [Qemu-devel] [PATCH 0/7] Define "deposit" tcg operation, v2 Aurelien Jarno
2011-01-20 11:31 ` Edgar E. Iglesias
  -- strict thread matches above, loose matches on Subject: below --
2011-01-07 22:42 [Qemu-devel] [PATCH 0/7] Define "deposit" tcg operation Richard Henderson
2011-01-07 22:43 ` [Qemu-devel] [PATCH 5/7] tcg-i386: Implement deposit operation Richard Henderson

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=CB925427-781D-4117-804A-B705B322397E@suse.de \
    --to=agraf@suse.de \
    --cc=aurelien@aurel32.net \
    --cc=edgar.iglesias@gmail.com \
    --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.