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]

Re: optimisation problem with sqrt


> for (i = 0; i < 200000000; ++i) x = sqrt(2.0);

> when asking for assembler output, the instruction 'fsqrt' always appears
> (Even on my PIII 600).  That's why I'm very puzzled.

The 'sqrt' function is designed to take a non-constant argument.
Prefer use M_SQRT_2 or similar for constants, defined in <math.h>.


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