actually sign-extending CONST_INTs in expand_binop

Alexandre Oliva aoliva@redhat.com
Tue Apr 24 06:42:00 GMT 2001


On Apr 24, 2001, Joern Rennecke <amylaar@redhat.com> wrote:

>> On Apr 24, 2001, Joern Rennecke <amylaar@cambridge.redhat.com> wrote:
>> 
>> > ! 	 When we have an extending integer operation, e.g. umulhisi,
>> > ! 	 we have to pass MODE (which is wider) as the previous mode.
>> 
>> Why?  Aren't the operands supposed to be valid HImode values already?

> They were originally used in a SImode multiply.

Ok, I see what you're getting at.  But I don't think your patch is
correct.  It will indeed do the narrowing conversion from SImode to
HImode you need in this case, but it won't do a widening conversion
that may be needed in certain cases.

I think the safest approach here is to take the widest mode among
mode0 and mode for op0's oldmode.  Similarly for op1, unless shift_op
is non-zero, in which case mode1 is probably as good as it gets.

> I was thinking about stuff like floatsisf.  Well, that's not
> actually a binary operator.  Don't know if there is one that
> fulfills these conditons.

Yep.  When I introduced the patch, I couldn't find any, so I went
ahead with that.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me



More information about the Gcc-patches mailing list