This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: optimisation problem with sqrt
- To: <Sylvain dot Zimmermann at uhp dot u-nancy dot fr>
- Subject: Re: optimisation problem with sqrt
- From: "Christian Häggström" <97nv46 at skola dot kiruna dot se>
- Date: Fri, 12 May 2000 13:18:26 +0200
- Cc: <gcc at gcc dot gnu dot org>
> 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>.