From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IsjAo-0008US-Ps for qemu-devel@nongnu.org; Thu, 15 Nov 2007 13:10:42 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IsjAo-0008U5-4g for qemu-devel@nongnu.org; Thu, 15 Nov 2007 13:10:42 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IsjAn-0008Tz-U4 for qemu-devel@nongnu.org; Thu, 15 Nov 2007 13:10:41 -0500 Received: from nf-out-0910.google.com ([64.233.182.184]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IsjAn-0006Cb-9c for qemu-devel@nongnu.org; Thu, 15 Nov 2007 13:10:41 -0500 Received: by nf-out-0910.google.com with SMTP id 30so589213nfu for ; Thu, 15 Nov 2007 10:10:40 -0800 (PST) Message-ID: Date: Thu, 15 Nov 2007 20:10:39 +0200 From: "Blue Swirl" Subject: Re: [Qemu-devel] [RFC][PATCH] fix sparc32 mxcc 64 bit read word order In-Reply-To: <473C4027.3030608@earthlink.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <473C4027.3030608@earthlink.net> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On 11/15/07, Robert Reif wrote: > This patch fixes the word order for 64 bit reads of the mxcc registers. > > It returns the high 32 bits in ret and the lower 32 bits in T0 just > like other places in the same function. > > T0 is defined as: register uint32_t T0 asm(AREG1); > > T0 on my machine has a sizeof = 4. Because of this, I don't think > it is necessary to mask off the high bits with 0xffffffff like other > places in the same function. You should probably use 0xffffffffULL to > mask off the upper 32 bits. > > I would remove the & 0xffffffff but I hesitate because T0 is defined > "register" uint32_t and I'm not sure what that would really be on 64 > bit machines, On my x86_64 sizeof(T0) is also 4. Only if I replace uint32_t with long or uint64_t the size becomes 8, with short the size is 2. > Is this patch correct or should I remove the & 0xffffffff here and in > the other > places in the same function or change them to 0xffffffffULL? I think it's better to remove them, preferably with a different patch without other changes.