[Top][All Lists]

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

Re: [Lightning] About 32 and 64 bits registers

From: Paolo Bonzini
Subject: Re: [Lightning] About 32 and 64 bits registers
Date: Tue, 24 Aug 2010 08:59:48 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20100621 Fedora/3.0.5-1.fc13 Lightning/1.0b2pre Mnenhy/0.8.3 Thunderbird/3.0.5

On 08/24/2010 01:44 AM, Paulo César Pereira de Andrade wrote:
   How is it expected to handle proper sign/zero extension when there
are no named 8/16/32/64 bit registers, that is, there is no JIT_R0c,
JIT_R0s, JIT_R0i and/or JIT_R0l.

That's on purpose, RISC machines do not have that.

   This has a nasty side effect that some operations must be sign/zero
extended, for example, when loading data from a memory location. But
then, some operations become somewhat hard to explain, for example:

Loads and stores always sign/zero-extend to _l/_ul size.

   jit_bltr_i LABEL, JIT_R0, IMMEDIATE

You mean jit_blti_i.

this should be understood as "treated JIT_R0 value as 32 bits, but
signed extend it, as well as immediate" ?

Yes.  Instead, blti_ui would zero extend it.

But to do an "optimized" operation, it must ensure that JIT_R0 is
actually holding a 64 bits value.

Using _l operations for branches will usually give the fastest code.

   jit_movi_i JIT_R0 IMMEDIATE

this should be just an alias to jit_movi_l on 64 bits, or, better
saying, should be more like:

   jit_movi_i JIT_R0 (cast_to_int_32)IMMEDIATE

Yes, it should be the latter.


reply via email to

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