[ping][patch] Fixed-point patch 2/10

Fu, Chao-Ying fu@mips.com
Mon Aug 6 22:04:00 GMT 2007


Mark Mitchell wrote:
> 
> 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.
> 
 
  Ok. I will omit them.  Thanks!

Regards,
Chao-ying



More information about the Gcc-patches mailing list