delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/07/11/08:25:49

Date: Wed, 11 Jul 2001 15:26:17 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
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: <Pine.SUN.3.91.1010711152342.5072B-100000@is>
MIME-Version: 1.0
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

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019