[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: (elisp)Numbers
From: |
Eli Zaretskii |
Subject: |
Re: (elisp)Numbers |
Date: |
26 Oct 2003 08:04:31 +0200 |
> From: Richard Stallman <address@hidden>
> 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?
- Re: (elisp)Numbers, (continued)
Re: (elisp)Numbers, Richard Stallman, 2003/10/22
- Re: (elisp)Numbers, Andreas Schwab, 2003/10/22
- Re: (elisp)Numbers, Eli Zaretskii, 2003/10/22
- Re: (elisp)Numbers, Richard Stallman, 2003/10/23
- Re: (elisp)Numbers, Andreas Schwab, 2003/10/24
- Re: (elisp)Numbers, Eli Zaretskii, 2003/10/24
- Re: (elisp)Numbers, Eli Zaretskii, 2003/10/24
- Re: (elisp)Numbers, Richard Stallman, 2003/10/25
- Re: (elisp)Numbers,
Eli Zaretskii <=
- Re: (elisp)Numbers, Richard Stallman, 2003/10/27
- Re: (elisp)Numbers, Eli Zaretskii, 2003/10/27
- Re: (elisp)Numbers, Andreas Schwab, 2003/10/27
- Re: (elisp)Numbers, Eli Zaretskii, 2003/10/28
- Re: (elisp)Numbers, Lars Brinkhoff, 2003/10/28
- Re: (elisp)Numbers, Eli Zaretskii, 2003/10/28
Re: (elisp)Numbers, Richard Stallman, 2003/10/28
Re: (elisp)Numbers, Eli Zaretskii, 2003/10/24
Re: (elisp)Numbers, Eli Zaretskii, 2003/10/24