This is the mail archive of the gcc@gcc.gnu.org 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: Integer constant multiplication on Alpha


> 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


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