Integer constant multiplication on Alpha
Jan Hubicka
jh@suse.cz
Thu Dec 20 09:09:00 GMT 2001
> Hi,
>
> I noticed gcc optimizes multiplications with integers quite good,
> which is nice, but I have a few questions :)
>
> * Where in the code does this happen? I looked quite hard, but
> couldn't find it.
See expand_mult in expemed.c
>
> * Why isn't this disabled on -Os?
It is bit dificult to judge when it expands code. For instance i386 do
have shorter shift/add instructions that mult. Backend needs to assist
and modify RTX_COST accordingly. See i386 how this can be done.
> Also gcc 3.0 introduces a redundant mov:
>
> mov $16,$1
> s4subq $1,$1,$2
> addq $2,$2,$1
> addl $1,$31,$0
> ret $31,($26),1
I do have patch for elliminating this mov somewhere in the queue, but it
never got reviewed.
Our copy propagation pass should be able to elliminate it, but unfortunately
it isn't.
Honza
>
> where could I look to check where this comes from?
>
> Falk
More information about the Gcc
mailing list