Mail Archives: djgpp/2001/03/19/02:41:31
On Sun, 18 Mar 2001, Jason Green wrote:
> "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il> wrote:
>
> > In fact, for most arguments, code produced by latest versions of GCC
> > doesn't even call the library function, it emits an FP instruction
> > that computes the square root directly.
>
> What arguments would cause the library function to be called?
Only those which cause the FSQRT instruction to produce Inf or NaN.
You can clearly see this in the code produced by GCC, if you compile a
simple C source with "gcc -S" and examine the assembly: it issues
FSQRT, and then examines the C0..C3 condition code bits in the x87
status word. If these bits say that the result is abnormal, the
library function is called to cope with the problem.
(This is one more reason why it is a good idea to mask numeric
exception in the startup code, as latest versions of DJGPP do: if you
don't do that, you will have SIGFPEs even if the library is written to
carefully avoid them.)
- Raw text -