qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] 64-bit target


From: Johan Rydberg
Subject: Re: [Qemu-devel] 64-bit target
Date: Mon, 30 Jun 2003 16:35:43 +0200

Johan Rydberg <address@hidden> wrote:

: Fabrice Bellard <address@hidden> wrote:
: 
: : You can just use two parameters and load two 32 bit values.
: 
: Declaring T0 as a long long, and trying to set it to an immediate
: value results in the following code:  Which is a bit of an overhead
: I think :)

Using an union like this;

union fast_move { struct { USI hi; USI lo; } s; UDI d; } x;

And a macro like this;

#define GET_UDI_FROM_PARAMS(p1, p2) (((union fast_move) { { (USI) p1, (USI) p2 
} }).d)

Reduces the code:

void OPPROTO
op_movdi_t0_uimm (void)
{
  T0 = GET_UDI_FROM_PARAMS (PARAM1, PARAM2);
}

To:

00000034 <op_movdi_t0_uimm>:
  34:   b8 00 00 00 00          mov    $0x0,%eax
                        35: R_386_32    __op_param1
  39:   ba 00 00 00 00          mov    $0x0,%edx
                        3a: R_386_32    __op_param2
  3e:   89 c6                   mov    %eax,%esi
  40:   89 d7                   mov    %edx,%edi

Can you figure out how to make it move to %esi and %edi directly?
I can, for one, not. 

-- 
Johan Rydberg, Free Software Developer, Sweden
http://rtmk.sf.net | http://www.nongnu.org/guss/

Playing Various Artists - Deftones / My Own Summer (Shove It)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]