From: Mark Mitchell <mark@codesourcery.com>
To: Nigel Stephens <nigel@mips.com>
Cc: "Fu, Chao-Ying" <fu@mips.com>,
gcc-patches@gcc.gnu.org, "Thekkath,
Radhika" <radhika@mips.com>
Subject: Re: [ping][patch] Fixed-point patch 2/10
Date: Mon, 06 Aug 2007 19:56:00 -0000 [thread overview]
Message-ID: <46B77CD9.4070107@codesourcery.com> (raw)
In-Reply-To: <46B772CD.3000904@mips.com>
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
next prev parent reply other threads:[~2007-08-06 19:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-01 23:24 Fu, Chao-Ying
2007-08-06 3:50 ` Mark Mitchell
2007-08-06 17:35 ` Fu, Chao-Ying
2007-08-06 18:08 ` Mark Mitchell
2007-08-06 19:17 ` Nigel Stephens
2007-08-06 19:56 ` Mark Mitchell [this message]
2007-08-06 22:04 ` Fu, Chao-Ying
2007-08-06 23:20 ` Fu, Chao-Ying
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46B77CD9.4070107@codesourcery.com \
--to=mark@codesourcery.com \
--cc=fu@mips.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=nigel@mips.com \
--cc=radhika@mips.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).