------- Comment #20 from rakdver at kam dot mff dot cuni dot cz  2007-11-08 
14:46 -------
Subject: Re:  [4.3 regression] udivdi3 counterproductive, unwarranted use

> ------- Comment #19 from manu at gcc dot gnu dot org  2007-11-08 14:22 -------
> (In reply to comment #16)
> > One possible solution would be to annotate the division by the expected 
> > value
> > of the result.  Division expanders then may decide whether to expand to 
> > machine
> > instruction/libcall or to check for small values of the result in if-guards
> > first.
> > 
> 
> Well, that won't achieve at all what the user wants, that is, to not get a 
> call
> to __udividi3. 

However, it would avoid calling the division most of the time, i.e.,
for performance this would be a possible solution.

> There are 2 issues here:
> 
> 1) GCC replaces the loop by division. This may or may not be more efficient. 
> In
> this case, it is not. In many other cases, it is.

The code performing the replacement should probably check what is the
expected # of iterations of the loop, and compute which way is more
efficient.  However, it is a bit difficult to get this work correctly.

> 2) The user does not want a call to __udividi3.

There is nothing wrong with calling __udividi3, once the division is
introduced.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32044

Reply via email to