[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [PATCH][RFC] Run time TCGv size check for debugging
From: |
Fabrice Bellard |
Subject: |
[Qemu-devel] Re: [PATCH][RFC] Run time TCGv size check for debugging |
Date: |
Wed, 29 Oct 2008 22:37:39 +0100 |
User-agent: |
Thunderbird 1.5.0.9 (X11/20070212) |
Blue Swirl wrote:
> Hi,
>
> When emulating a mixed 32/64 bit Qemu target CPUs it's easy to confuse
> the TCGv size, passing 32 bit TCGv to a function expecting a 64 bit
> one and vice versa. This patch adds a run time sanity check for TCGv
> sizes.
>
> Because a 32 bit Qemu host does not really use 64 bit TCGvs, the patch
> is only functional on a 64 bit host. Of course also a pure 32 bit Qemu
> target is not likely to suffer from TCGv size confusion.
>
> Some use cases are not covered yet. Comments?
Theses tests can be done at compile time by introducing the TCGv_i32 and
TCGv_i64 types. The same can be done with the helpers by using a few
macros to declare them.
A optional runtime check would be still useful as an additional pass
using the OP definitions to ensure that the TCG optimizations pass(es)
are OK. IMHO, doing it only in tcg_gen_xxx is not enough.
Fabrice.