qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] load-store experiment...
@ 2009-11-11  7:51 Chad
  2009-11-11 15:41 ` Laurent Desnogues
  0 siblings, 1 reply; 3+ messages in thread
From: Chad @ 2009-11-11  7:51 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1106 bytes --]

(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

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;
    }
}

[-- Attachment #2: Type: text/html, Size: 1286 bytes --]

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

end of thread, other threads:[~2009-11-12  6:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-11  7:51 [Qemu-devel] load-store experiment Chad
2009-11-11 15:41 ` Laurent Desnogues
2009-11-12  6:01   ` Chad

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