From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17089 invoked by alias); 6 Aug 2007 19:56:25 -0000 Received: (qmail 17001 invoked by uid 22791); 6 Aug 2007 19:56:24 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 06 Aug 2007 19:56:22 +0000 Received: (qmail 28770 invoked from network); 6 Aug 2007 19:56:20 -0000 Received: from unknown (HELO ?192.168.0.3?) (mitchell@127.0.0.2) by mail.codesourcery.com with ESMTPA; 6 Aug 2007 19:56:20 -0000 Message-ID: <46B77CD9.4070107@codesourcery.com> Date: Mon, 06 Aug 2007 19:56:00 -0000 From: Mark Mitchell User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: Nigel Stephens CC: "Fu, Chao-Ying" , gcc-patches@gcc.gnu.org, "Thekkath, Radhika" Subject: Re: [ping][patch] Fixed-point patch 2/10 References: <3CB54817FDF733459B230DD27C690CEC03EE8EFD@Exchange.mips.com> <46B76391.5090708@codesourcery.com> <46B772CD.3000904@mips.com> In-Reply-To: <46B772CD.3000904@mips.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2007-08/txt/msg00386.txt.bz2 Nigel Stephens wrote: > > > Mark Mitchell wrote: >> Fu, Chao-Ying wrote: >> >> >>> Ex 2: (A and B are negative. ) >>> A.high = 0xffffffffffffffff and A.low = 0x8000000000000000 >>> B.high = 0xffffffffffffffff and B.low = 0x0000000000000001 >>> => A > B, because A.high == B.high and >>> (unsigned HOST_WIDE_INT) a.low > (unsigned HOST_WIDE_INT) b.low >>> >> >> Yes, I see; two's complement is set up so that after masking the sign >> bit, you can do an unsigned compare. Thank you for explaining. >> > > Since double_int is already declared with low unsigned, like this: > > typedef struct > { > unsigned HOST_WIDE_INT low; > HOST_WIDE_INT high; > } double_int; > > > Would it be more obvious to simply remove the casts altogether, e.g. There's a comment in double-int.h that suggests that the signedness of low/high is historical and subject to change. So, I think the casts are OK -- but I think omitting them is also OK. Chao-Ying, you may decide that as you please. Thanks, -- Mark Mitchell CodeSourcery mark@codesourcery.com (650) 331-3385 x713