public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: dewar@gnat.com (Robert Dewar)
To: dewar@gnat.com, rth@redhat.com
Cc: fjh@cs.mu.OZ.AU, gcc@gcc.gnu.org, lucier@math.purdue.edu
Subject: Re: real.c implementation
Date: Tue, 22 Oct 2002 07:23:00 -0000	[thread overview]
Message-ID: <20021022101116.4C569F2D65@nile.gnat.com> (raw)

> That seems like a complete waste of effort.  Why not do it 
> correctly, once, in the right place?

Well in Ada, you are required in any case to implement multiple precision
real arithmetic at compile time, since it is required that static expressions
of arbitrary precision must be evaluated exactly. Furthremore, the rules
for the exact evaluation of things like the 'Machine attribute are very
precise and "do it correctly" is quite Ada specific. Finally, under no
circumstances can you rely on the assembler to convert decimal float
values accurately, since miscelleaneous assemblers cannot be trusted
to do that right.

> I am surprised that the Mercury compiler does not take the same approach.

The reason for my surprise is that if the Mercury spec requires this to be
"done right", I would have thought that you would not simply trust the
backend of GCC to do things right (in our experience, at least in GCC 2,
it for sure does not do the "right thing" for denormals in all situations).

Of course I am all in favor of doing things as right as possible in GCC.
But it would not surprise me if different front ends had subtly different
requirements. For example, an interesting issue is whether unbiased rounding
is required for literals. In Ada 95, you are required to do biased rounding
(0.5 ULP always rounding up) for literals, but I can easily see some other
language requiring unbiased rounding, and indeed there is a discussion that
this requirement of Ada should be changed :-)

             reply	other threads:[~2002-10-22 10:11 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-22  7:23 Robert Dewar [this message]
2002-10-22  7:41 ` Andrew Haley
     [not found] <200210281429.g9SETTeS020750@mururoa.inria.fr>
2002-10-28 11:38 ` Brigitte Verdonk
  -- strict thread matches above, loose matches on Subject: below --
2002-10-28  8:34 Stephen L Moshier
2002-10-28  4:43 Stephen L Moshier
2002-10-26  8:43 Robert Dewar
2002-10-26  8:42 Stephen L Moshier
2002-10-26  9:05 ` Brad Lucier
2002-10-26  4:10 Stephen L Moshier
2002-10-23  0:33 Robert Dewar
2002-10-22 23:58 Robert Dewar
2002-10-23  0:03 ` Eric Christopher
2002-10-22 13:22 Robert Dewar
2002-10-22 12:15 Robert Dewar
2002-10-22 12:32 ` Richard Henderson
2002-10-22 11:04 Robert Dewar
2002-10-22  9:45 Robert Dewar
2002-10-22 14:35 ` Neil Booth
2002-10-22  9:43 Robert Dewar
2002-10-22 11:56 ` Richard Henderson
2002-10-22  9:05 Robert Dewar
2002-10-22  9:19 ` Andrew Haley
2002-10-22  8:49 Robert Dewar
2002-10-22  8:50 ` Andrew Haley
2002-10-22 11:35 ` Zack Weinberg
2002-10-22 11:49 ` Richard Henderson
2002-10-22 12:34   ` Andreas Schwab
2002-10-22 17:26     ` Richard Henderson
2002-10-23  9:10       ` Andreas Schwab
2002-10-22  3:14 Robert Dewar
2002-10-22  3:36 ` Richard Henderson
2002-10-22  7:23   ` Andrew Haley
2002-10-22 11:00     ` Matt Thomas
2002-10-22 11:06       ` Andrew Haley
2002-10-22 11:11         ` Andrew Haley
2002-10-19  2:16 Roger Sayle
2002-10-18 17:02 Brad Lucier
2002-10-18 20:28 ` Richard Henderson
2002-10-17 14:16 Brad Lucier
2002-10-18 15:21 ` Richard Henderson
2002-10-19  1:07   ` Brad Lucier
2002-10-21  7:37   ` Brad Lucier
2002-10-21 17:34     ` Richard Henderson
2002-10-22  1:53       ` Fergus Henderson
2002-10-21 20:41     ` Richard Henderson

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=20021022101116.4C569F2D65@nile.gnat.com \
    --to=dewar@gnat.com \
    --cc=fjh@cs.mu.OZ.AU \
    --cc=gcc@gcc.gnu.org \
    --cc=lucier@math.purdue.edu \
    --cc=rth@redhat.com \
    /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).