qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: malc <av1474@comtv.ru>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 0/7] tcg: conditional set and move opcodes
Date: Fri, 18 Dec 2009 08:05:57 -0800	[thread overview]
Message-ID: <4B2BA865.5010401@twiddle.net> (raw)
In-Reply-To: <Pine.LNX.4.64.0912181835500.6816@linmac.oyster.ru>

On 12/18/2009 07:40 AM, malc wrote:
> After fixing a bug (crop was done after reading the cr) i run some
> openssl speed benchmarks, and, at least here on an MPC7447A, got a
> speed degradation, tiny but consistent.

Well, you could try rendering the setcond with branches instead of 
logical operations.  You'll still gain the benefit of not having ended 
the TCG basic block, and forced the stores of globals to their slots etc 
etc.

> IN:
> 0x40082295:  movzbl (%eax),%eax
> 0x40082298:  cmp    $0x3d,%al
> 0x4008229a:  setne  %dl
> 0x4008229d:  test   %al,%al
> 0x4008229f:  je     0x400822d2
>
> OP after liveness analysis:
>   mov_i32 tmp2,eax
>   qemu_ld8u tmp0,tmp2,$0xffffffff
>   mov_i32 eax,tmp0
>   movi_i32 tmp1,$0x3d
>   mov_i32 tmp0,eax
>   nopn $0x2,$0x2
>   sub_i32 cc_dst,tmp0,tmp1
>   movi_i32 tmp13,$0xff
>   and_i32 tmp4,cc_dst,tmp13
>   movi_i32 tmp13,$0x0
>   setcond_i32 tmp0,tmp4,tmp13,ne
>   movi_i32 tmp14,$0xff
>   and_i32 tmp13,tmp0,tmp14
>
> ....
>
> OUT: [size=204]
> 0x601051b0:  lwz     r14,0(r27)
> 0x601051b4:  lbzx    r14,0,r14
> 0x601051b8:  mr      r15,r14
> 0x601051bc:  addi    r15,r15,-61
> 0x601051c0:  andi.   r15,r15,255
> 0x601051c4:  cmpwi   cr6,r15,0
> 0x601051c8:  crnot   4*cr7+eq,4*cr6+eq
> 0x601051cc:  mfcr    r0
> 0x601051d0:  rlwinm  r15,r0,31,31,31
> 0x601051d4:  andi.   r15,r15,255
>
> ...
>
> So the fact that setcond produces 0/1 was never communicated to the
> tcg, not that i would claim that it's possible at all...

It isn't.

And anyway, if you look at the opcodes generated without the setcond 
patch you'll see that and 255 in there as well.  Some more surgery on 
the i386 translator could probably get rid of that.  All I replaced were 
sequences of

   brcond c1,c2,$lab_true
   movi dest,0
   br $lab_over
   movi dest,1



r~

      reply	other threads:[~2009-12-18 16:06 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-17  1:19 [Qemu-devel] [PATCH 0/7] tcg: conditional set and move opcodes Richard Henderson
2009-12-16  0:34 ` [Qemu-devel] [PATCH 1/7] tcg: Generic support for conditional set and conditional move Richard Henderson
2009-12-16  0:35 ` [Qemu-devel] [PATCH 2/7] tcg-amd64: Implement setcond and movcond Richard Henderson
2009-12-16  0:36 ` [Qemu-devel] [PATCH 3/7] target-alpha: Use setcond/movcond in integer compares and cmoves Richard Henderson
2009-12-16 23:17 ` [Qemu-devel] [PATCH 4/7] tcg-i386: Implement setcond, movcond, setcond2 Richard Henderson
2009-12-16 23:26 ` [Qemu-devel] [PATCH 5/7] tcg-sparc: Implement setcond, movcond, setcond2, brcond2 Richard Henderson
2009-12-19 10:31   ` Blue Swirl
2009-12-19 17:47     ` Richard Henderson
2009-12-19 21:25       ` Blue Swirl
2009-12-19 22:52         ` Richard Henderson
2009-12-20 11:06           ` Blue Swirl
2009-12-16 23:28 ` [Qemu-devel] [PATCH 6/7] target-i386: Use setcond and movcond Richard Henderson
2009-12-16 23:29 ` [Qemu-devel] [PATCH 7/7] target-mips: " Richard Henderson
2009-12-17 15:32 ` [Qemu-devel] [PATCH 0/7] tcg: conditional set and move opcodes malc
2009-12-17 15:37   ` Laurent Desnogues
2009-12-17 17:07   ` Richard Henderson
2009-12-17 17:47     ` malc
2009-12-17 18:09       ` Richard Henderson
2009-12-17 17:48     ` Richard Henderson
2009-12-18 15:40     ` malc
2009-12-18 16:05       ` Richard Henderson [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=4B2BA865.5010401@twiddle.net \
    --to=rth@twiddle.net \
    --cc=av1474@comtv.ru \
    --cc=qemu-devel@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).