qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 08/12] TCG/PPC: use TCG_REG_CALL_STACK instead o


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH 08/12] TCG/PPC: use TCG_REG_CALL_STACK instead of TCG_REG_R1
Date: Sat, 2 Jul 2011 12:02:47 +0200

Am 02.07.2011 um 11:04 schrieb Blue Swirl:

On Sat, Jul 2, 2011 at 12:06 AM, malc <address@hidden> wrote:
On Sat, 2 Jul 2011, Blue Swirl wrote:

On Tue, Jun 28, 2011 at 1:51 AM, malc <address@hidden> wrote:
On Sun, 26 Jun 2011, Blue Swirl wrote:

Use TCG_REG_CALL_STACK instead of TCG_REG_R1 etc. for consistency.


This i'd rather avoid.

Why? In addition to the consistency among targets, a magic constant is
replaced with a symbol which improves the documenting abilities and
readability of the code.

Makes it harder to read for me personally.

What about other people reading the code? With TCG_REG_CALL_STACK it's
pretty clear what is the purpose of the register, with '1' it is
assumed that the reader happens to know it. I don't think the exact
value is so interesting, or is register 1 somehow different from
others?

I second malc's notion. This is ppc-specific code, and GPR1 (r1) is the designated stack pointer, that has nothing to do with TCG. Using some generic TCG define hides from the reader which reg is being used, potentially leading to nonsensical moves from r1 to TCG_... or vice versa.

If we do want a define, I would suggest something ppc-specific like r1 or sp.

Andreas



reply via email to

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