This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix problem in fold_binary

> This is OK, but:


> > +		     /* The sign bit is under the control of the mode.  */
> > +		     && width == GET_MODE_BITSIZE (TYPE_MODE (arg1_type))
> Can you expand this comment?  If I understand this correctly, which I
> may not, I think you are trying to say something like "converting a
> type with precision smaller than the mode would require sign
> extension."

Yes, I think this is equivalent to what I meant.  I tried to (briefly) say 
that, since the transformation is a reinterpretation of the bits of arg0 for 
which the sign bit is special, we must make sure that we are speaking of the
right sign bit.  My understanding is that the transformation will ultimately 
flip the signedness of the comparison operator associated with the mode of 
arg0, so the sign bit is bit #(GET_MODE_BITSIZE (TYPE_MODE (arg1_type))-1) 
and the interesting value is 1<<(GET_MODE_BITSIZE (TYPE_MODE (arg1_type))-1)
for arg1, which happens iff width == GET_MODE_BITSIZE (TYPE_MODE (arg1_type)).

Eric Botcazou

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]