This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: actually sign-extending CONST_INTs in expand_binop
- To: Joern Rennecke <amylaar at redhat dot com>
- Subject: Re: actually sign-extending CONST_INTs in expand_binop
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 24 Apr 2001 10:42:21 -0300
- Cc: amylaar at cambridge dot redhat dot com (Joern Rennecke), gcc-patches at gcc dot gnu dot org
- Organization: GCC Team, Red Hat
- References: <200104241237.f3OCbhu24223@phal.cambridge.redhat.com>
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