From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Eli Zaretskii" Newsgroups: gmane.emacs.devel Subject: Re: (elisp)Numbers Date: Wed, 22 Oct 2003 17:42:39 +0200 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <9743-Wed22Oct2003174239+0200-eliz@elta.co.il> References: <200310210229.h9L2TGl12085@raven.dms.auburn.edu> Reply-To: Eli Zaretskii NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1066838318 13018 80.91.224.253 (22 Oct 2003 15:58:38 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 22 Oct 2003 15:58:38 +0000 (UTC) Cc: teirllm@dms.auburn.edu, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Wed Oct 22 17:58:35 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1ACLNb-0002XW-00 for ; Wed, 22 Oct 2003 17:58:35 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1ACLNb-0006fn-00 for ; Wed, 22 Oct 2003 17:58:35 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1ACLGl-00019s-7t for emacs-devel@quimby.gnus.org; Wed, 22 Oct 2003 11:51:31 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1ACLEp-0000qf-SK for emacs-devel@gnu.org; Wed, 22 Oct 2003 11:49:31 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1ACLEI-0000gD-Co for emacs-devel@gnu.org; Wed, 22 Oct 2003 11:49:29 -0400 Original-Received: from [192.114.186.23] (helo=aragorn.inter.net.il) by monty-python.gnu.org with esmtp (Exim 4.24) id 1ACLEH-0000fh-T7; Wed, 22 Oct 2003 11:48:58 -0400 Original-Received: from zaretski (pns03-200-33.inter.net.il [80.230.200.33]) by aragorn.inter.net.il (Mirapoint Messaging Server MOS 3.3.7-GR) with ESMTP id BRV24308; Wed, 22 Oct 2003 17:47:32 +0200 (IST) Original-To: rms@gnu.org X-Mailer: emacs 21.3.50 (via feedmail 8 I) and Blat ver 1.8.9 In-reply-to: (message from Richard Stallman on Wed, 22 Oct 2003 05:25:37 -0400) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:17344 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:17344 > From: Richard Stallman > Date: Wed, 22 Oct 2003 05:25:37 -0400 > > I get the same results. I figured out why. I'm using an x86. Facos > calls acos, but in Fsqrt the call to sqrt gets open-coded using the > fsqrt instruction. fsqrt doesn't set errno as it is expected to. > Perhaps that is a GCC bug. I don't think it's a bug at all. Last time I looked closely at the code emitted by GCC in such situations, it indeed issues the FSQRT instruction, but after that carefully examines the appropriate bits in the x87 status register, and if any of the bits are set that indicate that a numeric exception has happened, it calls the `sqrt' function from the library, assuming (quite correctly, IMHO) that the library code will deal with abnormal results according to whatever ANSI/Posix requires in the particular environment and platform where you run the code. If you say "gcc -S" and look at the code, don't you see the FSQRT instruction being followed by tests on bits in the FPU status word, followed by the call to `sqrt' from the library?