From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KvHYC-0003a9-F1 for qemu-devel@nongnu.org; Wed, 29 Oct 2008 16:21:56 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KvHYA-0003Zh-Jr for qemu-devel@nongnu.org; Wed, 29 Oct 2008 16:21:55 -0400 Received: from [199.232.76.173] (port=43612 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KvHYA-0003ZY-Fp for qemu-devel@nongnu.org; Wed, 29 Oct 2008 16:21:54 -0400 Received: from mail.codesourcery.com ([65.74.133.4]:39987) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KvHYA-00013f-7D for qemu-devel@nongnu.org; Wed, 29 Oct 2008 16:21:54 -0400 From: Paul Brook Subject: Re: [Qemu-devel] [PATCH][RFC] Run time TCGv size check for debugging Date: Wed, 29 Oct 2008 21:14:45 +0100 References: <200810291953.09085.paul@codesourcery.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200810292014.46351.paul@codesourcery.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: qemu-devel@nongnu.org On Wednesday 29 October 2008, Blue Swirl wrote: > On 10/29/08, Paul Brook wrote: > > On Wednesday 29 October 2008, 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. > > > > Would it make more sense to push these down into tcg_gen_op* ? > > How? At that point we don't know what was the correct size. I figure there's only a handful of different cases, so it'll be cleaner to introduce tcg_gen_op_i32_i32 etc. which trivially reduce to tcg_gen_op2 when debugging is disabled. Paul