public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Geoffrey KEATING <geoffk@discus.anu.edu.au>
To: hjl@lucon.org (H.J. Lu)
Cc: zack@rabi.phys.columbia.edu (Zack Weinberg),
	egcs@cygnus.com, libc-linux@gnu.org (GNU C Library)
Subject: Re: A patch for libm-ieee754
Date: Sun, 22 Feb 1998 18:18:00 -0000	[thread overview]
Message-ID: <199802230218.NAA13525@discus.anu.edu.au> (raw)
In-Reply-To: <m0y6RZW-00058gC@ocean.lucon.org>

> From: hjl@lucon.org (H.J. Lu)
> Date: Sat, 21 Feb 1998 18:55:18 -0800 (PST)

> It turns out those libm-ieee754 bugs are not in egcs. Here is the patch
> for glibc 2.1 to fix a few libm-ieee754 bugs. Ulrich, could you please
> take a look?
> 
> When you use fpu/cpu to do rounding, you have to mark the variable
> volatile. Otherwise, the compiler may do some thing you don't want.

libm-ieee754 expects ieee754 behaviour, and in particular that when a
value is stored to a 'double' variable or returned from a function of
type 'double', then that value is representable as a 'double' (and
similarly for 'float').  In fact, some functions basically do nothing
but invoke the FPU's rounder (like s_rint.c).

To get this behaviour with gcc, you may need to use the -ffloat-store
flag:


For most programs, the excess precision does only good, but a few
programs rely on the precise definition of IEEE floating point.  Use
`-ffloat-store' for such programs.


Do _not_ mark the variables 'volatile'.  This causes a performance
reduction on sparc and powerpc, and probably on alpha and x86 too,
because of the memory traffic it generates.

--
Geoff Keating <Geoff.Keating@anu.edu.au>

  parent reply	other threads:[~1998-02-22 18:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <199802220053.TAA29191@rabi.phys.columbia.edu>
1998-02-21 17:50 ` Who is fixing libm-ieee754? H.J. Lu
1998-02-21 18:55 ` A patch for libm-ieee754 H.J. Lu
1998-02-22  7:42   ` Andreas Jaeger
1998-02-22 13:03     ` Toon Moene
1998-02-22 13:33       ` Ulrich Drepper
1998-02-22 13:42       ` Andreas Jaeger
1998-02-22 18:18   ` Geoffrey KEATING [this message]
1998-02-22 18:39     ` David Edelsohn
1998-02-22 19:30       ` Geoffrey KEATING

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

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

  git send-email \
    --in-reply-to=199802230218.NAA13525@discus.anu.edu.au \
    --to=geoffk@discus.anu.edu.au \
    --cc=egcs@cygnus.com \
    --cc=hjl@lucon.org \
    --cc=libc-linux@gnu.org \
    --cc=zack@rabi.phys.columbia.edu \
    /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.
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).