Mail Archives: djgpp/2001/07/11/08:25:49
On 11 Jul 2001, Hans-Bernhard Broeker wrote:
> > Not only that, but when I disassembled it with gdb, the _sin
> > function wasn't the one in libm, it actually used the fsin
> > instruction!
>
> That's because gcc itself has a builtin implementation of sin(), IIRC.
Actually, GCC emits code which calls the FSIN instruction, and if the x87
status indicates the instruction produced an abnormal result, it calls
the library function, to handle the abnormal case. That's because GCC
cannot possibly know what does the library do in abnormal cases; it's
entirely up to the library implementation, run-time environment, etc.
Some of them call special callbacks, such as `matherr', for example.
- Raw text -