unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@elta.co.il>
Cc: emacs-devel@gnu.org
Subject: Re: (elisp)Numbers
Date: 26 Oct 2003 08:04:31 +0200	[thread overview]
Message-ID: <uismch6vk.fsf@elta.co.il> (raw)
In-Reply-To: <E1ADWrm-0007jq-Ax@fencepost.gnu.org> (message from Richard Stallman on Sat, 25 Oct 2003 18:26:38 -0400)

> From: Richard Stallman <rms@gnu.org>
> Date: Sat, 25 Oct 2003 18:26:38 -0400
> 
>     Here's the code I see with "gcc -E -O2" on fencepost (I reformatted it
>     for better readability):
> 
> 	extern __inline double sqrt ( double __x) 
> 	{ 
> 	  register double __result;
> 	  __asm __volatile__ ( "fsqrt" : "=t" (__result) : "0" (__x) );
> 	   return __result; 
> 	}
> 
> 1. where does this code come from?  which file in which package?

This is part of cpp's output when I run on floatfns.c the same
command as when it is compiled into floatfns.o, but with -c replaced
with -E.  For the build on fencepost, this is the command I ran:

  gcc -E -D_BSD_SOURCE -Demacs -DHAVE_CONFIG_H -I. -I/home/e/eliz/emacs/src -D_BSD_SOURCE -O2 floatfns.c | less -ci

If you omit -O2, the inline expansion of `sqrt' doesn't appear in the
output, so the library function is called.

The expansion itself seems to come from
/usr/include/bits/mathinline.h, which is part of glibc, since
immediately before the above snippet, I see this line:

   # 438 "/usr/include/bits/mathinline.h" 3

mathinlines.h has this near line 438:

   __inline_mathopNP (sqrt, "fsqrt")

which, after a series of macro expansions, eventually expands into
the above inline definition of `sqrt'.

Similar things happen with other math functions.  It sounds like
under -O2 no math function ever sets errno.

> 2. i see that my CFLAGS setting to turn off inlining got lost
> when i reran configure.  so i put that back in and recompiled,
> and it went away.

What went away?  You mean that Emacs did throw a domain error when
floatfns.c was compiled without optimizations?

Anyway, we do want floatfns.c to be compiled with optimization and
still DTRT, right?

  reply	other threads:[~2003-10-26  6:04 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-21  2:29 (elisp)Numbers Luc Teirlinck
2003-10-21  5:38 ` (elisp)Numbers Eli Zaretskii
2003-10-22  9:26   ` (elisp)Numbers Richard Stallman
2003-10-22 15:51     ` (elisp)Numbers Eli Zaretskii
2003-10-22  9:25 ` (elisp)Numbers Richard Stallman
2003-10-22 11:36   ` (elisp)Numbers Andreas Schwab
2003-10-22 15:42   ` (elisp)Numbers Eli Zaretskii
2003-10-23 18:38     ` (elisp)Numbers Richard Stallman
2003-10-24  8:43       ` (elisp)Numbers Andreas Schwab
2003-10-24 13:50         ` (elisp)Numbers Eli Zaretskii
2003-10-24 22:15           ` (elisp)Numbers Eli Zaretskii
2003-10-25 22:26             ` (elisp)Numbers Richard Stallman
2003-10-26  6:04               ` Eli Zaretskii [this message]
2003-10-27  7:02                 ` (elisp)Numbers Richard Stallman
2003-10-27 19:56                   ` (elisp)Numbers Eli Zaretskii
2003-10-27 21:46                     ` (elisp)Numbers Andreas Schwab
2003-10-28  5:48                       ` (elisp)Numbers Eli Zaretskii
2003-10-28  6:40                         ` (elisp)Numbers Lars Brinkhoff
2003-10-28 20:03                           ` (elisp)Numbers Eli Zaretskii
2003-10-28 20:40                       ` (elisp)Numbers Richard Stallman
2003-10-24 13:38       ` (elisp)Numbers Eli Zaretskii
2003-10-24 22:04         ` (elisp)Numbers Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2003-10-04 15:36 (elisp)Numbers Luc Teirlinck
2003-10-07 19:57 ` (elisp)Numbers Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=uismch6vk.fsf@elta.co.il \
    --to=eliz@elta.co.il \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).