qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Desnogues <laurent.desnogues@gmail.com>
To: Chad <chad.page@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] load-store experiment...
Date: Wed, 11 Nov 2009 16:41:04 +0100	[thread overview]
Message-ID: <761ea48b0911110741u20343771of659340b837c5a05@mail.gmail.com> (raw)
In-Reply-To: <f784f5260911102351g2353d8ddj70c2cc8f49890e9b@mail.gmail.com>

On Wed, Nov 11, 2009 at 8:51 AM, Chad <chad.page@gmail.com> wrote:
> (this is mostly to get some ideas going rather than trying to get anything
> upstream... yet!)
>
> This version of tcg_out_mov for i386's tcg-target.c filters out the
>
> mov %ebx, %edx
> mov %ebx, [some index]
> mov %edx, %ebx

The question is:  what TCG sequence produces this kind of code?


Laurent

> I don't have benchmarks, but it does remove a few mov's and qemu can still
> load and run a linux kernel ;)
>
> It'd be easier to do more optimizations if qemu recorded output at the
> assembly instruction level.
>
> ---
>
> static uint8_t *lmovloc = 0;
> static int lmovret = -1, lmovarg = -1;
> static inline void tcg_out_mov(TCGContext *s, int ret, int arg)
> {
>     int ldiff, nowrite = 0;
>
>     if (arg != ret) {
>         /* Check for a mov, mov->x, mov pattern */
>         ldiff = s->code_ptr - lmovloc;
>         if (((ldiff == 8) || (ldiff == 5)) &&
>                    (*(lmovloc + 2) == 0x89) &&
>                    ((lmovret == ret) && (lmovarg == arg))) nowrite = 1;
>         /* Write */
>         lmovloc = s->code_ptr;
>         if (!nowrite) {
>                 tcg_out_modrm(s, 0x8b, ret, arg);
>         } else {
>                 qemu_log("removed\n");
>         }
>         lmovret = arg; lmovarg = ret;
>     }
> }
>

  reply	other threads:[~2009-11-11 15:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-11  7:51 [Qemu-devel] load-store experiment Chad
2009-11-11 15:41 ` Laurent Desnogues [this message]
2009-11-12  6:01   ` Chad

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=761ea48b0911110741u20343771of659340b837c5a05@mail.gmail.com \
    --to=laurent.desnogues@gmail.com \
    --cc=chad.page@gmail.com \
    --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).