From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38625) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cAF6C-0007Y4-Lo for qemu-devel@nongnu.org; Fri, 25 Nov 2016 06:55:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cAF6B-0007vl-Hq for qemu-devel@nongnu.org; Fri, 25 Nov 2016 06:55:24 -0500 Received: from mail-oi0-x243.google.com ([2607:f8b0:4003:c06::243]:36016) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cAF6B-0007v1-D4 for qemu-devel@nongnu.org; Fri, 25 Nov 2016 06:55:23 -0500 Received: by mail-oi0-x243.google.com with SMTP id u15so4725939oie.3 for ; Fri, 25 Nov 2016 03:55:23 -0800 (PST) Sender: Richard Henderson References: <1480044704-5805-1-git-send-email-jinguojie@loongson.cn> <1480044704-5805-11-git-send-email-jinguojie@loongson.cn> From: Richard Henderson Message-ID: <8edc4125-bf29-5210-9543-d1881d0ac07d@twiddle.net> Date: Fri, 25 Nov 2016 12:55:16 +0100 MIME-Version: 1.0 In-Reply-To: <1480044704-5805-11-git-send-email-jinguojie@loongson.cn> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 10/11] tcg-mips: Adjust qemu_ld/st for mips64 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jin Guojie , qemu-devel@nongnu.org Cc: Aurelien Jarno , James Hogan On 11/25/2016 04:31 AM, Jin Guojie wrote: > -#define LO_OFF (MIPS_BE * 4) > -#define HI_OFF (4 - LO_OFF) > +# define LO_OFF (MIPS_BE * sizeof(long)) > +# define HI_OFF (sizeof(long) - LO_OFF) For n32, sizeof(long) == 4, and for n64, sizeof(long) == 8. So in the end this change must be wrong for big-endian. Surely using link_error, as my patch did, to assert at compile-time that these values were never used for TCG_TARGET_REGS == 64 is better. r~