diff mbox

tcg: Remove redundant declarations of TCG_TARGET_REG_BITS

Message ID 1323297106-27312-1-git-send-email-sw@weilnetz.de
State Accepted
Headers show

Commit Message

Stefan Weil Dec. 7, 2011, 10:31 p.m. UTC
TCG_TARGET_REG_BITS is declared in tcg.h for all TCG targets.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
 tcg/i386/tcg-target.h |    5 -----
 1 files changed, 0 insertions(+), 5 deletions(-)

Comments

陳韋任 Dec. 8, 2011, 7:03 a.m. UTC | #1
On Wed, Dec 07, 2011 at 11:31:46PM +0100, Stefan Weil wrote:
> TCG_TARGET_REG_BITS is declared in tcg.h for all TCG targets.

  Just want to make sure. When we talk about target in TCG, that _always_ means
the host, right?

Regards,
chenwj
Stefan Weil Dec. 8, 2011, 7:19 a.m. UTC | #2
Am 08.12.2011 08:03, schrieb 陳韋任:
> On Wed, Dec 07, 2011 at 11:31:46PM +0100, Stefan Weil wrote:
>> TCG_TARGET_REG_BITS is declared in tcg.h for all TCG targets.
>
> Just want to make sure. When we talk about target in TCG, that 
> _always_ means
> the host, right?
>
> Regards,
> chenwj

Yes. See file tcg/README which says this:

    The TCG "target" is the architecture for which we generate the
    code. It is of course not the same as the "target" of QEMU which is
    the emulated architecture. As TCG started as a generic C backend used
    for cross compiling, it is assumed that the TCG target is different
    from the host, although it is never the case for QEMU.

Regards,
Stefan Weil
Stuart Brady Dec. 8, 2011, 9:46 p.m. UTC | #3
On Thu, Dec 08, 2011 at 08:19:45AM +0100, Stefan Weil wrote:
> Am 08.12.2011 08:03, schrieb 陳韋任:
> >On Wed, Dec 07, 2011 at 11:31:46PM +0100, Stefan Weil wrote:
> >>TCG_TARGET_REG_BITS is declared in tcg.h for all TCG targets.
> >
> >Just want to make sure. When we talk about target in TCG, that
> >_always_ means
> >the host, right?
> >
> >Regards,
> >chenwj
> 
> Yes. See file tcg/README which says this:
> 
>    The TCG "target" is the architecture for which we generate the
>    code. It is of course not the same as the "target" of QEMU which is
>    the emulated architecture. As TCG started as a generic C backend used
>    for cross compiling, it is assumed that the TCG target is different
>    from the host, although it is never the case for QEMU.

... although that's no longer quite the case when using TCI, as I'm
sure you're quite well aware! :-)

I suppose when using TCI:
 * The host is system that QEMU's running on.
 * The TCG target is the TCI bytecode interpreter.
 * The QEMU target is whatever you're emulating.

... but of course, the vast majority users do not use TCI (as I think
it's mainly intended for development?), so the description in tcg/README
is correct in most cases.

I suppose it's a bit more complicated than I've described, too, since
the TCI interpreter might behave differently depending on the host that
you're running on... e.g. TCI will use the same endianness as the host.

I'm not sure if it would be worth updating tcg/README along these lines,
but the distinction between TCI and the host seems a little murky...

Cheers,
Stefan Hajnoczi Dec. 9, 2011, 10:58 a.m. UTC | #4
On Wed, Dec 07, 2011 at 11:31:46PM +0100, Stefan Weil wrote:
> TCG_TARGET_REG_BITS is declared in tcg.h for all TCG targets.
> 
> Signed-off-by: Stefan Weil <sw@weilnetz.de>
> ---
>  tcg/i386/tcg-target.h |    5 -----
>  1 files changed, 0 insertions(+), 5 deletions(-)

Thanks, applied to the trivial patches -next tree:
http://repo.or.cz/w/qemu/stefanha.git/shortlog/refs/heads/trivial-patches-next

Stefan
diff mbox

Patch

diff --git a/tcg/i386/tcg-target.h b/tcg/i386/tcg-target.h
index 7756e7b..adbb036 100644
--- a/tcg/i386/tcg-target.h
+++ b/tcg/i386/tcg-target.h
@@ -23,11 +23,6 @@ 
  */
 #define TCG_TARGET_I386 1
 
-#if defined(__x86_64__)
-# define TCG_TARGET_REG_BITS 64
-#else
-# define TCG_TARGET_REG_BITS 32
-#endif
 //#define TCG_TARGET_WORDS_BIGENDIAN
 
 #if TCG_TARGET_REG_BITS == 64