Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

6 May, 2024: The networking issue during the past two days has been identified and appears to be fixed. Will keep monitoring.


devel / comp.arch / Re: IEEE 754 Oddities

SubjectAuthor
* Dusty Deck FORTRAN versus IEEE 754MitchAlsup
+* Re: Dusty Deck FORTRAN versus IEEE 754Thomas Koenig
|`* Re: Dusty Deck FORTRAN versus IEEE 754MitchAlsup
| `* Re: Dusty Deck FORTRAN versus IEEE 754Thomas Koenig
|  +- Re: Dusty Deck FORTRAN versus IEEE 754Scott Lurndal
|  `- Re: Dusty Deck FORTRAN versus IEEE 754MitchAlsup
+* Re: Dusty Deck FORTRAN versus IEEE 754Quadibloc
|`* Re: Dusty Deck FORTRAN versus IEEE 754MitchAlsup
| `* Re: Dusty Deck FORTRAN versus IEEE 754Quadibloc
|  `* Re: Dusty Deck FORTRAN versus IEEE 754MitchAlsup
|   `* IEEE 754 OdditiesMitchAlsup
|    +* Re: IEEE 754 OdditiesTerje Mathisen
|    |`- Re: IEEE 754 OdditiesMitchAlsup
|    `- Re: IEEE 754 OdditiesIvan Godard
`* Re: Dusty Deck FORTRAN versus IEEE 754John Levine
 `- Re: Dusty Deck FORTRAN versus IEEE 754MitchAlsup

1
Dusty Deck FORTRAN versus IEEE 754

<6eae17c2-6644-4b6a-8d63-5af69bd63115n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=31131&group=comp.arch#31131

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:6214:4a46:b0:56e:9ad3:ab9c with SMTP id ph6-20020a0562144a4600b0056e9ad3ab9cmr620319qvb.1.1678561068906;
Sat, 11 Mar 2023 10:57:48 -0800 (PST)
X-Received: by 2002:a05:6870:717:b0:176:2ebc:48aa with SMTP id
ea23-20020a056870071700b001762ebc48aamr10415950oab.3.1678561068685; Sat, 11
Mar 2023 10:57:48 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Sat, 11 Mar 2023 10:57:48 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:e958:c798:a52c:df38;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:e958:c798:a52c:df38
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <6eae17c2-6644-4b6a-8d63-5af69bd63115n@googlegroups.com>
Subject: Dusty Deck FORTRAN versus IEEE 754
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Sat, 11 Mar 2023 18:57:48 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2203
 by: MitchAlsup - Sat, 11 Mar 2023 18:57 UTC

I am analyzing the ASM out of Brian's LLVM port and ran into
an interesting piece of code I though merits some discussion.

The code is part of a CFD package originally written in the
late 1960 or early 1970. Then in 2005 it was translated from
FORTRAN (apparently 2) to C.

A snippet of the code in question follows--this code is inside
the innermost loop::

dpdx[i] = 0.0;
dpdy[i] = rho;
/*
Evaluate the residuals.
*/
ur[i] = dudt[i] - nu * ( dudxx[i] + dudyy[i] )
+ u[i] * dudx[i] + v[i] * dudy[i] + dpdx[i] / rho - f[i];

vr[i] = dvdt[i] - nu * ( dvdxx[i] + dvdyy[i] )
+ u[i] * dvdx[i] + v[i] * dvdy[i] + dpdy[i] / rho - g[i];

So, Brian's compiler happily propagates dpdx[i] = 0.0; to the
division at dpdx[i] / rho and the compiler produces:

fdiv r1,#0,r21

Then the compiler happily propagates dpdy[i] = rho; to the
division at dpdy[i] / rho and the compiler produces:

fdiv r1,r21,r21

Now, since this code was written decades before IEEE 754
the code is not anticipating NaNs and Infinities, so would
it be reasonable to replace::

dpdx[i] / rho with 0.0
and
dpdy[i] / rho with 1.0

?????

Re: Dusty Deck FORTRAN versus IEEE 754

<tuk1pf$23tn0$1@newsreader4.netcologne.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=31138&group=comp.arch#31138

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2001-4dd7-c7b6-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoe...@netcologne.de (Thomas Koenig)
Newsgroups: comp.arch
Subject: Re: Dusty Deck FORTRAN versus IEEE 754
Date: Sun, 12 Mar 2023 08:16:47 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <tuk1pf$23tn0$1@newsreader4.netcologne.de>
References: <6eae17c2-6644-4b6a-8d63-5af69bd63115n@googlegroups.com>
Injection-Date: Sun, 12 Mar 2023 08:16:47 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd7-c7b6-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2001:4dd7:c7b6:0:7285:c2ff:fe6c:992d";
logging-data="2225888"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Sun, 12 Mar 2023 08:16 UTC

MitchAlsup <MitchAlsup@aol.com> schrieb:
> I am analyzing the ASM out of Brian's LLVM port and ran into
> an interesting piece of code I though merits some discussion.
>
> The code is part of a CFD package originally written in the
> late 1960 or early 1970. Then in 2005 it was translated from
> FORTRAN (apparently 2) to C.
>
> A snippet of the code in question follows--this code is inside
> the innermost loop::
>
> dpdx[i] = 0.0;
> dpdy[i] = rho;
> /*
> Evaluate the residuals.
> */
> ur[i] = dudt[i] - nu * ( dudxx[i] + dudyy[i] )
> + u[i] * dudx[i] + v[i] * dudy[i] + dpdx[i] / rho - f[i];
>
> vr[i] = dvdt[i] - nu * ( dvdxx[i] + dvdyy[i] )
> + u[i] * dvdx[i] + v[i] * dvdy[i] + dpdy[i] / rho - g[i];
>
> So, Brian's compiler happily propagates dpdx[i] = 0.0; to the
> division at dpdx[i] / rho and the compiler produces:
>
> fdiv r1,#0,r21
>
> Then the compiler happily propagates dpdy[i] = rho; to the
> division at dpdy[i] / rho and the compiler produces:
>
> fdiv r1,r21,r21
>
> Now, since this code was written decades before IEEE 754
> the code is not anticipating NaNs and Infinities, so would
> it be reasonable to replace::
>
> dpdx[i] / rho with 0.0
> and
> dpdy[i] / rho with 1.0

Under control of user-set flags, absolutely; otherwise not,
because rho may be NaN. -ffinite-math-only should do the trick
(I haven't checked).

In a similar vein: For your architecture, you probably do not
want to set errno on math functions with erroneous arguments. This
is permitted by the C standard, and (for example) MacOS does so, see
https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/acos.3.html#//apple_ref/doc/man/3/acos
as an example.

The advantage for My 66000 is obvious: The compiler then uses
the transcendental instructions directly instead of calling a
library function.

Re: Dusty Deck FORTRAN versus IEEE 754

<b87dd9d4-0c9e-40d5-95f0-942d4d71c6c6n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=31139&group=comp.arch#31139

  copy link   Newsgroups: comp.arch
X-Received: by 2002:ac8:410f:0:b0:3bf:b828:ab0d with SMTP id q15-20020ac8410f000000b003bfb828ab0dmr7528206qtl.11.1678609228376;
Sun, 12 Mar 2023 00:20:28 -0800 (PST)
X-Received: by 2002:a9d:705c:0:b0:693:d927:6d9f with SMTP id
x28-20020a9d705c000000b00693d9276d9fmr11142302otj.7.1678609228108; Sun, 12
Mar 2023 00:20:28 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Sun, 12 Mar 2023 00:20:27 -0800 (PST)
In-Reply-To: <6eae17c2-6644-4b6a-8d63-5af69bd63115n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:56a:fb70:6300:5327:3004:8002:5b73;
posting-account=1nOeKQkAAABD2jxp4Pzmx9Hx5g9miO8y
NNTP-Posting-Host: 2001:56a:fb70:6300:5327:3004:8002:5b73
References: <6eae17c2-6644-4b6a-8d63-5af69bd63115n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b87dd9d4-0c9e-40d5-95f0-942d4d71c6c6n@googlegroups.com>
Subject: Re: Dusty Deck FORTRAN versus IEEE 754
From: jsav...@ecn.ab.ca (Quadibloc)
Injection-Date: Sun, 12 Mar 2023 08:20:28 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2013
 by: Quadibloc - Sun, 12 Mar 2023 08:20 UTC

On Saturday, March 11, 2023 at 11:57:50 AM UTC-7, MitchAlsup wrote:
> would
> it be reasonable to replace::
>
> dpdx[i] / rho with 0.0
> and
> dpdy[i] / rho with 1.0

It certainly _seems_ like it would be reasonable to do so,
but it also seems that it would still also be reasonable
even if the floating-point numbers used followed an older
standard instead of IEEE 754.

That seems like a warning sign: what was the reason it
wasn't done that way originally?

So the question is: is this code written the way it is in
order to be self-documenting, with the programmer either
failing to optimize the inner loop, or expecting the compiler
to do so?

Or is something else strange happening that isn't apparent
from the code snippet given?

John Savard

Re: Dusty Deck FORTRAN versus IEEE 754

<tukt5t$2gh2$1@gal.iecc.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=31143&group=comp.arch#31143

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!news.iecc.com!.POSTED.news.iecc.com!not-for-mail
From: joh...@taugh.com (John Levine)
Newsgroups: comp.arch
Subject: Re: Dusty Deck FORTRAN versus IEEE 754
Date: Sun, 12 Mar 2023 16:04:14 -0000 (UTC)
Organization: Taughannock Networks
Message-ID: <tukt5t$2gh2$1@gal.iecc.com>
References: <6eae17c2-6644-4b6a-8d63-5af69bd63115n@googlegroups.com>
Injection-Date: Sun, 12 Mar 2023 16:04:14 -0000 (UTC)
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970";
logging-data="82466"; mail-complaints-to="abuse@iecc.com"
In-Reply-To: <6eae17c2-6644-4b6a-8d63-5af69bd63115n@googlegroups.com>
Cleverness: some
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: johnl@iecc.com (John Levine)
 by: John Levine - Sun, 12 Mar 2023 16:04 UTC

According to MitchAlsup <MitchAlsup@aol.com>:
>Now, since this code was written decades before IEEE 754
>the code is not anticipating NaNs and Infinities, so would
>it be reasonable to replace::
>
>dpdx[i] / rho with 0.0
>and
>dpdy[i] / rho with 1.0
>
>?????

The Fortran 66 standard said that a compiler can make any
transformation that is mathematically equivalent, not just numerically
equivalent, so yes.

Not that a lot of compilers did that. There was a guy at IBM turning
Fortran H into Fortran X which did better optimization, but he set a
rule for himself that the results had to be bit identical.

--
Regards,
John Levine, johnl@taugh.com, Primary Perpetrator of "The Internet for Dummies",
Please consider the environment before reading this e-mail. https://jl.ly

Re: Dusty Deck FORTRAN versus IEEE 754

<0382800c-d8a4-4c28-84f9-fd48ad480c97n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=31148&group=comp.arch#31148

  copy link   Newsgroups: comp.arch
X-Received: by 2002:ac8:6155:0:b0:3bd:17aa:49b2 with SMTP id d21-20020ac86155000000b003bd17aa49b2mr2475569qtm.5.1678645501214;
Sun, 12 Mar 2023 11:25:01 -0700 (PDT)
X-Received: by 2002:a05:6808:1706:b0:37f:a2ad:6718 with SMTP id
bc6-20020a056808170600b0037fa2ad6718mr4101877oib.3.1678645500961; Sun, 12 Mar
2023 11:25:00 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Sun, 12 Mar 2023 11:25:00 -0700 (PDT)
In-Reply-To: <tuk1pf$23tn0$1@newsreader4.netcologne.de>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:c5b2:ba0c:f167:96b4;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:c5b2:ba0c:f167:96b4
References: <6eae17c2-6644-4b6a-8d63-5af69bd63115n@googlegroups.com> <tuk1pf$23tn0$1@newsreader4.netcologne.de>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0382800c-d8a4-4c28-84f9-fd48ad480c97n@googlegroups.com>
Subject: Re: Dusty Deck FORTRAN versus IEEE 754
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Sun, 12 Mar 2023 18:25:01 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3705
 by: MitchAlsup - Sun, 12 Mar 2023 18:25 UTC

On Sunday, March 12, 2023 at 3:16:50 AM UTC-5, Thomas Koenig wrote:
> MitchAlsup <Mitch...@aol.com> schrieb:
> > I am analyzing the ASM out of Brian's LLVM port and ran into
> > an interesting piece of code I though merits some discussion.
> >
> > The code is part of a CFD package originally written in the
> > late 1960 or early 1970. Then in 2005 it was translated from
> > FORTRAN (apparently 2) to C.
> >
> > A snippet of the code in question follows--this code is inside
> > the innermost loop::
> >
> > dpdx[i] = 0.0;
> > dpdy[i] = rho;
> > /*
> > Evaluate the residuals.
> > */
> > ur[i] = dudt[i] - nu * ( dudxx[i] + dudyy[i] )
> > + u[i] * dudx[i] + v[i] * dudy[i] + dpdx[i] / rho - f[i];
> >
> > vr[i] = dvdt[i] - nu * ( dvdxx[i] + dvdyy[i] )
> > + u[i] * dvdx[i] + v[i] * dvdy[i] + dpdy[i] / rho - g[i];
> >
> > So, Brian's compiler happily propagates dpdx[i] = 0.0; to the
> > division at dpdx[i] / rho and the compiler produces:
> >
> > fdiv r1,#0,r21
> >
> > Then the compiler happily propagates dpdy[i] = rho; to the
> > division at dpdy[i] / rho and the compiler produces:
> >
> > fdiv r1,r21,r21
> >
> > Now, since this code was written decades before IEEE 754
> > the code is not anticipating NaNs and Infinities, so would
> > it be reasonable to replace::
> >
> > dpdx[i] / rho with 0.0
> > and
> > dpdy[i] / rho with 1.0
> Under control of user-set flags, absolutely; otherwise not,
> because rho may be NaN. -ffinite-math-only should do the trick
> (I haven't checked).
>
> In a similar vein: For your architecture, you probably do not
> want to set errno on math functions with erroneous arguments. This
> is permitted by the C standard, and (for example) MacOS does so, see
> https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/acos.3.html#//apple_ref/doc/man/3/acos
> as an example.
>
> The advantage for My 66000 is obvious: The compiler then uses
> the transcendental instructions directly instead of calling a
> library function.
<
As I read the C standard and the IEEE 754-2019 as long as you deliver
something in accordance with 754-2019 you do not have to set errno.
Since all transcendentals deliver something in accordance, errno is not
in the picture.

Re: Dusty Deck FORTRAN versus IEEE 754

<2db17fb4-7c79-4531-b4c5-4b2113794a5cn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=31149&group=comp.arch#31149

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:620a:341:b0:742:6f09:e278 with SMTP id t1-20020a05620a034100b007426f09e278mr2497013qkm.15.1678645734344;
Sun, 12 Mar 2023 11:28:54 -0700 (PDT)
X-Received: by 2002:a05:6870:c153:b0:177:7dbd:cb58 with SMTP id
g19-20020a056870c15300b001777dbdcb58mr2463824oad.1.1678645734085; Sun, 12 Mar
2023 11:28:54 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Sun, 12 Mar 2023 11:28:53 -0700 (PDT)
In-Reply-To: <b87dd9d4-0c9e-40d5-95f0-942d4d71c6c6n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:c5b2:ba0c:f167:96b4;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:c5b2:ba0c:f167:96b4
References: <6eae17c2-6644-4b6a-8d63-5af69bd63115n@googlegroups.com> <b87dd9d4-0c9e-40d5-95f0-942d4d71c6c6n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2db17fb4-7c79-4531-b4c5-4b2113794a5cn@googlegroups.com>
Subject: Re: Dusty Deck FORTRAN versus IEEE 754
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Sun, 12 Mar 2023 18:28:54 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: MitchAlsup - Sun, 12 Mar 2023 18:28 UTC

On Sunday, March 12, 2023 at 3:20:29 AM UTC-5, Quadibloc wrote:
> On Saturday, March 11, 2023 at 11:57:50 AM UTC-7, MitchAlsup wrote:
> > would
> > it be reasonable to replace::
> >
> > dpdx[i] / rho with 0.0
> > and
> > dpdy[i] / rho with 1.0
> It certainly _seems_ like it would be reasonable to do so,
> but it also seems that it would still also be reasonable
> even if the floating-point numbers used followed an older
> standard instead of IEEE 754.
>
> That seems like a warning sign: what was the reason it
> wasn't done that way originally?
<
Written 2-to-1.5 decades prior to IEEE 754, and sloppily
translated into C.
>
> So the question is: is this code written the way it is in
> order to be self-documenting, with the programmer either
> failing to optimize the inner loop, or expecting the compiler
> to do so?
<
After thinking about the problem for a day, I think this is a
job for special casing the HW function unit. If FDIV runs
into either (above) is delivers a result in accordance with
754-2019 in the pipeline delay of minimal cycles rather
than the pipeline delay of FDIV--screwing up code scheduling
but being faster.
>
> Or is something else strange happening that isn't apparent
> from the code snippet given?
<
I blame sloppy translation from the original FORTRAN,
>
> John Savard

Re: Dusty Deck FORTRAN versus IEEE 754

<9eccbb2f-7a6b-451e-b9fb-9ec075b61d54n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=31150&group=comp.arch#31150

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:6214:a45:b0:56e:917a:1c19 with SMTP id ee5-20020a0562140a4500b0056e917a1c19mr1162124qvb.0.1678645785643;
Sun, 12 Mar 2023 11:29:45 -0700 (PDT)
X-Received: by 2002:a05:6870:b7b3:b0:16f:375e:329d with SMTP id
ed51-20020a056870b7b300b0016f375e329dmr11066503oab.4.1678645785368; Sun, 12
Mar 2023 11:29:45 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Sun, 12 Mar 2023 11:29:45 -0700 (PDT)
In-Reply-To: <tukt5t$2gh2$1@gal.iecc.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:c5b2:ba0c:f167:96b4;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:c5b2:ba0c:f167:96b4
References: <6eae17c2-6644-4b6a-8d63-5af69bd63115n@googlegroups.com> <tukt5t$2gh2$1@gal.iecc.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9eccbb2f-7a6b-451e-b9fb-9ec075b61d54n@googlegroups.com>
Subject: Re: Dusty Deck FORTRAN versus IEEE 754
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Sun, 12 Mar 2023 18:29:45 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2287
 by: MitchAlsup - Sun, 12 Mar 2023 18:29 UTC

On Sunday, March 12, 2023 at 11:04:18 AM UTC-5, John Levine wrote:
> According to MitchAlsup <Mitch...@aol.com>:
> >Now, since this code was written decades before IEEE 754
> >the code is not anticipating NaNs and Infinities, so would
> >it be reasonable to replace::
> >
> >dpdx[i] / rho with 0.0
> >and
> >dpdy[i] / rho with 1.0
> >
> >?????
> The Fortran 66 standard said that a compiler can make any
> transformation that is mathematically equivalent, not just numerically
> equivalent, so yes.
<
Yes, but IEEE 754 disagrees with that compiler assertion.
>
> Not that a lot of compilers did that. There was a guy at IBM turning
> Fortran H into Fortran X which did better optimization, but he set a
> rule for himself that the results had to be bit identical.
>
Compilers are better now.
>
> --
> Regards,
> John Levine, jo...@taugh.com, Primary Perpetrator of "The Internet for Dummies",
> Please consider the environment before reading this e-mail. https://jl.ly

Re: Dusty Deck FORTRAN versus IEEE 754

<tul7ln$24l6s$1@newsreader4.netcologne.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=31156&group=comp.arch#31156

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2001-4dd7-c7b6-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoe...@netcologne.de (Thomas Koenig)
Newsgroups: comp.arch
Subject: Re: Dusty Deck FORTRAN versus IEEE 754
Date: Sun, 12 Mar 2023 19:03:19 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <tul7ln$24l6s$1@newsreader4.netcologne.de>
References: <6eae17c2-6644-4b6a-8d63-5af69bd63115n@googlegroups.com>
<tuk1pf$23tn0$1@newsreader4.netcologne.de>
<0382800c-d8a4-4c28-84f9-fd48ad480c97n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 12 Mar 2023 19:03:19 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd7-c7b6-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2001:4dd7:c7b6:0:7285:c2ff:fe6c:992d";
logging-data="2249948"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Sun, 12 Mar 2023 19:03 UTC

MitchAlsup <MitchAlsup@aol.com> schrieb:
> On Sunday, March 12, 2023 at 3:16:50 AM UTC-5, Thomas Koenig wrote:
>> MitchAlsup <Mitch...@aol.com> schrieb:
>> > I am analyzing the ASM out of Brian's LLVM port and ran into
>> > an interesting piece of code I though merits some discussion.
>> >
>> > The code is part of a CFD package originally written in the
>> > late 1960 or early 1970. Then in 2005 it was translated from
>> > FORTRAN (apparently 2) to C.
>> >
>> > A snippet of the code in question follows--this code is inside
>> > the innermost loop::
>> >
>> > dpdx[i] = 0.0;
>> > dpdy[i] = rho;
>> > /*
>> > Evaluate the residuals.
>> > */
>> > ur[i] = dudt[i] - nu * ( dudxx[i] + dudyy[i] )
>> > + u[i] * dudx[i] + v[i] * dudy[i] + dpdx[i] / rho - f[i];
>> >
>> > vr[i] = dvdt[i] - nu * ( dvdxx[i] + dvdyy[i] )
>> > + u[i] * dvdx[i] + v[i] * dvdy[i] + dpdy[i] / rho - g[i];
>> >
>> > So, Brian's compiler happily propagates dpdx[i] = 0.0; to the
>> > division at dpdx[i] / rho and the compiler produces:
>> >
>> > fdiv r1,#0,r21
>> >
>> > Then the compiler happily propagates dpdy[i] = rho; to the
>> > division at dpdy[i] / rho and the compiler produces:
>> >
>> > fdiv r1,r21,r21
>> >
>> > Now, since this code was written decades before IEEE 754
>> > the code is not anticipating NaNs and Infinities, so would
>> > it be reasonable to replace::
>> >
>> > dpdx[i] / rho with 0.0
>> > and
>> > dpdy[i] / rho with 1.0
>> Under control of user-set flags, absolutely; otherwise not,
>> because rho may be NaN. -ffinite-math-only should do the trick
>> (I haven't checked).
>>
>> In a similar vein: For your architecture, you probably do not
>> want to set errno on math functions with erroneous arguments. This
>> is permitted by the C standard, and (for example) MacOS does so, see
>> https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/acos.3.html#//apple_ref/doc/man/3/acos
>> as an example.
>>
>> The advantage for My 66000 is obvious: The compiler then uses
>> the transcendental instructions directly instead of calling a
>> library function.
><
> As I read the C standard and the IEEE 754-2019 as long as you deliver
> something in accordance with 754-2019 you do not have to set errno.
> Since all transcendentals deliver something in accordance, errno is not
> in the picture.

And yet, there are systems which set it on a domain error, for
example glibc. I would consider that a mistake, especially since
it is not prescribed by the C standard. I don't know what history
is behind that. BSD does not do so, neither does Apple.

Re: Dusty Deck FORTRAN versus IEEE 754

<7SpPL.195985$Sgyc.4906@fx40.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=31158&group=comp.arch#31158

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx40.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: Dusty Deck FORTRAN versus IEEE 754
Newsgroups: comp.arch
Distribution: world
References: <6eae17c2-6644-4b6a-8d63-5af69bd63115n@googlegroups.com> <tuk1pf$23tn0$1@newsreader4.netcologne.de> <0382800c-d8a4-4c28-84f9-fd48ad480c97n@googlegroups.com> <tul7ln$24l6s$1@newsreader4.netcologne.de>
Lines: 83
Message-ID: <7SpPL.195985$Sgyc.4906@fx40.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Sun, 12 Mar 2023 19:37:39 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Sun, 12 Mar 2023 19:37:39 GMT
X-Received-Bytes: 4066
 by: Scott Lurndal - Sun, 12 Mar 2023 19:37 UTC

Thomas Koenig <tkoenig@netcologne.de> writes:
>MitchAlsup <MitchAlsup@aol.com> schrieb:
>> On Sunday, March 12, 2023 at 3:16:50 AM UTC-5, Thomas Koenig wrote:
>>> MitchAlsup <Mitch...@aol.com> schrieb:
>>> > I am analyzing the ASM out of Brian's LLVM port and ran into
>>> > an interesting piece of code I though merits some discussion.
>>> >
>>> > The code is part of a CFD package originally written in the
>>> > late 1960 or early 1970. Then in 2005 it was translated from
>>> > FORTRAN (apparently 2) to C.
>>> >
>>> > A snippet of the code in question follows--this code is inside
>>> > the innermost loop::
>>> >
>>> > dpdx[i] = 0.0;
>>> > dpdy[i] = rho;
>>> > /*
>>> > Evaluate the residuals.
>>> > */
>>> > ur[i] = dudt[i] - nu * ( dudxx[i] + dudyy[i] )
>>> > + u[i] * dudx[i] + v[i] * dudy[i] + dpdx[i] / rho - f[i];
>>> >
>>> > vr[i] = dvdt[i] - nu * ( dvdxx[i] + dvdyy[i] )
>>> > + u[i] * dvdx[i] + v[i] * dvdy[i] + dpdy[i] / rho - g[i];
>>> >
>>> > So, Brian's compiler happily propagates dpdx[i] = 0.0; to the
>>> > division at dpdx[i] / rho and the compiler produces:
>>> >
>>> > fdiv r1,#0,r21
>>> >
>>> > Then the compiler happily propagates dpdy[i] = rho; to the
>>> > division at dpdy[i] / rho and the compiler produces:
>>> >
>>> > fdiv r1,r21,r21
>>> >
>>> > Now, since this code was written decades before IEEE 754
>>> > the code is not anticipating NaNs and Infinities, so would
>>> > it be reasonable to replace::
>>> >
>>> > dpdx[i] / rho with 0.0
>>> > and
>>> > dpdy[i] / rho with 1.0
>>> Under control of user-set flags, absolutely; otherwise not,
>>> because rho may be NaN. -ffinite-math-only should do the trick
>>> (I haven't checked).
>>>
>>> In a similar vein: For your architecture, you probably do not
>>> want to set errno on math functions with erroneous arguments. This
>>> is permitted by the C standard, and (for example) MacOS does so, see
>>> https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/acos.3.html#//apple_ref/doc/man/3/acos
>>> as an example.
>>>
>>> The advantage for My 66000 is obvious: The compiler then uses
>>> the transcendental instructions directly instead of calling a
>>> library function.
>><
>> As I read the C standard and the IEEE 754-2019 as long as you deliver
>> something in accordance with 754-2019 you do not have to set errno.
>> Since all transcendentals deliver something in accordance, errno is not
>> in the picture.
>
>And yet, there are systems which set it on a domain error, for
>example glibc. I would consider that a mistake, especially since
>it is not prescribed by the C standard. I don't know what history
>is behind that. BSD does not do so, neither does Apple.

This interface dates back to the SVID (System V Interface Definition),
in the trig(BA_LIB) section.

RETURN VALUE

...

If the absolute value of the argument of asin() or acos() is
greater than one or if both arguments of atan2() are zero, zero is
returned and errno is set to EDOM. In addition, a message indicating
DOMAIN error is printed on the standard error output.

...

- System V Interface Definition, Third Edition, Volume I. (c) 1983-1989.

Re: Dusty Deck FORTRAN versus IEEE 754

<e415c74f-c040-42d4-8a99-000a378f3872n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=31159&group=comp.arch#31159

  copy link   Newsgroups: comp.arch
X-Received: by 2002:ac8:5e0a:0:b0:3bf:d1e1:aaf4 with SMTP id h10-20020ac85e0a000000b003bfd1e1aaf4mr9476596qtx.8.1678654718652;
Sun, 12 Mar 2023 13:58:38 -0700 (PDT)
X-Received: by 2002:a05:6830:334c:b0:690:f4b3:2e30 with SMTP id
l12-20020a056830334c00b00690f4b32e30mr11737884ott.1.1678654718417; Sun, 12
Mar 2023 13:58:38 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Sun, 12 Mar 2023 13:58:38 -0700 (PDT)
In-Reply-To: <tul7ln$24l6s$1@newsreader4.netcologne.de>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:c5b2:ba0c:f167:96b4;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:c5b2:ba0c:f167:96b4
References: <6eae17c2-6644-4b6a-8d63-5af69bd63115n@googlegroups.com>
<tuk1pf$23tn0$1@newsreader4.netcologne.de> <0382800c-d8a4-4c28-84f9-fd48ad480c97n@googlegroups.com>
<tul7ln$24l6s$1@newsreader4.netcologne.de>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e415c74f-c040-42d4-8a99-000a378f3872n@googlegroups.com>
Subject: Re: Dusty Deck FORTRAN versus IEEE 754
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Sun, 12 Mar 2023 20:58:38 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 4723
 by: MitchAlsup - Sun, 12 Mar 2023 20:58 UTC

On Sunday, March 12, 2023 at 2:03:22 PM UTC-5, Thomas Koenig wrote:
> MitchAlsup <Mitch...@aol.com> schrieb:
> > On Sunday, March 12, 2023 at 3:16:50 AM UTC-5, Thomas Koenig wrote:
> >> MitchAlsup <Mitch...@aol.com> schrieb:
> >> > I am analyzing the ASM out of Brian's LLVM port and ran into
> >> > an interesting piece of code I though merits some discussion.
> >> >
> >> > The code is part of a CFD package originally written in the
> >> > late 1960 or early 1970. Then in 2005 it was translated from
> >> > FORTRAN (apparently 2) to C.
> >> >
> >> > A snippet of the code in question follows--this code is inside
> >> > the innermost loop::
> >> >
> >> > dpdx[i] = 0.0;
> >> > dpdy[i] = rho;
> >> > /*
> >> > Evaluate the residuals.
> >> > */
> >> > ur[i] = dudt[i] - nu * ( dudxx[i] + dudyy[i] )
> >> > + u[i] * dudx[i] + v[i] * dudy[i] + dpdx[i] / rho - f[i];
> >> >
> >> > vr[i] = dvdt[i] - nu * ( dvdxx[i] + dvdyy[i] )
> >> > + u[i] * dvdx[i] + v[i] * dvdy[i] + dpdy[i] / rho - g[i];
> >> >
> >> > So, Brian's compiler happily propagates dpdx[i] = 0.0; to the
> >> > division at dpdx[i] / rho and the compiler produces:
> >> >
> >> > fdiv r1,#0,r21
> >> >
> >> > Then the compiler happily propagates dpdy[i] = rho; to the
> >> > division at dpdy[i] / rho and the compiler produces:
> >> >
> >> > fdiv r1,r21,r21
> >> >
> >> > Now, since this code was written decades before IEEE 754
> >> > the code is not anticipating NaNs and Infinities, so would
> >> > it be reasonable to replace::
> >> >
> >> > dpdx[i] / rho with 0.0
> >> > and
> >> > dpdy[i] / rho with 1.0
> >> Under control of user-set flags, absolutely; otherwise not,
> >> because rho may be NaN. -ffinite-math-only should do the trick
> >> (I haven't checked).
> >>
> >> In a similar vein: For your architecture, you probably do not
> >> want to set errno on math functions with erroneous arguments. This
> >> is permitted by the C standard, and (for example) MacOS does so, see
> >> https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/acos.3.html#//apple_ref/doc/man/3/acos
> >> as an example.
> >>
> >> The advantage for My 66000 is obvious: The compiler then uses
> >> the transcendental instructions directly instead of calling a
> >> library function.
> ><
> > As I read the C standard and the IEEE 754-2019 as long as you deliver
> > something in accordance with 754-2019 you do not have to set errno.
> > Since all transcendentals deliver something in accordance, errno is not
> > in the picture.
<
> And yet, there are systems which set it on a domain error, for
> example glibc. I would consider that a mistake, especially since
> it is not prescribed by the C standard. I don't know what history
> is behind that. BSD does not do so, neither does Apple.
<
Back when transcendental function took 150-500 cycles, setting
errno added 2 cycles, it was a reasonable decision. Now with
transcendental functions in the 20-cycle range and errno an
offset into thread local memory, setting errno might cost more
cycles than executing the transcendental !!

Re: Dusty Deck FORTRAN versus IEEE 754

<46407a1f-f532-4147-830d-7010664f8216n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=31169&group=comp.arch#31169

  copy link   Newsgroups: comp.arch
X-Received: by 2002:ac8:44a8:0:b0:3bf:c1f3:84bc with SMTP id a8-20020ac844a8000000b003bfc1f384bcmr8548641qto.11.1678711018167;
Mon, 13 Mar 2023 05:36:58 -0700 (PDT)
X-Received: by 2002:a05:6808:b2a:b0:384:aba:30b5 with SMTP id
t10-20020a0568080b2a00b003840aba30b5mr11543078oij.4.1678711017490; Mon, 13
Mar 2023 05:36:57 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Mon, 13 Mar 2023 05:36:57 -0700 (PDT)
In-Reply-To: <2db17fb4-7c79-4531-b4c5-4b2113794a5cn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:56a:fb70:6300:5327:3004:8002:5b73;
posting-account=1nOeKQkAAABD2jxp4Pzmx9Hx5g9miO8y
NNTP-Posting-Host: 2001:56a:fb70:6300:5327:3004:8002:5b73
References: <6eae17c2-6644-4b6a-8d63-5af69bd63115n@googlegroups.com>
<b87dd9d4-0c9e-40d5-95f0-942d4d71c6c6n@googlegroups.com> <2db17fb4-7c79-4531-b4c5-4b2113794a5cn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <46407a1f-f532-4147-830d-7010664f8216n@googlegroups.com>
Subject: Re: Dusty Deck FORTRAN versus IEEE 754
From: jsav...@ecn.ab.ca (Quadibloc)
Injection-Date: Mon, 13 Mar 2023 12:36:58 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2204
 by: Quadibloc - Mon, 13 Mar 2023 12:36 UTC

On Sunday, March 12, 2023 at 12:28:55 PM UTC-6, MitchAlsup wrote:
> On Sunday, March 12, 2023 at 3:20:29 AM UTC-5, Quadibloc wrote:

> > Or is something else strange happening that isn't apparent
> > from the code snippet given?
> <
> I blame sloppy translation from the original FORTRAN,

In that case, it's unfortunate you don't have a copy of the FORTRAN
original - although *if* the C code is known to deliver correct results,
I suppose you can manage from it.

Performing a wholly unnecessary arithmetic operation which is meaningless
isn't just sloppy translation - it means that something that would make it
meaningful was omitted, because someone wouldn't just substitute an expression
for 0 or 1 for no reason. So translation that's sloppy, but still correct, hardly even
seems like a possibility.

John Savard

Re: Dusty Deck FORTRAN versus IEEE 754

<4df247ce-ab0a-42d6-a666-2f1f13e6aff7n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=31173&group=comp.arch#31173

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:620a:840f:b0:742:72c6:a140 with SMTP id pc15-20020a05620a840f00b0074272c6a140mr3364185qkn.7.1678725470522;
Mon, 13 Mar 2023 09:37:50 -0700 (PDT)
X-Received: by 2002:a05:6870:649f:b0:177:9f9c:dc5 with SMTP id
cz31-20020a056870649f00b001779f9c0dc5mr2364647oab.9.1678725470293; Mon, 13
Mar 2023 09:37:50 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Mon, 13 Mar 2023 09:37:50 -0700 (PDT)
In-Reply-To: <46407a1f-f532-4147-830d-7010664f8216n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:3d6f:cdc0:a721:7d15;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:3d6f:cdc0:a721:7d15
References: <6eae17c2-6644-4b6a-8d63-5af69bd63115n@googlegroups.com>
<b87dd9d4-0c9e-40d5-95f0-942d4d71c6c6n@googlegroups.com> <2db17fb4-7c79-4531-b4c5-4b2113794a5cn@googlegroups.com>
<46407a1f-f532-4147-830d-7010664f8216n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <4df247ce-ab0a-42d6-a666-2f1f13e6aff7n@googlegroups.com>
Subject: Re: Dusty Deck FORTRAN versus IEEE 754
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Mon, 13 Mar 2023 16:37:50 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2625
 by: MitchAlsup - Mon, 13 Mar 2023 16:37 UTC

On Monday, March 13, 2023 at 7:36:59 AM UTC-5, Quadibloc wrote:
> On Sunday, March 12, 2023 at 12:28:55 PM UTC-6, MitchAlsup wrote:
> > On Sunday, March 12, 2023 at 3:20:29 AM UTC-5, Quadibloc wrote:
>
> > > Or is something else strange happening that isn't apparent
> > > from the code snippet given?
> > <
> > I blame sloppy translation from the original FORTRAN,
<
> In that case, it's unfortunate you don't have a copy of the FORTRAN
> original - although *if* the C code is known to deliver correct results,
> I suppose you can manage from it.
<
The code reads as if this is a "canned" way of numerically performing
a spatial derivative, and then immediately applying that derivative to
another numerical calculation also of "canned" form.
>
> Performing a wholly unnecessary arithmetic operation which is meaningless
> isn't just sloppy translation - it means that something that would make it
> meaningful was omitted, because someone wouldn't just substitute an expression
> for 0 or 1 for no reason. So translation that's sloppy, but still correct, hardly even
> seems like a possibility.
>
> John Savard

IEEE 754 Oddities

<c2dd6172-ff7f-410f-9948-9af99f0921e9n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=31183&group=comp.arch#31183

  copy link   Newsgroups: comp.arch
X-Received: by 2002:ad4:57b4:0:b0:5a1:41ce:91f0 with SMTP id g20-20020ad457b4000000b005a141ce91f0mr2313576qvx.2.1678745364412;
Mon, 13 Mar 2023 15:09:24 -0700 (PDT)
X-Received: by 2002:a05:6808:92:b0:384:23ed:1ff6 with SMTP id
s18-20020a056808009200b0038423ed1ff6mr10765448oic.3.1678745364267; Mon, 13
Mar 2023 15:09:24 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Mon, 13 Mar 2023 15:09:24 -0700 (PDT)
In-Reply-To: <4df247ce-ab0a-42d6-a666-2f1f13e6aff7n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:3d6f:cdc0:a721:7d15;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:3d6f:cdc0:a721:7d15
References: <6eae17c2-6644-4b6a-8d63-5af69bd63115n@googlegroups.com>
<b87dd9d4-0c9e-40d5-95f0-942d4d71c6c6n@googlegroups.com> <2db17fb4-7c79-4531-b4c5-4b2113794a5cn@googlegroups.com>
<46407a1f-f532-4147-830d-7010664f8216n@googlegroups.com> <4df247ce-ab0a-42d6-a666-2f1f13e6aff7n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c2dd6172-ff7f-410f-9948-9af99f0921e9n@googlegroups.com>
Subject: IEEE 754 Oddities
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Mon, 13 Mar 2023 22:09:24 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2064
 by: MitchAlsup - Mon, 13 Mar 2023 22:09 UTC

Does anyone know (¿ Terje, Ivan ?) why 754-2019 specifies::

5.2.1 remainder(x, ∞) is x for finite x.
6.1 remainder(subnormal, ∞) signals underflow.
<
6.1 seems to contradict 5.2.1
<
Plus the the n of:: r = x – y×n where n = nearest integer to x / y; and whenever
| x / y | = ½, n is even; n is not bound by a 64-bit container. And ∞×0 either
raises overflow or raises Operand prior to x – ∞×0 raising underflow.

Why is underflow specified instead of overflow or operation ???

And why is the result not just x as in 5.2.1 ???

Re: IEEE 754 Oddities

<tupc3e$8pl1$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=31184&group=comp.arch#31184

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: terje.ma...@tmsw.no (Terje Mathisen)
Newsgroups: comp.arch
Subject: Re: IEEE 754 Oddities
Date: Tue, 14 Mar 2023 09:43:26 +0100
Organization: A noiseless patient Spider
Lines: 28
Message-ID: <tupc3e$8pl1$1@dont-email.me>
References: <6eae17c2-6644-4b6a-8d63-5af69bd63115n@googlegroups.com>
<b87dd9d4-0c9e-40d5-95f0-942d4d71c6c6n@googlegroups.com>
<2db17fb4-7c79-4531-b4c5-4b2113794a5cn@googlegroups.com>
<46407a1f-f532-4147-830d-7010664f8216n@googlegroups.com>
<4df247ce-ab0a-42d6-a666-2f1f13e6aff7n@googlegroups.com>
<c2dd6172-ff7f-410f-9948-9af99f0921e9n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 14 Mar 2023 08:43:26 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="0f95966d2573c4cb0f221e8d81728f9b";
logging-data="288417"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/RoWu82GzcpzMBCAvK3+rr0Evb1gpYh7MapWSnXrgi6A=="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.15
Cancel-Lock: sha1:MD6OLhBkly3aWWcJH+PXPvGKFW0=
In-Reply-To: <c2dd6172-ff7f-410f-9948-9af99f0921e9n@googlegroups.com>
 by: Terje Mathisen - Tue, 14 Mar 2023 08:43 UTC

MitchAlsup wrote:
> Does anyone know (¿ Terje, Ivan ?) why 754-2019 specifies::
>
> 5.2.1 remainder(x, ∞) is x for finite x.
> 6.1 remainder(subnormal, ∞) signals underflow.

I _think_ this is just the normal rule: Subnormal result -> underflow.
> <
> 6.1 seems to contradict 5.2.1
> <
> Plus the the n of:: r = x – y×n where n = nearest integer to x / y; and whenever
> | x / y | = ½, n is even; n is not bound by a 64-bit container. And ∞×0 either
> raises overflow or raises Operand prior to x – ∞×0 raising underflow.
>
> Why is underflow specified instead of overflow or operation ???
>
> And why is the result not just x as in 5.2.1 ???
>

There are a few of these specific rules about exactly which borderline
operations deliver which signals/traps that I don't agree with, but this
is what the working group ended up with.

Terje

--
- <Terje.Mathisen at tmsw.no>
"almost all programming can be viewed as an exercise in caching"

Re: IEEE 754 Oddities

<tupe1q$924j$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=31185&group=comp.arch#31185

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: iva...@millcomputing.com (Ivan Godard)
Newsgroups: comp.arch
Subject: Re: IEEE 754 Oddities
Date: Tue, 14 Mar 2023 02:16:43 -0700
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <tupe1q$924j$1@dont-email.me>
References: <6eae17c2-6644-4b6a-8d63-5af69bd63115n@googlegroups.com>
<b87dd9d4-0c9e-40d5-95f0-942d4d71c6c6n@googlegroups.com>
<2db17fb4-7c79-4531-b4c5-4b2113794a5cn@googlegroups.com>
<46407a1f-f532-4147-830d-7010664f8216n@googlegroups.com>
<4df247ce-ab0a-42d6-a666-2f1f13e6aff7n@googlegroups.com>
<c2dd6172-ff7f-410f-9948-9af99f0921e9n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 14 Mar 2023 09:16:43 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="c1e1aa9a79bb4a9f4b350af10e78acec";
logging-data="297107"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19HsYJmbfIYuZNyuBkiS6fO"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.8.0
Cancel-Lock: sha1:4zLfLoS/YxSXZKF7X5sAyu6ORPA=
In-Reply-To: <c2dd6172-ff7f-410f-9948-9af99f0921e9n@googlegroups.com>
Content-Language: en-US
 by: Ivan Godard - Tue, 14 Mar 2023 09:16 UTC

On 3/13/2023 3:09 PM, MitchAlsup wrote:
> Does anyone know (¿ Terje, Ivan ?) why 754-2019 specifies::
>
> 5.2.1 remainder(x, ∞) is x for finite x.
> 6.1 remainder(subnormal, ∞) signals underflow.
> <
> 6.1 seems to contradict 5.2.1
> <
> Plus the the n of:: r = x – y×n where n = nearest integer to x / y; and whenever
> | x / y | = ½, n is even; n is not bound by a 64-bit container. And ∞×0 either
> raises overflow or raises Operand prior to x – ∞×0 raising underflow.
>
> Why is underflow specified instead of overflow or operation ???
>
> And why is the result not just x as in 5.2.1 ???

Beats me. Terje - wanna ask the 754s?

Re: IEEE 754 Oddities

<e55a91ca-f785-45e0-8882-49a2fc0c5137n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=31189&group=comp.arch#31189

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:600c:4746:b0:3eb:3912:2fa8 with SMTP id w6-20020a05600c474600b003eb39122fa8mr4832605wmo.8.1678839088922;
Tue, 14 Mar 2023 17:11:28 -0700 (PDT)
X-Received: by 2002:a9d:6090:0:b0:694:634:8fd8 with SMTP id
m16-20020a9d6090000000b0069406348fd8mr14033288otj.1.1678839088199; Tue, 14
Mar 2023 17:11:28 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.128.88.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Tue, 14 Mar 2023 17:11:27 -0700 (PDT)
In-Reply-To: <tupc3e$8pl1$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:4955:7da9:e2da:30cc;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:4955:7da9:e2da:30cc
References: <6eae17c2-6644-4b6a-8d63-5af69bd63115n@googlegroups.com>
<b87dd9d4-0c9e-40d5-95f0-942d4d71c6c6n@googlegroups.com> <2db17fb4-7c79-4531-b4c5-4b2113794a5cn@googlegroups.com>
<46407a1f-f532-4147-830d-7010664f8216n@googlegroups.com> <4df247ce-ab0a-42d6-a666-2f1f13e6aff7n@googlegroups.com>
<c2dd6172-ff7f-410f-9948-9af99f0921e9n@googlegroups.com> <tupc3e$8pl1$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e55a91ca-f785-45e0-8882-49a2fc0c5137n@googlegroups.com>
Subject: Re: IEEE 754 Oddities
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Wed, 15 Mar 2023 00:11:28 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: MitchAlsup - Wed, 15 Mar 2023 00:11 UTC

On Tuesday, March 14, 2023 at 3:43:30 AM UTC-5, Terje Mathisen wrote:
> MitchAlsup wrote:
> > Does anyone know (¿ Terje, Ivan ?) why 754-2019 specifies::
> >
> > 5.2.1 remainder(x, ∞) is x for finite x.
> > 6.1 remainder(subnormal, ∞) signals underflow.
BTW:: 2008 has the same wording.
> I _think_ this is just the normal rule: Subnormal result -> underflow.
> > <
> > 6.1 seems to contradict 5.2.1
> > <
> > Plus the the n of:: r = x – y×n where n = nearest integer to x / y; and whenever
> > | x / y | = ½, n is even; n is not bound by a 64-bit container. And ∞×0 either
> > raises overflow or raises Operand prior to x – ∞×0 raising underflow.
> >
> > Why is underflow specified instead of overflow or operation ???
> >
> > And why is the result not just x as in 5.2.1 ???
> >
> There are a few of these specific rules about exactly which borderline
> operations deliver which signals/traps that I don't agree with, but this
> is what the working group ended up with.
>
> Terje
>
> --
> - <Terje.Mathisen at tmsw.no>
> "almost all programming can be viewed as an exercise in caching"

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor