qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 00/16] minially change gen_intermediate_code_internal function
@ 2013-04-11  3:41 li guang
  2013-04-11  5:42 ` li guang
  2013-04-11  8:20 ` Peter Maydell
  0 siblings, 2 replies; 3+ messages in thread
From: li guang @ 2013-04-11  3:41 UTC (permalink / raw)
  To: qemu-devel

here are instructions in the finial qemu-system-x86
before and after my chanage, you can easily find a 
redundant 'addl' was removed

this patch-set is v2 of previous 'translate: cleanup
gen_intermediate_code_internal patch'

v2: Keep variable 'num_insns' initailization
    spotted by 	陳韋任 (Wei-Ren Chen) <chenwj@iis.sinica.edu.tw>


before change:

  38c415:       3b 45 d4                cmp    -0x2c(%ebp),%eax
  38c418:       7d 23                   jge    38c43d
<gen_intermediate_code_internal+0x58f>
------------------------------------------------------------------
  38c41a:       83 45 d0 01             addl   $0x1,-0x30(%ebp) 
------------------------------------------------------------------
  38c41e:       eb 15                   jmp    38c435
<gen_intermediate_code_internal+0x587>
  38c420:       8b 45 d0                mov    -0x30(%ebp),%eax
  38c423:       8b 93 48 15 00 00       mov    0x1548(%ebx),%edx
  38c429:       c6 84 02 a8 0e 01 00    movb   $0x0,0x10ea8(%edx,%eax,1)
  38c430:       00 
  38c431:       83 45 d0 01             addl   $0x1,-0x30(%ebp)
  38c435:       8b 45 d0                mov    -0x30(%ebp),%eax
  38c438:       3b 45 d4                cmp    -0x2c(%ebp),%eax
  38c43b:       7c e3                   jl     38c420
<gen_intermediate_code_internal+0x572>


after change:

  38c415:       3b 45 d4                cmp    -0x2c(%ebp),%eax
  38c418:       7d 1f                   jge    38c439
<gen_intermediate_code_internal+0x58b>
  38c41a:       eb 11                   jmp    38c42d
<gen_intermediate_code_internal+0x57f>
  38c41c:       8b 45 d0                mov    -0x30(%ebp),%eax
  38c41f:       8b 93 48 15 00 00       mov    0x1548(%ebx),%edx
  38c425:       c6 84 02 a8 0e 01 00    movb   $0x0,0x10ea8(%edx,%eax,1)
  38c42c:       00 
  38c42d:       83 45 d0 01             addl   $0x1,-0x30(%ebp)
  38c431:       8b 45 d0                mov    -0x30(%ebp),%eax
  38c434:       3b 45 d4                cmp    -0x2c(%ebp),%eax
  38c437:       7c e3                   jl     38c41c
<gen_intermediate_code_internal+0x56e>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH 00/16] minially change gen_intermediate_code_internal function
  2013-04-11  3:41 [Qemu-devel] [PATCH 00/16] minially change gen_intermediate_code_internal function li guang
@ 2013-04-11  5:42 ` li guang
  2013-04-11  8:20 ` Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: li guang @ 2013-04-11  5:42 UTC (permalink / raw)
  To: qemu-devel

Oh, sorry,
minially -> minimally 

在 2013-04-11四的 11:41 +0800,li guang写道:
> here are instructions in the finial qemu-system-x86
> before and after my chanage, you can easily find a 
> redundant 'addl' was removed
> 
> this patch-set is v2 of previous 'translate: cleanup
> gen_intermediate_code_internal patch'
> 
> v2: Keep variable 'num_insns' initailization
>     spotted by 	陳韋任 (Wei-Ren Chen) <chenwj@iis.sinica.edu.tw>
> 
> 
> before change:
> 
>   38c415:       3b 45 d4                cmp    -0x2c(%ebp),%eax
>   38c418:       7d 23                   jge    38c43d
> <gen_intermediate_code_internal+0x58f>
> ------------------------------------------------------------------
>   38c41a:       83 45 d0 01             addl   $0x1,-0x30(%ebp) 
> ------------------------------------------------------------------
>   38c41e:       eb 15                   jmp    38c435
> <gen_intermediate_code_internal+0x587>
>   38c420:       8b 45 d0                mov    -0x30(%ebp),%eax
>   38c423:       8b 93 48 15 00 00       mov    0x1548(%ebx),%edx
>   38c429:       c6 84 02 a8 0e 01 00    movb   $0x0,0x10ea8(%edx,%eax,1)
>   38c430:       00 
>   38c431:       83 45 d0 01             addl   $0x1,-0x30(%ebp)
>   38c435:       8b 45 d0                mov    -0x30(%ebp),%eax
>   38c438:       3b 45 d4                cmp    -0x2c(%ebp),%eax
>   38c43b:       7c e3                   jl     38c420
> <gen_intermediate_code_internal+0x572>
> 
> 
> after change:
> 
>   38c415:       3b 45 d4                cmp    -0x2c(%ebp),%eax
>   38c418:       7d 1f                   jge    38c439
> <gen_intermediate_code_internal+0x58b>
>   38c41a:       eb 11                   jmp    38c42d
> <gen_intermediate_code_internal+0x57f>
>   38c41c:       8b 45 d0                mov    -0x30(%ebp),%eax
>   38c41f:       8b 93 48 15 00 00       mov    0x1548(%ebx),%edx
>   38c425:       c6 84 02 a8 0e 01 00    movb   $0x0,0x10ea8(%edx,%eax,1)
>   38c42c:       00 
>   38c42d:       83 45 d0 01             addl   $0x1,-0x30(%ebp)
>   38c431:       8b 45 d0                mov    -0x30(%ebp),%eax
>   38c434:       3b 45 d4                cmp    -0x2c(%ebp),%eax
>   38c437:       7c e3                   jl     38c41c
> <gen_intermediate_code_internal+0x56e>
> 
> 
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH 00/16] minially change gen_intermediate_code_internal function
  2013-04-11  3:41 [Qemu-devel] [PATCH 00/16] minially change gen_intermediate_code_internal function li guang
  2013-04-11  5:42 ` li guang
@ 2013-04-11  8:20 ` Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2013-04-11  8:20 UTC (permalink / raw)
  To: li guang; +Cc: qemu-devel

On 11 April 2013 04:41, li guang <lig.fnst@cn.fujitsu.com> wrote:
> here are instructions in the finial qemu-system-x86
> before and after my chanage, you can easily find a
> redundant 'addl' was removed

Yes, but:
 * the removed instruction is not inside the loop
 * the entire loop is not in a speed critical path
 * removing an addl will save a cycle or two
 * the specific syntax used for this loop is far from
   the hardest barrier to understanding what the search_pc
   code is actually doing

Is it really worth the code churn?

It would be more interesting to find a better interface
between the common parts of QEMU and the target code
so that there's less repetition in these target functions
in the first place.

thanks
-- PMM

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-04-11  8:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-11  3:41 [Qemu-devel] [PATCH 00/16] minially change gen_intermediate_code_internal function li guang
2013-04-11  5:42 ` li guang
2013-04-11  8:20 ` Peter Maydell

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).