11706 vs ([lno] Canonical iv creation)

Andrew Pinski pinskia@physics.uc.edu
Sun Mar 14 23:04:00 GMT 2004


On Mar 12, 2004, at 08:42, Paolo Carlini wrote:

> Hi again,
>
> finally, I have been able to actually test the the new pass on the code
> we care about. The current assembler, is simply *astonishing*.
> E.g.:
>
> double f(double a)
> {
>  return std::pow(a, 4);
> }
>
> On x86, -O2 -fomit-frame-pointer -ftree-loop-optimize 
> -fscalar-evolutions
> -funroll-loops:
>
> 00000000 <f(double)>:
>   0:   dd 44 24 04             fldl   0x4(%esp)
>   4:   d8 c8                   fmul   %st(0),%st
>   6:   d8 c8                   fmul   %st(0),%st
>   8:   c3                      ret

What is even more astonishing is this function:
double f1()
{
  return std::pow(3.0,7);
}
Before GCC would not optimize the function into just a return of a
constant, now it does.


Thanks,
Andrew Pinski



More information about the Libstdc++ mailing list