qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] definition of struct TCGv_i64_d


From: Peter Maydell
Subject: Re: [Qemu-devel] definition of struct TCGv_i64_d
Date: Fri, 21 Oct 2016 16:17:51 +0100

On 21 October 2016 at 15:48, Programmingkid <address@hidden> wrote:
> In the tcg.h file, there is this line: typedef struct TCGv_i64_d *TCGv_i64;
>
> Would anyone know where the definition of struct TCGv_i64_d is?

There is none, because the "pointers" in these variables are
never dereferenced. These are just magic to let us make use
of the compiler's typechecking -- the actual values in the
TCGv_i64 variables are integers (offsets into arrays describing
the temporaries inside the TCG code). The only way to create a
TCGv_i64 is with MAKE_TCGV_I64, and then you can get back to
the underlying integer (if you're code in tcg/) is with
GET_TCGV_I64.

We used to typedef TCGv_i64 &c as plain "int"s, but then the
compiler doesn't complain if you pass a TCGv_i32 to a function
expecting a TCGv_i64.

thanks
-- PMM



reply via email to

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