From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43601) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDbNJ-0007z0-7u for qemu-devel@nongnu.org; Fri, 30 Mar 2012 08:56:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SDbNH-0001UH-Jx for qemu-devel@nongnu.org; Fri, 30 Mar 2012 08:56:16 -0400 Received: from mail-gx0-f173.google.com ([209.85.161.173]:48214) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDbNH-0001U7-Ba for qemu-devel@nongnu.org; Fri, 30 Mar 2012 08:56:15 -0400 Received: by ggnp2 with SMTP id p2so349360ggn.4 for ; Fri, 30 Mar 2012 05:56:13 -0700 (PDT) Sender: Richard Henderson Message-ID: <4F75AD6A.2050006@twiddle.net> Date: Fri, 30 Mar 2012 08:56:10 -0400 From: Richard Henderson MIME-Version: 1.0 References: <1333077432-22228-1-git-send-email-proljc@gmail.com> <4F759C0E.3000606@twiddle.net> In-Reply-To: <4F759C0E.3000606@twiddle.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH V4 00/11] Qemu MIPS ASE DSP Support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jia Liu Cc: qemu-devel@nongnu.org, aurelien@aurel32.net On 03/30/2012 07:42 AM, Richard Henderson wrote: > All of your helpers, whereever they receive or return a register value, need to use > type target_ulong and the DEF_HELPER lines need to use "tl". All of the mips32 > helpers you've written so far that return values need to make sure to sign-extend > their results from 32-bits. Hmm, actually I wonder if that's the best advice. It looks like your translated code isn't going to work well with r0. I suspect it would be better to add a gen_load_gpr32 function for the translator that (1) sets 0 for r0, (2a) copies the register for mips32, and (2b) truncates the register for mips64. That way 32-bit hosts do not need to use 64-bit arithmetic when unnecessary. You'd need a gen_store_gpr32 function as well, which for mips64 sign-extends the value. r~