Date: Wed, 11 Jul 2001 15:26:17 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: djgpp AT delorie DOT com Subject: Re: libm question In-Reply-To: <9ihc6l$ngl$1@nets3.rz.RWTH-Aachen.DE> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk 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.