[Top][All Lists]

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

Re: [Qemu-devel] qemu hw/mips_r4k.c target-mips/cpu.h target-mip...

From: Thiemo Seufer
Subject: Re: [Qemu-devel] qemu hw/mips_r4k.c target-mips/cpu.h target-mip...
Date: Thu, 21 Dec 2006 15:27:33 +0000
User-agent: Mutt/1.5.13 (2006-08-11)

André Braga wrote:
> On 12/21/06, Thiemo Seufer <address@hidden> wrote:
> >Fabrice Bellard wrote:
> >> You should suppress the SIGN_EXTEND32() macro and just use an 'int32_t'
> >> cast...
> >
> >Then it may not work. A MIPS64 CPU requires properly sign-extended
> >32bit values. Host architectures can define either sign- or zero-
> >Extension for 32bit values in 64bit Registers.
> Whether or not it works, GCC *WILL* optimize it away as a redundant
> statement,

Only iff it is redundant, which is what we want to achieve.

> if it deems so (i.e., if it's called with some flag that
> enables cse/gcse and peephole optimizations, and the variable(s) in
> question is(are) not declared volatile).

Currently it appears to work as is. Given that the CPU env is a global
it is unlikely gcc can use fancy optimizations. When compiling with
-combine we may need to declare the emulated machine registers volatile.

> IMHO macros like these SHOULD stay, as they are mostly innocuous and
> happen to document the target machine behaviour.

I disagree, it clutters the source more, and a cast provides the same


reply via email to

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