Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"It's not just a computer -- it's your ass." -- Cal Keegan


devel / comp.arch / Re: Configurable rounding modes (was The value of floating-point exceptions?)

SubjectAuthor
* The value of floating-point exceptions?Marcus
+* Re: The value of floating-point exceptions?Marcus
|`* Re: The value of floating-point exceptions?Stephen Fuld
| +- Re: The value of floating-point exceptions?Marcus
| `* Re: The value of floating-point exceptions?luke.l...@gmail.com
|  `- Re: The value of floating-point exceptions?BGB
+* Re: The value of floating-point exceptions?John Dallman
|+* Re: The value of floating-point exceptions?Marcus
||`* Re: The value of floating-point exceptions?John Dallman
|| +- Re: The value of floating-point exceptions?MitchAlsup
|| `* Re: The value of floating-point exceptions?Quadibloc
||  `* Re: The value of floating-point exceptions?MitchAlsup
||   +* Re: The value of floating-point exceptions?Marcus
||   |+* Re: The value of floating-point exceptions?Ivan Godard
||   ||`* Re: The value of floating-point exceptions?Quadibloc
||   || +* Re: The value of floating-point exceptions?Ivan Godard
||   || |+* Re: The value of floating-point exceptions?Anton Ertl
||   || ||`* Re: The value of floating-point exceptions?MitchAlsup
||   || || `- Re: The value of floating-point exceptions?Quadibloc
||   || |`- Re: The value of floating-point exceptions?Terje Mathisen
||   || `* Re: The value of floating-point exceptions?MitchAlsup
||   ||  +* Re: The value of floating-point exceptions?Quadibloc
||   ||  |+* Re: The value of floating-point exceptions?MitchAlsup
||   ||  ||+- Re: The value of floating-point exceptions?BGB
||   ||  ||`* Re: The value of floating-point exceptions?Terje Mathisen
||   ||  || `* Re: The value of floating-point exceptions?BGB
||   ||  ||  `* Re: The value of floating-point exceptions?MitchAlsup
||   ||  ||   +* Re: The value of floating-point exceptions?Ivan Godard
||   ||  ||   |+* Re: The value of floating-point exceptions?BGB
||   ||  ||   ||`* Re: The value of floating-point exceptions?Terje Mathisen
||   ||  ||   || `- Re: The value of floating-point exceptions?BGB
||   ||  ||   |+* Re: The value of floating-point exceptions?MitchAlsup
||   ||  ||   ||`* Re: The value of floating-point exceptions?Marcus
||   ||  ||   || `- Re: The value of floating-point exceptions?BGB
||   ||  ||   |`* Re: The value of floating-point exceptions?EricP
||   ||  ||   | `* Re: The value of floating-point exceptions?Ivan Godard
||   ||  ||   |  `* Re: The value of floating-point exceptions?MitchAlsup
||   ||  ||   |   +* Re: Configurable rounding modes (was The value of floating-pointMarcus
||   ||  ||   |   |+- Re: Configurable rounding modes (was The value of floating-pointTerje Mathisen
||   ||  ||   |   |`* Re: Configurable rounding modes (was The value of floating-point exceptions?)MitchAlsup
||   ||  ||   |   | +- Re: Configurable rounding modes (was The value of floating-pointStephen Fuld
||   ||  ||   |   | `- Re: Configurable rounding modes (was The value of floating-pointMarcus
||   ||  ||   |   `* Re: The value of floating-point exceptions?EricP
||   ||  ||   |    `* Re: The value of floating-point exceptions?MitchAlsup
||   ||  ||   |     `- Re: The value of floating-point exceptions?Quadibloc
||   ||  ||   +* Re: The value of floating-point exceptions?Quadibloc
||   ||  ||   |`* Re: The value of floating-point exceptions?MitchAlsup
||   ||  ||   | `- Re: The value of floating-point exceptions?Quadibloc
||   ||  ||   `* Re: The value of floating-point exceptions?Marcus
||   ||  ||    +* Re: The value of floating-point exceptions?Thomas Koenig
||   ||  ||    |`* Re: The value of floating-point exceptions?MitchAlsup
||   ||  ||    | `- Re: The value of floating-point exceptions?Thomas Koenig
||   ||  ||    +* Re: The value of floating-point exceptions?MitchAlsup
||   ||  ||    |+* Re: The value of floating-point exceptions?Ivan Godard
||   ||  ||    ||`- Re: The value of floating-point exceptions?BGB
||   ||  ||    |+* Re: The value of floating-point exceptions?Quadibloc
||   ||  ||    ||`* Re: The value of floating-point exceptions?MitchAlsup
||   ||  ||    || +* Re: The value of floating-point exceptions?Ivan Godard
||   ||  ||    || |`* Re: The value of floating-point exceptions?MitchAlsup
||   ||  ||    || | `* Re: The value of floating-point exceptions?Ivan Godard
||   ||  ||    || |  +* Re: The value of floating-point exceptions?MitchAlsup
||   ||  ||    || |  |`- Re: The value of floating-point exceptions?Ivan Godard
||   ||  ||    || |  `* Re: The value of floating-point exceptions?Marcus
||   ||  ||    || |   +- Re: The value of floating-point exceptions?Quadibloc
||   ||  ||    || |   +* Re: The value of floating-point exceptions?Anton Ertl
||   ||  ||    || |   |`* Re: The value of floating-point exceptions?Michael S
||   ||  ||    || |   | `* Re: The value of floating-point exceptions?MitchAlsup
||   ||  ||    || |   |  `- Re: The value of floating-point exceptions?Terje Mathisen
||   ||  ||    || |   `* Re: The value of floating-point exceptions?Quadibloc
||   ||  ||    || |    +- Re: The value of floating-point exceptions?Quadibloc
||   ||  ||    || |    `* Re: The value of floating-point exceptions?Marcus
||   ||  ||    || |     `* Re: The value of floating-point exceptions?MitchAlsup
||   ||  ||    || |      `* Re: The value of floating-point exceptions?Marcus
||   ||  ||    || |       `- Re: The value of floating-point exceptions?MitchAlsup
||   ||  ||    || `- Re: Configurable rounding modes (was The value of floating-pointMarcus
||   ||  ||    |`* Re: Configurable rounding modes (was The value of floating-pointMarcus
||   ||  ||    | +* Re: Configurable rounding modes (was The value of floating-point exceptions?)MitchAlsup
||   ||  ||    | |`* Re: Configurable rounding modes (was The value of floating-pointIvan Godard
||   ||  ||    | | +* Re: Configurable rounding modes (was The value of floating-pointBGB
||   ||  ||    | | |`* Re: Configurable rounding modes (was The value of floating-pointMarcus
||   ||  ||    | | | `- Re: Configurable rounding modes (was The value of floating-pointBGB
||   ||  ||    | | +* Re: Configurable rounding modes (was The value of floating-point exceptions?)Quadibloc
||   ||  ||    | | |+- Re: Configurable rounding modes (was The value of floating-point exceptions?)Quadibloc
||   ||  ||    | | |`* Re: Configurable rounding modes (was The value of floating-pointIvan Godard
||   ||  ||    | | | `- Re: Configurable rounding modes (was The value of floating-point exceptions?)Quadibloc
||   ||  ||    | | `* Re: Configurable rounding modes (was The value of floating-point exceptions?)MitchAlsup
||   ||  ||    | |  `* Re: Configurable rounding modes (was The value of floating-pointIvan Godard
||   ||  ||    | |   `* Re: Configurable rounding modes (was The value of floating-point exceptions?)Quadibloc
||   ||  ||    | |    `* Re: Configurable rounding modes (was The value of floating-point exceptions?)Quadibloc
||   ||  ||    | |     +- Re: Configurable rounding modes (was The value of floating-point exceptions?)Quadibloc
||   ||  ||    | |     `- Re: Configurable rounding modes (was The value of floating-point exceptions?)Quadibloc
||   ||  ||    | `* Re: Configurable rounding modes (was The value of floating-pointBGB
||   ||  ||    |  `* Re: Configurable rounding modes (was The value of floating-point exceptions?)MitchAlsup
||   ||  ||    |   `- Re: Configurable rounding modes (was The value of floating-pointBGB
||   ||  ||    `* Re: The value of floating-point exceptions?antispam
||   ||  ||     +- Re: The value of floating-point exceptions?BGB
||   ||  ||     +* Re: The value of floating-point exceptions?Terje Mathisen
||   ||  ||     |+- Re: The value of floating-point exceptions?BGB
||   ||  ||     |`* Re: The value of floating-point exceptions?antispam
||   ||  ||     | `* Re: The value of floating-point exceptions?Quadibloc
||   ||  ||     |  +* Re: The value of floating-point exceptions?antispam
||   ||  ||     |  `* Re: The value of floating-point exceptions?MitchAlsup
||   ||  ||     `- Re: The value of floating-point exceptions?John Dallman
||   ||  |`* Re: The value of floating-point exceptions?John Dallman
||   ||  +* Re: The value of floating-point exceptions?Quadibloc
||   ||  `* Re: The value of floating-point exceptions?Thomas Koenig
||   |`* Re: The value of floating-point exceptions?Quadibloc
||   `- Re: The value of floating-point exceptions?Quadibloc
|`* Re: The value of floating-point exceptions?Marcus
+- Re: The value of floating-point exceptions?Terje Mathisen
+* Re: The value of floating-point exceptions?Ivan Godard
+- Re: The value of floating-point exceptions?BGB
+* Re: The value of floating-point exceptions?EricP
+* Re: The value of floating-point exceptions?Anton Ertl
+* Re: The value of floating-point exceptions?MitchAlsup
`- Re: The value of floating-point exceptions?antispam

Pages:12345678910
Re: The value of floating-point exceptions?

<48d7c07e-2684-4eb8-a480-a40664c48493n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:ac8:5645:: with SMTP id 5mr17137831qtt.200.1627340172351;
Mon, 26 Jul 2021 15:56:12 -0700 (PDT)
X-Received: by 2002:a05:6808:158a:: with SMTP id t10mr921837oiw.175.1627340172084;
Mon, 26 Jul 2021 15:56:12 -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: Mon, 26 Jul 2021 15:56:11 -0700 (PDT)
In-Reply-To: <1f8827fe-a288-4f2e-8e4e-40cc343febbdn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:56a:f39a:d100:c5e7:4ad0:c272:23c9;
posting-account=1nOeKQkAAABD2jxp4Pzmx9Hx5g9miO8y
NNTP-Posting-Host: 2001:56a:f39a:d100:c5e7:4ad0:c272:23c9
References: <sd9a9h$ro6$1@dont-email.me> <memo.20210721153537.10680P@jgd.cix.co.uk>
<e9c738bd-7c0e-4b3b-9385-3a0d0658b059n@googlegroups.com> <a74c6bf2-9ad1-4969-b3cb-b650ae8ebdadn@googlegroups.com>
<sde6m7$kr1$1@dont-email.me> <sde74m$nio$1@dont-email.me> <7cf5713e-f138-488b-9ccf-d85df84c50can@googlegroups.com>
<e7e0b9a2-7990-4ec8-9c40-a6e9a07bd306n@googlegroups.com> <fc5a33d0-7c17-4855-8ab3-162884bd6b7bn@googlegroups.com>
<713a35af-9cce-4954-b968-1b4b754e7b1en@googlegroups.com> <sdjghd$1i4a$1@gioia.aioe.org>
<sdk2kd$lu1$1@dont-email.me> <476a9f6b-5fa0-4606-aed6-cf31089b8c5bn@googlegroups.com>
<sdlo5n$da3$1@dont-email.me> <1f8827fe-a288-4f2e-8e4e-40cc343febbdn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <48d7c07e-2684-4eb8-a480-a40664c48493n@googlegroups.com>
Subject: Re: The value of floating-point exceptions?
From: jsav...@ecn.ab.ca (Quadibloc)
Injection-Date: Mon, 26 Jul 2021 22:56:12 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Quadibloc - Mon, 26 Jul 2021 22:56 UTC

On Monday, July 26, 2021 at 10:19:32 AM UTC-6, MitchAlsup wrote:

> Given that they cannot be in a GPR or an FPR, Oh wise one,
> Where would you put them ?

Given the nature of his complaints, obviously there is no other choice
but to put the rounding mode in the instruction. If that is annoying,
then only have the rounding mode specified in a special longer form of
the instructions, with the normal form of the instruction always using the
default rounding mode (usually round to nearest, presumably in a status
register, _but only alterable there by a privileged instruction_).

That's how I'd cope with what he wants, given that you are correct that
there's no place to put the rounding mode in currently well-known architectures
that comports well with what he wants to do.

John Savard

Re: The value of floating-point exceptions?

<922f7388-1131-45c1-a8ef-cb4e61fbc4f1n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:ac8:7207:: with SMTP id a7mr17479149qtp.32.1627346350946;
Mon, 26 Jul 2021 17:39:10 -0700 (PDT)
X-Received: by 2002:aca:ac46:: with SMTP id v67mr12644092oie.99.1627346350670;
Mon, 26 Jul 2021 17:39:10 -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: Mon, 26 Jul 2021 17:39:10 -0700 (PDT)
In-Reply-To: <48d7c07e-2684-4eb8-a480-a40664c48493n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:a168:359b:a6c6:288b;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:a168:359b:a6c6:288b
References: <sd9a9h$ro6$1@dont-email.me> <memo.20210721153537.10680P@jgd.cix.co.uk>
<e9c738bd-7c0e-4b3b-9385-3a0d0658b059n@googlegroups.com> <a74c6bf2-9ad1-4969-b3cb-b650ae8ebdadn@googlegroups.com>
<sde6m7$kr1$1@dont-email.me> <sde74m$nio$1@dont-email.me> <7cf5713e-f138-488b-9ccf-d85df84c50can@googlegroups.com>
<e7e0b9a2-7990-4ec8-9c40-a6e9a07bd306n@googlegroups.com> <fc5a33d0-7c17-4855-8ab3-162884bd6b7bn@googlegroups.com>
<713a35af-9cce-4954-b968-1b4b754e7b1en@googlegroups.com> <sdjghd$1i4a$1@gioia.aioe.org>
<sdk2kd$lu1$1@dont-email.me> <476a9f6b-5fa0-4606-aed6-cf31089b8c5bn@googlegroups.com>
<sdlo5n$da3$1@dont-email.me> <1f8827fe-a288-4f2e-8e4e-40cc343febbdn@googlegroups.com>
<48d7c07e-2684-4eb8-a480-a40664c48493n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <922f7388-1131-45c1-a8ef-cb4e61fbc4f1n@googlegroups.com>
Subject: Re: The value of floating-point exceptions?
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Tue, 27 Jul 2021 00:39:10 +0000
Content-Type: text/plain; charset="UTF-8"
 by: MitchAlsup - Tue, 27 Jul 2021 00:39 UTC

On Monday, July 26, 2021 at 5:56:13 PM UTC-5, Quadibloc wrote:
> On Monday, July 26, 2021 at 10:19:32 AM UTC-6, MitchAlsup wrote:
>
> > Given that they cannot be in a GPR or an FPR, Oh wise one,
> > Where would you put them ?
<
> Given the nature of his complaints, obviously there is no other choice
> but to put the rounding mode in the instruction. If that is annoying,
> then only have the rounding mode specified in a special longer form of
> the instructions, with the normal form of the instruction always using the
> default rounding mode (usually round to nearest, presumably in a status
> register, _but only alterable there by a privileged instruction_).
<
Imagine Kahan wanting to do something like the following to test the
sensitivity to rounding::
<
for( i = 0 i < max i+=4 )
{
setRoundingMode(rm[i]);
a = b + c;
setRoundingMode(rm[i+1]);
d = a * f;
setRoundingMode(rm[i+2]);
b = d / g;
setRoundingMode(rm[i+4]);
c = sqrt( d*b );
}
Where rm is originally read in from a file. Show me how you put the rounding
mode exclusively in the instruction and have no other place in the machine
holding RM state ?
<
>
> That's how I'd cope with what he wants, given that you are correct that
> there's no place to put the rounding mode in currently well-known architectures
> that comports well with what he wants to do.
<
Using a longer version of an instruction is not as bad an idea as have been
recently expressed herein.
>
> John Savard

Re: The value of floating-point exceptions?

<91b95806-d901-48db-912d-0b0e5c119f9fn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:6214:d46:: with SMTP id 6mr17926922qvr.36.1627362813566;
Mon, 26 Jul 2021 22:13:33 -0700 (PDT)
X-Received: by 2002:aca:3094:: with SMTP id w142mr12274504oiw.37.1627362813200;
Mon, 26 Jul 2021 22:13:33 -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: Mon, 26 Jul 2021 22:13:33 -0700 (PDT)
In-Reply-To: <sdj9rq$ue1$2@newsreader4.netcologne.de>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:56a:f39a:d100:a85a:4a91:76f4:fa6e;
posting-account=1nOeKQkAAABD2jxp4Pzmx9Hx5g9miO8y
NNTP-Posting-Host: 2001:56a:f39a:d100:a85a:4a91:76f4:fa6e
References: <sd9a9h$ro6$1@dont-email.me> <memo.20210721153537.10680P@jgd.cix.co.uk>
<e9c738bd-7c0e-4b3b-9385-3a0d0658b059n@googlegroups.com> <a74c6bf2-9ad1-4969-b3cb-b650ae8ebdadn@googlegroups.com>
<sde6m7$kr1$1@dont-email.me> <sde74m$nio$1@dont-email.me> <7cf5713e-f138-488b-9ccf-d85df84c50can@googlegroups.com>
<e7e0b9a2-7990-4ec8-9c40-a6e9a07bd306n@googlegroups.com> <sdf4t3$6cl$2@newsreader4.netcologne.de>
<c0917435-65c8-45f1-b745-5fd7ff4f58c0n@googlegroups.com> <548e3590-e939-40b7-8f78-3040d59358f7n@googlegroups.com>
<sdj9rq$ue1$2@newsreader4.netcologne.de>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <91b95806-d901-48db-912d-0b0e5c119f9fn@googlegroups.com>
Subject: Re: The value of floating-point exceptions?
From: jsav...@ecn.ab.ca (Quadibloc)
Injection-Date: Tue, 27 Jul 2021 05:13:33 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Quadibloc - Tue, 27 Jul 2021 05:13 UTC

On Sunday, July 25, 2021 at 3:11:25 AM UTC-6, Thomas Koenig wrote:

> There are ample examples how to deal with a 36-bit words:
> The IBM 701 and following and the PDP-10, for example.

Oh, that's true.

But the IBM 360, with base registers, supported a much larger
address space - 24 bits from the beginning, 31 bits trivially, and
it was easily upgraded to go 64 bits.

And since I was responding to a comment about how the IBM
360 having 32-bit single precision floats made it unsatisfactory
compared to the existing machines with 36, 48, and 60 bit
single precision... I thought it useful to imagine how, with
_minimal_ changes, the IBM 360 architecture could be altered
to use 36 bit words and 9 bit bytes instead.

A while back, there was a discussion of base-3 logic. While
I didn't think that would ever fly, I thought that using base 3
for the pins of memory modules - so that two wires could carry
3 bits, with one of the 9 combinations unused - might be a
good idea.

That would be simpler than GDDR6x, which almost requires
a mini-A/D converter on each data pin!

The trouble is, though, that memory modules that contain
96-bit memory lines are less easily used in our power-of-two
world.

But now I've figured out how DDR4w, as we might call it,
w because it's one less than x, 3 instead of 4 signal levels...
could be useful.

Have a three-channel memory built up of DDR4w modules.

Now we have a factor of 3 due to the memory, and another
factor of 3 due to the number of channels. So one could
build a computer built around a 36-bit word, and yet it could
use ordinary sockets for ordinary-looking memory modules!

And use five-channel memory if you want a computer with a
60-bit word, or single, double, or quad channel for a 48-bit
word!!

Suddenly, diversity is returned to the world of the computer,
and the tyranny of the 8-bit byte is ended!!

Of course, this depends on DDR4 having at least one unused
pin, that could be put to use for the negative power supply...

John Savard

Re: The value of floating-point exceptions?

<95b1c11a-0e6f-49e7-91f9-44d7b133753en@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:ac8:73c9:: with SMTP id v9mr17867881qtp.214.1627363495164;
Mon, 26 Jul 2021 22:24:55 -0700 (PDT)
X-Received: by 2002:a9d:5603:: with SMTP id e3mr14058219oti.178.1627363494965;
Mon, 26 Jul 2021 22:24:54 -0700 (PDT)
Path: i2pn2.org!i2pn.org!paganini.bofh.team!usenet.pasdenom.info!usenet-fr.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: Mon, 26 Jul 2021 22:24:54 -0700 (PDT)
In-Reply-To: <91b95806-d901-48db-912d-0b0e5c119f9fn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:56a:f39a:d100:a85a:4a91:76f4:fa6e;
posting-account=1nOeKQkAAABD2jxp4Pzmx9Hx5g9miO8y
NNTP-Posting-Host: 2001:56a:f39a:d100:a85a:4a91:76f4:fa6e
References: <sd9a9h$ro6$1@dont-email.me> <memo.20210721153537.10680P@jgd.cix.co.uk>
<e9c738bd-7c0e-4b3b-9385-3a0d0658b059n@googlegroups.com> <a74c6bf2-9ad1-4969-b3cb-b650ae8ebdadn@googlegroups.com>
<sde6m7$kr1$1@dont-email.me> <sde74m$nio$1@dont-email.me> <7cf5713e-f138-488b-9ccf-d85df84c50can@googlegroups.com>
<e7e0b9a2-7990-4ec8-9c40-a6e9a07bd306n@googlegroups.com> <sdf4t3$6cl$2@newsreader4.netcologne.de>
<c0917435-65c8-45f1-b745-5fd7ff4f58c0n@googlegroups.com> <548e3590-e939-40b7-8f78-3040d59358f7n@googlegroups.com>
<sdj9rq$ue1$2@newsreader4.netcologne.de> <91b95806-d901-48db-912d-0b0e5c119f9fn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <95b1c11a-0e6f-49e7-91f9-44d7b133753en@googlegroups.com>
Subject: Re: The value of floating-point exceptions?
From: jsav...@ecn.ab.ca (Quadibloc)
Injection-Date: Tue, 27 Jul 2021 05:24:55 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Quadibloc - Tue, 27 Jul 2021 05:24 UTC

On Monday, July 26, 2021 at 11:13:34 PM UTC-6, Quadibloc wrote:

> Of course, this depends on DDR4 having at least one unused
> pin, that could be put to use for the negative power supply...

I see that all 288 pins are in use.

There are an enormous number of pins used for VSS, but that's
ground.

One could use half of the pins used for VPP for the negative
logic voltage, but that would be a *big* incompatibility; one
ought to at least put the notch in a different place if one
did that! And if that was done, one might as well add pins.

John Savard

Re: The value of floating-point exceptions?

<2f3aee04-2cbb-4246-9f32-aa37f966c607n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:6214:f66:: with SMTP id iy6mr18155583qvb.58.1627363879513;
Mon, 26 Jul 2021 22:31:19 -0700 (PDT)
X-Received: by 2002:a05:6808:1494:: with SMTP id e20mr1713957oiw.122.1627363879281;
Mon, 26 Jul 2021 22:31:19 -0700 (PDT)
Path: i2pn2.org!i2pn.org!paganini.bofh.team!news.dns-netz.com!news.freedyn.net!newsfeed.xs4all.nl!newsfeed9.news.xs4all.nl!news-out.netnews.com!news.alt.net!fdc2.netnews.com!peer01.ams1!peer.ams1.xlned.com!news.xlned.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, 26 Jul 2021 22:31:19 -0700 (PDT)
In-Reply-To: <95b1c11a-0e6f-49e7-91f9-44d7b133753en@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:56a:f39a:d100:a85a:4a91:76f4:fa6e;
posting-account=1nOeKQkAAABD2jxp4Pzmx9Hx5g9miO8y
NNTP-Posting-Host: 2001:56a:f39a:d100:a85a:4a91:76f4:fa6e
References: <sd9a9h$ro6$1@dont-email.me> <memo.20210721153537.10680P@jgd.cix.co.uk>
<e9c738bd-7c0e-4b3b-9385-3a0d0658b059n@googlegroups.com> <a74c6bf2-9ad1-4969-b3cb-b650ae8ebdadn@googlegroups.com>
<sde6m7$kr1$1@dont-email.me> <sde74m$nio$1@dont-email.me> <7cf5713e-f138-488b-9ccf-d85df84c50can@googlegroups.com>
<e7e0b9a2-7990-4ec8-9c40-a6e9a07bd306n@googlegroups.com> <sdf4t3$6cl$2@newsreader4.netcologne.de>
<c0917435-65c8-45f1-b745-5fd7ff4f58c0n@googlegroups.com> <548e3590-e939-40b7-8f78-3040d59358f7n@googlegroups.com>
<sdj9rq$ue1$2@newsreader4.netcologne.de> <91b95806-d901-48db-912d-0b0e5c119f9fn@googlegroups.com>
<95b1c11a-0e6f-49e7-91f9-44d7b133753en@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2f3aee04-2cbb-4246-9f32-aa37f966c607n@googlegroups.com>
Subject: Re: The value of floating-point exceptions?
From: jsav...@ecn.ab.ca (Quadibloc)
Injection-Date: Tue, 27 Jul 2021 05:31:19 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2534
 by: Quadibloc - Tue, 27 Jul 2021 05:31 UTC

On Monday, July 26, 2021 at 11:24:56 PM UTC-6, Quadibloc wrote:

> One could use half of the pins used for VPP for the negative
> logic voltage, but that would be a *big* incompatibility; one
> ought to at least put the notch in a different place if one
> did that! And if that was done, one might as well add pins.

Actually it's VDD that's the logic 1 voltage. There are 26 pins
used for that, as against only 4 pins that are marked as not
connected. (An RFU abbreviation for Reserved for Future
Use was defined, but I could see no pins so labelled.)

So going to negative voltage instead of half voltage for the
third state would require a major redesign, not a tiny
change that was almost un-noticeable.

John Savard

Re: The value of floating-point exceptions?

<sdog27$jc1$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: iva...@millcomputing.com (Ivan Godard)
Newsgroups: comp.arch
Subject: Re: The value of floating-point exceptions?
Date: Tue, 27 Jul 2021 01:27:50 -0700
Organization: A noiseless patient Spider
Lines: 45
Message-ID: <sdog27$jc1$1@dont-email.me>
References: <sd9a9h$ro6$1@dont-email.me>
<memo.20210721153537.10680P@jgd.cix.co.uk>
<e9c738bd-7c0e-4b3b-9385-3a0d0658b059n@googlegroups.com>
<a74c6bf2-9ad1-4969-b3cb-b650ae8ebdadn@googlegroups.com>
<sde6m7$kr1$1@dont-email.me> <sde74m$nio$1@dont-email.me>
<7cf5713e-f138-488b-9ccf-d85df84c50can@googlegroups.com>
<e7e0b9a2-7990-4ec8-9c40-a6e9a07bd306n@googlegroups.com>
<fc5a33d0-7c17-4855-8ab3-162884bd6b7bn@googlegroups.com>
<713a35af-9cce-4954-b968-1b4b754e7b1en@googlegroups.com>
<sdjghd$1i4a$1@gioia.aioe.org> <sdk2kd$lu1$1@dont-email.me>
<476a9f6b-5fa0-4606-aed6-cf31089b8c5bn@googlegroups.com>
<sdlo5n$da3$1@dont-email.me>
<1f8827fe-a288-4f2e-8e4e-40cc343febbdn@googlegroups.com>
<48d7c07e-2684-4eb8-a480-a40664c48493n@googlegroups.com>
<922f7388-1131-45c1-a8ef-cb4e61fbc4f1n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 27 Jul 2021 08:27:51 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="6df56d348e3c793ead0a8bd16f950eb3";
logging-data="19841"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+73TDCM5RJa2b27pjmuRjW"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.12.0
Cancel-Lock: sha1:OWWZSh4aXwfAmpX/snl/ZikZmcA=
In-Reply-To: <922f7388-1131-45c1-a8ef-cb4e61fbc4f1n@googlegroups.com>
Content-Language: en-US
 by: Ivan Godard - Tue, 27 Jul 2021 08:27 UTC

On 7/26/2021 5:39 PM, MitchAlsup wrote:
> On Monday, July 26, 2021 at 5:56:13 PM UTC-5, Quadibloc wrote:
>> On Monday, July 26, 2021 at 10:19:32 AM UTC-6, MitchAlsup wrote:
>>
>>> Given that they cannot be in a GPR or an FPR, Oh wise one,
>>> Where would you put them ?
> <
>> Given the nature of his complaints, obviously there is no other choice
>> but to put the rounding mode in the instruction. If that is annoying,
>> then only have the rounding mode specified in a special longer form of
>> the instructions, with the normal form of the instruction always using the
>> default rounding mode (usually round to nearest, presumably in a status
>> register, _but only alterable there by a privileged instruction_).
> <
> Imagine Kahan wanting to do something like the following to test the
> sensitivity to rounding::
> <
> for( i = 0 i < max i+=4 )
> {
> setRoundingMode(rm[i]);
> a = b + c;
> setRoundingMode(rm[i+1]);
> d = a * f;
> setRoundingMode(rm[i+2]);
> b = d / g;
> setRoundingMode(rm[i+4]);
> c = sqrt( d*b );
> }
> Where rm is originally read in from a file. Show me how you put the rounding
> mode exclusively in the instruction and have no other place in the machine
> holding RM state ?

That's why "from specReg" is one of our available static choices; the
user who chooses that is accepting the SIMD/call/task/etc issues, thinks
he knows what he is doing, and deserves it. The default for the less
witting is static RNE.

But the real problem with your example is linguistic: the notation
itself implies that the mode is a variable, even if the argument to
setRoundingMode is a literal. Change the notation to:
withMode<RNA>{ doSomething(); }
or even:
mode dyn; f >> dyn;
withMode<dynamic(dyn)>{ doSomething(); }
and most of the issues go away, even if you really want dynamic.

Re: Configurable rounding modes (was The value of floating-point exceptions?)

<sdol45$69t$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: m.del...@this.bitsnbites.eu (Marcus)
Newsgroups: comp.arch
Subject: Re: Configurable rounding modes (was The value of floating-point
exceptions?)
Date: Tue, 27 Jul 2021 11:54:12 +0200
Organization: A noiseless patient Spider
Lines: 212
Message-ID: <sdol45$69t$1@dont-email.me>
References: <sd9a9h$ro6$1@dont-email.me>
<memo.20210721153537.10680P@jgd.cix.co.uk>
<e9c738bd-7c0e-4b3b-9385-3a0d0658b059n@googlegroups.com>
<a74c6bf2-9ad1-4969-b3cb-b650ae8ebdadn@googlegroups.com>
<sde6m7$kr1$1@dont-email.me> <sde74m$nio$1@dont-email.me>
<7cf5713e-f138-488b-9ccf-d85df84c50can@googlegroups.com>
<e7e0b9a2-7990-4ec8-9c40-a6e9a07bd306n@googlegroups.com>
<fc5a33d0-7c17-4855-8ab3-162884bd6b7bn@googlegroups.com>
<713a35af-9cce-4954-b968-1b4b754e7b1en@googlegroups.com>
<sdjghd$1i4a$1@gioia.aioe.org> <sdk2kd$lu1$1@dont-email.me>
<476a9f6b-5fa0-4606-aed6-cf31089b8c5bn@googlegroups.com>
<sdlo5n$da3$1@dont-email.me>
<1f8827fe-a288-4f2e-8e4e-40cc343febbdn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 27 Jul 2021 09:54:13 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="aac6d43ec1da3802e0438f21242ccc52";
logging-data="6461"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX181eS7s2InxovGKyMzqi5iBaPeQqIkElvA="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:hPPQ62yf+Fo9lF6T61QHc0ODVN0=
In-Reply-To: <1f8827fe-a288-4f2e-8e4e-40cc343febbdn@googlegroups.com>
Content-Language: en-US
 by: Marcus - Tue, 27 Jul 2021 09:54 UTC

On 2021-07-26 18:19, MitchAlsup wrote:
> On Monday, July 26, 2021 at 2:27:54 AM UTC-5, Marcus wrote:
>> On 2021-07-25 19:22, MitchAlsup wrote:
>>> On Sunday, July 25, 2021 at 11:14:08 AM UTC-5, BGB wrote:
>>>> On 7/25/2021 6:05 AM, Terje Mathisen wrote:
>>>>> MitchAlsup wrote:
>>>>>> Having watched this from inside:
>>>>>> a) HW designers know a lot more about this today than in 1980
>>>>>> b) even systems that started out as IEEE-format gradually went
>>>>>> closer and closer to full IEEE-compliant (GPUs) until there is no
>>>>>> useful difference in the quality of the arithmetic.
>>>>>> c) once 754-2009 came out the overhead to do denorms went to
>>>>>> zero, and there is no reason to avoid full speed denorms in practice.
>>>>>> (BGB's small FPGA prototyping environment aside.)
>>>>>
>>>>> I agree.
>>>>>
>>>>>> d) HW designers have learned how to perform all of the rounding
>>>>>> modes at no overhead compared to RNE.
>>>>>
>>>>> This is actually dead easy since all the other modes are easier than
>>>>> RNE: As soon as you have all four bits required for RNE (i.e.
>>>>> sign/ulp/guard/sticky) then the remaining rounding modes only need
>>>>> various subsets of these, so you use the rounding mode to route one of 5
>>>>> or 6 possible 16-entry one-bit lookup tables into the rounding circuit
>>>>> where it becomes the input to be added into the ulp position of the
>>>>> final packed (sign/exp/mantissa) fp result.
>>>>>
>>>> Oddly enough, the extra cost to rounding itself is not the main issue
>>>> with multiple rounding modes, but more the question of how the bits get
>>>> there (if one doesn't already have an FPU status register or similar).
>>>>
>>>> Granted, could in theory put these bits in SR or similar, but, yeah...
>>>>
>>>> It would be better IMO if it were part of the instruction, but there
>>>> isn't really any good / non-annoying way to encode this.
>>> <
>>> And this is why they are put in control/status registers.
>>> <
>> There are several problems with this, but the *main* problem is that the
>> rounding mode setting becomes a super-global variable.
> <
> Given that they cannot be in a GPR or an FPR, Oh wise one,
> Where would you put them ?
> <

At the same place that we specify the floating-point precision: in the
instruction.

>> If one subroutine
>> touches the register, it affects all code in the same thread. And it's
>> "super-global" because it crosses source code and language barriers
> <
> But does not cross thread or task boundaries. So its not "like memory" either.
> <
>> (e.g. consider a program written in Go that has a Python scripting back
>> end that calls out to a DLL that is written in C++ that changes the
>> floating-point rounding mode...).
>>
>> As I have accounted for elsewhere, this is a real problem. As a SW
>> developer I therefore prefer to work with architectures that do not have
>> an FPU control register - /even/ if that means that I can only use RNE
>> (because let's face it - that's the only rounding mode I'm ever going
>> to use anyway).
> <
> So you discount libraries that may contain interval arithmetic or properly
> rounded transcendentals ?

You might have misunderstood my point. As a software developer, if I
have a choice between:

1. Rounding mode is configured in a thread global register.
2. Rounding mode is always RNE.

....then I pick 2, because that gives me 100% predictable results,
whereas with 1 all bets are off (read my other examples as to why this
is the case).

*However*, if there is also the option:

3. Rounding mode is part of the instruction.

....then I pick 3.

>>
>> Having the rounding modes as part of the instruction is *much* better
>> from a SW developer's perspective - but that blows up opcode space for
>> a feature that is never used.
> <
> And there are cases where this philosophy would blow up code space
> when they were used. Does the compiler have to generate code for
> foo() in RNE, and RTPI and RTNI, and RTZ, and RTMAG modes?

Does the compiler have to generate code for foo() in binary16, binary32,
binary64 and binary128? No. The developer selects the precision and
rounding mode(s). The developer knows what rounding mode to use for a
particular algorithm.

>>
>> Perhaps your prefix instruction paradigm could be used for this (e.g.
>> like "CARRY")?
> <
> If I wanted 'per instruction RMs' this would be how I did it. A CARRY-like
> RM-instruction-modifier could cast RM over 5-ish subsequent instructions.

Sounds reasonable.

>>
>>> < Probably the
>>>> "least awful" would probably be to use an Op64 encoding, which then uses
>>>> some of the Immed extension bits to encode a rounding mode.
>>> <
>>> The argument against having them in instructions is that this prevents
>>> someone from running the code several times with different rounding
>>> modes set to detect any sensitivity to the actually chosen rounding mode.
>>> Kahan said he uses this a lot.
>>
>> ......let me question the usefulness of that. If I were to do such
>> experiments I would just compile the algorithm with different rounding
>> modes set explicitly (e.g. as a C++ template argument or something).
> <
> So you would end up with 5 copies of FPPPP, one for each rounding mode
> (at the cost of 8KĂ—sizeof(inst) per rounding mode = 32KB/mode = 165KB)
> ??!!?

The use case given here sounds like it has more to do with experimenting
with different settings than to actually generate production code. As
such it would be easy to just re-compile the source code with different
rounding mode settings. I occasionally do this when experimenting with
different floating-point precisions (usually single precision vs
double-precision), e.g. using a C DEFINE.

>>
>>>>
>>>>
>>>> * FFw0_00ii_F0nm_5eo8 FADD Rm, Ro, Rn, Imm8
>>>> * FFw0_00ii_F0nm_5eo9 FSUB Rm, Ro, Rn, Imm8
>>>> * FFw0_00ii_F0nm_5eoA FMUL Rm, Ro, Rn, Imm8
>>>>
>>>> Where the Imm8 field encodes the rounding mode, say:
>>>> 00 = Round to Nearest.
>>>> 01 = Truncate.
>>>>
>>>> Or could go the SR route, but I don't want FPU behavior to depend on SR.
>>> <
>>> When one has multi-threading and control/status register, one simply
>>> reads the RM field and delivers it to the FU as an operand. A couple
>>> of interlock checks means you don't really have to stall the pipeline
>>> because these modes don't change all that often.
>>> <
>>
>> Again, that's the HW perspective. But from a SW perspective you *don't*
>> want RM to be part of a configuration register.
>>
>> Global variables are bad. This was well established some 50 years ago
>> (e.g. Wulf, W.A., Shaw, M., "Global Variables Considered Harmful" from
>> 1973). Global configuration registers even more so.
> <
> So Root pointers are now considered Harmful ?!?
>>
>>>>> Since the hidden bit is already hidden at this point, andy rounding
>>>>> overflow of the mantissa from 0xfff.. to 0x000.. will cause the exponent
>>>>> term to be incremented, possibly all the way to Inf. In all cases, this
>>>>> is the exactly correct behaviour.
>>>>>
>>>> Yep.
>>>>
>>>> Main limiting factor though is that for bigger formats (Double or FP96),
>>>> propagating the carry that far can be an issue.
>>> <
>>> Koogie-Stone adders !
>>>>
>>>> In the vast majority of cases, the carry gets absorbed within the low 8
>>>> or 16 bits or so (or if it doesn't, leave these bits as-is).
>>>>
>>>> For narrowing conversions to Binary16 or Binary32, full width rounding
>>>> is both easier and more useful.
>>>>
>>>>
>>>>
>>>> For FADD/FSUB, the vast majority of cases where a very long stream of
>>>> 1's would have occured can be avoided by doing the math internally in
>>>> twos complement form.
>>>>
>>>> Though, in this case, one can save a little cost by implementing the
>>>> "twos complement" as essentially ones' complement with a carry bit input
>>>> to the adder (one can't arrive at a case where both inputs are negative
>>>> with FADD).
>>> <
>>> This is a standard trick that everyone should know--I first saw it in the
>>> PDP-8 in the Complement and increment instruction--but it has come in
>>> handy several times and is the way operands are negated and complemented
>>> in My 66000. The operand is conditionally complemented with a carry in
>>> conditionally asserted. IF the operand is being processed is integer there
>>> is an adder that deals with the carry in. If the operand is logical, there is
>>> no adder and the carry in is ignored.
>>>>
>>>>
>>>> Cases can occur though where the result mantissa comes up negative
>>>> though, which can itself require a sign inversion. The only alternative
>>>> is to compare mantissa input values by value if the exponents are equal,
>>>> which is also fairly expensive.
>>>>
>>>> Though, potentially one could use the rounding step to "absorb" part of
>>>> the cost of the second sign inversion.
>>>>
>>>> Another possibility here could be to have an adder which produces two
>>>> outputs, namely both ((A+B)+Cin) and (~(A+B)+(!Cin)), and then using the
>>>> second output if the first came up negative.
>>>>
>>>> ...


Click here to read the complete article
Re: Configurable rounding modes (was The value of floating-point exceptions?)

<sdombd$k3g$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: m.del...@this.bitsnbites.eu (Marcus)
Newsgroups: comp.arch
Subject: Re: Configurable rounding modes (was The value of floating-point
exceptions?)
Date: Tue, 27 Jul 2021 12:15:09 +0200
Organization: A noiseless patient Spider
Lines: 52
Message-ID: <sdombd$k3g$1@dont-email.me>
References: <sd9a9h$ro6$1@dont-email.me>
<memo.20210721153537.10680P@jgd.cix.co.uk>
<e9c738bd-7c0e-4b3b-9385-3a0d0658b059n@googlegroups.com>
<a74c6bf2-9ad1-4969-b3cb-b650ae8ebdadn@googlegroups.com>
<sde6m7$kr1$1@dont-email.me> <sde74m$nio$1@dont-email.me>
<7cf5713e-f138-488b-9ccf-d85df84c50can@googlegroups.com>
<e7e0b9a2-7990-4ec8-9c40-a6e9a07bd306n@googlegroups.com>
<fc5a33d0-7c17-4855-8ab3-162884bd6b7bn@googlegroups.com>
<713a35af-9cce-4954-b968-1b4b754e7b1en@googlegroups.com>
<sdjghd$1i4a$1@gioia.aioe.org> <sdk2kd$lu1$1@dont-email.me>
<476a9f6b-5fa0-4606-aed6-cf31089b8c5bn@googlegroups.com>
<sdlo5n$da3$1@dont-email.me>
<1f8827fe-a288-4f2e-8e4e-40cc343febbdn@googlegroups.com>
<48d7c07e-2684-4eb8-a480-a40664c48493n@googlegroups.com>
<922f7388-1131-45c1-a8ef-cb4e61fbc4f1n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 27 Jul 2021 10:15:09 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="aac6d43ec1da3802e0438f21242ccc52";
logging-data="20592"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Rk+K4pDZnVgDAPNtuCsw5xJdbatCVr2A="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:L3ZbBrnGVKUjRHkSXMF0AbPjtTU=
In-Reply-To: <922f7388-1131-45c1-a8ef-cb4e61fbc4f1n@googlegroups.com>
Content-Language: en-US
 by: Marcus - Tue, 27 Jul 2021 10:15 UTC

On 2021-07-27 02:39, MitchAlsup wrote:
> On Monday, July 26, 2021 at 5:56:13 PM UTC-5, Quadibloc wrote:
>> On Monday, July 26, 2021 at 10:19:32 AM UTC-6, MitchAlsup wrote:
>>
>>> Given that they cannot be in a GPR or an FPR, Oh wise one,
>>> Where would you put them ?
> <
>> Given the nature of his complaints, obviously there is no other choice
>> but to put the rounding mode in the instruction. If that is annoying,
>> then only have the rounding mode specified in a special longer form of
>> the instructions, with the normal form of the instruction always using the
>> default rounding mode (usually round to nearest, presumably in a status
>> register, _but only alterable there by a privileged instruction_).
> <
> Imagine Kahan wanting to do something like the following to test the
> sensitivity to rounding::
> <
> for( i = 0 i < max i+=4 )
> {
> setRoundingMode(rm[i]);
> a = b + c;
> setRoundingMode(rm[i+1]);
> d = a * f;
> setRoundingMode(rm[i+2]);
> b = d / g;
> setRoundingMode(rm[i+4]);
> c = sqrt( d*b );
> }
> Where rm is originally read in from a file. Show me how you put the rounding
> mode exclusively in the instruction and have no other place in the machine
> holding RM state ?

I would do this in the exact same way as for dynamically selecting
floating-point precision. Hint: It would require spelling/rolling out
different RM versions of the different operations and do runtime
selection (e.g. via a switch statement).

> <
>>
>> That's how I'd cope with what he wants, given that you are correct that
>> there's no place to put the rounding mode in currently well-known architectures
>> that comports well with what he wants to do.
> <
> Using a longer version of an instruction is not as bad an idea as have been
> recently expressed herein.

Especially if the longer versions are only used for non-default rounding
modes.

>>
>> John Savard

Re: Configurable rounding modes (was The value of floating-point exceptions?)

<sdon6m$unn$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: m.del...@this.bitsnbites.eu (Marcus)
Newsgroups: comp.arch
Subject: Re: Configurable rounding modes (was The value of floating-point
exceptions?)
Date: Tue, 27 Jul 2021 12:29:42 +0200
Organization: A noiseless patient Spider
Lines: 47
Message-ID: <sdon6m$unn$1@dont-email.me>
References: <sd9a9h$ro6$1@dont-email.me>
<memo.20210721153537.10680P@jgd.cix.co.uk>
<e9c738bd-7c0e-4b3b-9385-3a0d0658b059n@googlegroups.com>
<a74c6bf2-9ad1-4969-b3cb-b650ae8ebdadn@googlegroups.com>
<sde6m7$kr1$1@dont-email.me> <sde74m$nio$1@dont-email.me>
<7cf5713e-f138-488b-9ccf-d85df84c50can@googlegroups.com>
<e7e0b9a2-7990-4ec8-9c40-a6e9a07bd306n@googlegroups.com>
<fc5a33d0-7c17-4855-8ab3-162884bd6b7bn@googlegroups.com>
<713a35af-9cce-4954-b968-1b4b754e7b1en@googlegroups.com>
<sdjghd$1i4a$1@gioia.aioe.org> <sdk2kd$lu1$1@dont-email.me>
<476a9f6b-5fa0-4606-aed6-cf31089b8c5bn@googlegroups.com>
<sdk7e0$mk2$1@dont-email.me> <FyCLI.4763$xn6.2271@fx23.iad>
<sdmu62$rlr$1@dont-email.me>
<ad8db496-015a-4c9f-bda9-2057ad61a373n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 27 Jul 2021 10:29:42 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="aac6d43ec1da3802e0438f21242ccc52";
logging-data="31479"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/8hst8a4bqaCCR1zn3YY9t3UNvFUBl2x8="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:8LGamqv0fRMpmm6Z2WNxlmcGS54=
In-Reply-To: <ad8db496-015a-4c9f-bda9-2057ad61a373n@googlegroups.com>
Content-Language: en-US
 by: Marcus - Tue, 27 Jul 2021 10:29 UTC

On 2021-07-27 00:12, MitchAlsup wrote:
> On Monday, July 26, 2021 at 1:16:36 PM UTC-5, Ivan Godard wrote:
>> On 7/26/2021 10:46 AM, EricP wrote:
>>> Ivan Godard wrote:

[snip]

>>>> And then there's save/restore of the mode across calls.
>>>>
>>>> Status reg and ignoring the software is a good hardware solution. :-(
>>>
>>> Most of this problem is caused because x86 _only_ has dynamic precision
>>> and rounding modes, forcing almost every FP instruction to be
>>> dependent on FpControl's current setting.
>>>
>>> Everyone expects FpControl to be set their way but doesn't
>>> want to pay the price of saving, setting and restoring it
>>> on every FP using routine. So the setting of FpControl
>>> becomes an invisible ABI register that no one talks about.
> <
> Why is the cost of saving and restoring something other than on the
> order of 4 instructions:: ReadCR-STstack.......LDstack-WriteCR.
> That is:: without requiring pipeline flushes and crap like that.

The real problem is that neither developers nor compilers do this. To
make it work (with rounding mode in a control register) I think that the
control register needs to be an explicit part of the ABI as a callee-
saved register (not just at the language level).

In other words, any function that *uses* the RM register (i.e. any
function that uses floating-point instructions) needs to:

1) Push the current RM state.
2) Set the requested RM state.
3) Do FP ops, call subroutines etc...
4) Pop the old RM state and exit.

Maybe you can do less work, but I can't think of a simpler solution
that would actually work in all situations.

Since programmers make errors, this code must be generated by the
compiler (just as is done for regular callee-saved GPR:s).

All programming languages and ABI:s that I have come across so far
are broken in this regard.

/Marcus

Re: Configurable rounding modes (was The value of floating-point exceptions?)

<sdor96$1hm$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!aioe.org!aoTW/Fm1++YcllHDt9jnUQ.user.46.165.242.91.POSTED!not-for-mail
From: terje.ma...@tmsw.no (Terje Mathisen)
Newsgroups: comp.arch
Subject: Re: Configurable rounding modes (was The value of floating-point
exceptions?)
Date: Tue, 27 Jul 2021 13:39:18 +0200
Organization: Aioe.org NNTP Server
Message-ID: <sdor96$1hm$1@gioia.aioe.org>
References: <sd9a9h$ro6$1@dont-email.me>
<memo.20210721153537.10680P@jgd.cix.co.uk>
<e9c738bd-7c0e-4b3b-9385-3a0d0658b059n@googlegroups.com>
<a74c6bf2-9ad1-4969-b3cb-b650ae8ebdadn@googlegroups.com>
<sde6m7$kr1$1@dont-email.me> <sde74m$nio$1@dont-email.me>
<7cf5713e-f138-488b-9ccf-d85df84c50can@googlegroups.com>
<e7e0b9a2-7990-4ec8-9c40-a6e9a07bd306n@googlegroups.com>
<fc5a33d0-7c17-4855-8ab3-162884bd6b7bn@googlegroups.com>
<713a35af-9cce-4954-b968-1b4b754e7b1en@googlegroups.com>
<sdjghd$1i4a$1@gioia.aioe.org> <sdk2kd$lu1$1@dont-email.me>
<476a9f6b-5fa0-4606-aed6-cf31089b8c5bn@googlegroups.com>
<sdk7e0$mk2$1@dont-email.me> <FyCLI.4763$xn6.2271@fx23.iad>
<sdmu62$rlr$1@dont-email.me>
<ad8db496-015a-4c9f-bda9-2057ad61a373n@googlegroups.com>
<sdon6m$unn$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="1590"; posting-host="aoTW/Fm1++YcllHDt9jnUQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101
Firefox/60.0 SeaMonkey/2.53.8.1
X-Notice: Filtered by postfilter v. 0.9.2
 by: Terje Mathisen - Tue, 27 Jul 2021 11:39 UTC

Marcus wrote:
> The real problem is that neither developers nor compilers do this. To
> make it work (with rounding mode in a control register) I think that the
> control register needs to be an explicit part of the ABI as a callee-
> saved register (not just at the language level).
>
> In other words, any function that *uses* the RM register (i.e. any
> function that uses floating-point instructions) needs to:
>
> 1) Push the current RM state.
> 2) Set the requested RM state.
> 3) Do FP ops, call subroutines etc...
> 4) Pop the old RM state and exit.

This is exactly how you have to treat the string direction bit on x86:

By default all the REP MOV/STOS/CMPS operations moves forward since the
direction bit is reset on power-up.

If you want to make an overlapping move where the target start address
is within the source range, then you have to detect this, move both
source and dest registers to the end of the ranges and then STD (SeT
Direction flag). At the end of this process you must either restore the
old DF value, or (much more commonly used) clear it again with CLD.
>
> Maybe you can do less work, but I can't think of a simpler solution
> that would actually work in all situations.

If you google I'm sure you can find a bunch of bugs caused by
programmers generating an STD without the follow-up CLD.

>
> Since programmers make errors, this code must be generated by the
> compiler (just as is done for regular callee-saved GPR:s).

Or only used within self-contained libraries.

BTW, the FDIV fix worked 100% due to some quirks in the x87 fp precision
handling: On the x86 FPU the FP operations are size-agnostic, with both
the rounding and precision mode controlled by the FPCW.

In our FDIV replacement code we assumed that the FPU was currently in
64-bit mode (actually, 32-bit would also be OK), with the two incoming
64-bit double arguments on the integer stack.

I grabbed the top 32 bits of the double variable, shifted them down 10
bits and masked away the sign and exponent leaving the top 10 bits of
the mantissa. These bits were then used to index a 1024-bit/128-byte
table with just 5 bits set, corresponding to the 5 missing entries in
the SRT divider lookup table.

(BTW, I did consider a 32 or 64-bit Bloom filter here to skip the table
lookup for most inputs but realized that any code which did nothing but
back-to-back FDIV operations could afford to effectively dedicate two
cache lines of table space, and for normal code which only does a few
sparse FDIVs, the speed didn't really matter.)

For the 1019 of 1024 unset entries we just did a regular FDIV and
returned since we knew that the hardware bug could not be triggered, but
when we got a hit we did a really sneaky thing (not my idea unfortunately):

We switched the FPU into long double/extended/80-bit mode (saving the
original state), then we multiplied both the divisor and the dividend by
15/16! Both of these multiplications were guaranteed to be exact since
we now had 10 more available mantissa bits and 5 extra exponent bits.

At this point we just restored the saved FPCW and fell through into the
same FDIV which was the target for those 1019/1024 normal values.

This function ran at 80 cycles/FDIV vs 40 for a correct chip, even with
input values which were selected to be bad, for pretty much all working
code the slowdown was so miniscule that it was hard to measure.

Terje

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

Re: The value of floating-point exceptions?

<NmVLI.28481$0N5.17498@fx06.iad>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder5.feed.usenet.farm!feeder1.feed.usenet.farm!feed.usenet.farm!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!news-out.netnews.com!news.alt.net!fdc2.netnews.com!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx06.iad.POSTED!not-for-mail
From: ThatWoul...@thevillage.com (EricP)
User-Agent: Thunderbird 2.0.0.24 (Windows/20100228)
MIME-Version: 1.0
Newsgroups: comp.arch
Subject: Re: The value of floating-point exceptions?
References: <sd9a9h$ro6$1@dont-email.me> <memo.20210721153537.10680P@jgd.cix.co.uk> <e9c738bd-7c0e-4b3b-9385-3a0d0658b059n@googlegroups.com> <a74c6bf2-9ad1-4969-b3cb-b650ae8ebdadn@googlegroups.com> <sde6m7$kr1$1@dont-email.me> <sde74m$nio$1@dont-email.me> <7cf5713e-f138-488b-9ccf-d85df84c50can@googlegroups.com> <e7e0b9a2-7990-4ec8-9c40-a6e9a07bd306n@googlegroups.com> <fc5a33d0-7c17-4855-8ab3-162884bd6b7bn@googlegroups.com> <713a35af-9cce-4954-b968-1b4b754e7b1en@googlegroups.com> <sdjghd$1i4a$1@gioia.aioe.org> <sdk2kd$lu1$1@dont-email.me> <476a9f6b-5fa0-4606-aed6-cf31089b8c5bn@googlegroups.com> <sdk7e0$mk2$1@dont-email.me> <FyCLI.4763$xn6.2271@fx23.iad> <sdmu62$rlr$1@dont-email.me> <ad8db496-015a-4c9f-bda9-2057ad61a373n@googlegroups.com>
In-Reply-To: <ad8db496-015a-4c9f-bda9-2057ad61a373n@googlegroups.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 39
Message-ID: <NmVLI.28481$0N5.17498@fx06.iad>
X-Complaints-To: abuse@UsenetServer.com
NNTP-Posting-Date: Tue, 27 Jul 2021 15:11:41 UTC
Date: Tue, 27 Jul 2021 11:11:09 -0400
X-Received-Bytes: 3170
 by: EricP - Tue, 27 Jul 2021 15:11 UTC

MitchAlsup wrote:
>> On 7/26/2021 10:46 AM, EricP wrote:
>>> Most of this problem is caused because x86 _only_ has dynamic precision
>>> and rounding modes, forcing almost every FP instruction to be
>>> dependent on FpControl's current setting.
>>>
>>> Everyone expects FpControl to be set their way but doesn't
>>> want to pay the price of saving, setting and restoring it
>>> on every FP using routine. So the setting of FpControl
>>> becomes an invisible ABI register that no one talks about.
> <
> Why is the cost of saving and restoring something other than on the
> order of 4 instructions:: ReadCR-STstack.......LDstack-WriteCR.
> That is:: without requiring pipeline flushes and crap like that.

Because x86/x64 and others (Alpha) put the control bits like round mode
and denorms-are-zero and exceptions mask, which are inputs,
in the same HW register as the result exception flags, which are outputs.
So reading the control bits requires synchronizing with the status bits.

This could penalizes anyone who reads the HW control register
in order to preserve the control bits setting before changing them.

The HW dependencies for these two sets of information are quite
different and they never should have been put together.

I would keep the control bits in FpControl and status bits in
FpStatus registers with separate read and write instructions.
(I don't see anything so far in IEEE-754 that requires them
to be stored together in the same HW register.)

FpControl bits are inherited from caller and are preserved across calls.

Whether FpStatus flags are preserved or accumulated across any particular
call is an application, language and/or library routine decision.

Re: The value of floating-point exceptions?

<sdpeqf$fu2$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: cr88...@gmail.com (BGB)
Newsgroups: comp.arch
Subject: Re: The value of floating-point exceptions?
Date: Tue, 27 Jul 2021 12:12:44 -0500
Organization: A noiseless patient Spider
Lines: 102
Message-ID: <sdpeqf$fu2$1@dont-email.me>
References: <sd9a9h$ro6$1@dont-email.me>
<memo.20210721153537.10680P@jgd.cix.co.uk>
<e9c738bd-7c0e-4b3b-9385-3a0d0658b059n@googlegroups.com>
<a74c6bf2-9ad1-4969-b3cb-b650ae8ebdadn@googlegroups.com>
<sde6m7$kr1$1@dont-email.me> <sde74m$nio$1@dont-email.me>
<7cf5713e-f138-488b-9ccf-d85df84c50can@googlegroups.com>
<e7e0b9a2-7990-4ec8-9c40-a6e9a07bd306n@googlegroups.com>
<fc5a33d0-7c17-4855-8ab3-162884bd6b7bn@googlegroups.com>
<713a35af-9cce-4954-b968-1b4b754e7b1en@googlegroups.com>
<sdjghd$1i4a$1@gioia.aioe.org> <sdk2kd$lu1$1@dont-email.me>
<476a9f6b-5fa0-4606-aed6-cf31089b8c5bn@googlegroups.com>
<sdk7e0$mk2$1@dont-email.me> <sdkp9i$cvq$1@dont-email.me>
<sdn7g4$d66$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 27 Jul 2021 17:12:47 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="e545a2ab1291a9615aaf258b91be6805";
logging-data="16322"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/6h7+XjOm9xnWcfQOXdrg9"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.12.0
Cancel-Lock: sha1:ueVarMy7cKlez7/ezN+kJm7LTDg=
In-Reply-To: <sdn7g4$d66$1@gioia.aioe.org>
Content-Language: en-US
 by: BGB - Tue, 27 Jul 2021 17:12 UTC

On 7/26/2021 3:55 PM, Terje Mathisen wrote:
> BGB wrote:
>> On 7/25/2021 12:36 PM, Ivan Godard wrote:
>>> However pitting them in status regs mucks up any code that actually
>>> does care about mode; interval arithmetic for example. Especially
>>> because changing the mode commonly costs a pipe flush (yes, you can
>>> put the status in the decoder and decorate the op in the pipe with
>>> it, but that adds five bits to the op state). And then there's
>>> save/restore of the mode across calls.
>>>
>>
>> Yeah, to be useful, it kinda needs to be per-instruction.
>> This means putting it in the encoding, as a register-based mode is a
>> bit too coarse grain to be particularly useful.
>
> I would like to have my cake and eat it too:
>
> a) We need a global/process/thread default Rounding Mode register which
> is saved & restored on any context switch, i.e. like pretty much all
> systems today.
>
> b) Any (short) group of FP operations can have a CARRY-like prefix op
> that specifies the exact rounding mode to be used for the corresponding
> operations. Using 3 bits per instruction makes it possible for a 32-bit
> instruction with 15 available immediate bits to encode 5 FP instructions.
>
> I.e. ROUND (TRUNC, RNE, RNA, CEIL, FLOOR)
>
> Of the 8 possible encodings, we're currently using 5 for rounding modes,
> so we can dedicate one of them (000/111 probably) to indicate "ignore
> this, use the thread control word setting here".
>
> One additional requirement is that the use of the ROUND prefix
> guarantees that there will be no change of the control word rounding
> setting until the shadow ends.
>
> Using Mitch's CARRY shadow trick means that the decoder can then figure
> out very early where the rounding mode bits will come from and dispatch
> them alongside each FP operation.
>

OK, though BJX2 is a very different ISA from Mitch's ISA...

As noted else-thread, I ended up deciding to add it via 64-bit
instruction encodings. This encoding space had been put into use as part
of the prior XGPR extension (with RegRegReg ops gaining an extra Imm8
field, which is normally ignored; previously would have been ignored in
this case as well).

Effectively, Op64 functions like a prefix (similar to Jumbo), just it
extends both the register fields and opcode fields rather than purely
extending the immediate (hence why immediate values extend to 17 bits
rather than 33).

This still leaves the immediate-extension field unused in 3R ops, but
could be used possibly either as a 4th Immed, or possible also some
encodings could use it as an additional source register field (say, for
example: Rn=Rm*Ro+Rp). In this case, the Imm8 or Rp may replace the
value which would have been read from the 'Rn' register in 3R forms (and
otherwise poses similar restrictions in terms of bundling rules; namely
that instructions which read a value from 'Rn' also implicitly eat Lane
3; which in this case also receives a copy of Lane 1's Immed field).

All this is possibly a little hacky, but oh well...

And, in this case, Non-Op64 FADD/FSUB/FMUL are fed a value 0x00 in this
case, which is defined as equivalent to the original behavior.

Though the above approach does mean that FMAC effectively doesn't get a
customizable rounding-mode as an option (FMAC would likely get a 4R form
instead; mostly as Rn=Rm*Ro+Imm8 is kinda useless for FP values).

Though, in theory a rounding-mode could still be encoded via the
remaining 2 bits for this field in 4R form (modes 0..3 only).

The rounding modes are basically those described in the prior post, eg:
00=RNE
01=Trunc
02=+Inf / Ceil
03=-Inf / Floor
04=RNE with ULP at bit 2, and Inexact status in (1:0).

Mode 4 is partly intended to address both flonum rounding and also
inexact signaling. Originally, I considered having separate modes (say,
one which merely rounded such that the low order bits were always
nonzero for inexact results). Seemed likely to be slightly cheaper to
add both as a single mode than to have two separate modes.

The inexact detection in the results is a little loose though, since it
may miss "lost bits" significantly below the ULP (it is more of a "low
order bits just below the ULP were nonzero" detector).

These are not yet supported by my emulator, it is likely that these
encodings would need to be done in software (at present, the emulator
does Binary64 ops by via the host processor's FPU).

....

Re: The value of floating-point exceptions?

<1bacdbc7-4d7f-4d94-8f1f-82b697fd38fan@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:620a:62d:: with SMTP id 13mr22905363qkv.18.1627405991873;
Tue, 27 Jul 2021 10:13:11 -0700 (PDT)
X-Received: by 2002:a05:6808:6cc:: with SMTP id m12mr3680801oih.51.1627405991679;
Tue, 27 Jul 2021 10:13:11 -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: Tue, 27 Jul 2021 10:13:11 -0700 (PDT)
In-Reply-To: <2f3aee04-2cbb-4246-9f32-aa37f966c607n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:f4c4:e0a:8854:7a93;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:f4c4:e0a:8854:7a93
References: <sd9a9h$ro6$1@dont-email.me> <memo.20210721153537.10680P@jgd.cix.co.uk>
<e9c738bd-7c0e-4b3b-9385-3a0d0658b059n@googlegroups.com> <a74c6bf2-9ad1-4969-b3cb-b650ae8ebdadn@googlegroups.com>
<sde6m7$kr1$1@dont-email.me> <sde74m$nio$1@dont-email.me> <7cf5713e-f138-488b-9ccf-d85df84c50can@googlegroups.com>
<e7e0b9a2-7990-4ec8-9c40-a6e9a07bd306n@googlegroups.com> <sdf4t3$6cl$2@newsreader4.netcologne.de>
<c0917435-65c8-45f1-b745-5fd7ff4f58c0n@googlegroups.com> <548e3590-e939-40b7-8f78-3040d59358f7n@googlegroups.com>
<sdj9rq$ue1$2@newsreader4.netcologne.de> <91b95806-d901-48db-912d-0b0e5c119f9fn@googlegroups.com>
<95b1c11a-0e6f-49e7-91f9-44d7b133753en@googlegroups.com> <2f3aee04-2cbb-4246-9f32-aa37f966c607n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1bacdbc7-4d7f-4d94-8f1f-82b697fd38fan@googlegroups.com>
Subject: Re: The value of floating-point exceptions?
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Tue, 27 Jul 2021 17:13:11 +0000
Content-Type: text/plain; charset="UTF-8"
 by: MitchAlsup - Tue, 27 Jul 2021 17:13 UTC

On Tuesday, July 27, 2021 at 12:31:20 AM UTC-5, Quadibloc wrote:
> On Monday, July 26, 2021 at 11:24:56 PM UTC-6, Quadibloc wrote:
>
> > One could use half of the pins used for VPP for the negative
> > logic voltage, but that would be a *big* incompatibility; one
> > ought to at least put the notch in a different place if one
> > did that! And if that was done, one might as well add pins.
<
> Actually it's VDD that's the logic 1 voltage. There are 26 pins
> used for that, as against only 4 pins that are marked as not
> connected. (An RFU abbreviation for Reserved for Future
> Use was defined, but I could see no pins so labelled.)
<
Then there is the fact that while a DRAM cell can store for milliseconds
a positive voltage, it can only store a negative voltage for microseconds.
(It leaks when storing negative, whereas it does not when positive)
>
> So going to negative voltage instead of half voltage for the
> third state would require a major redesign, not a tiny
> change that was almost un-noticeable.
>
> John Savard

Re: The value of floating-point exceptions?

<f518be30-3b21-4d38-ad4f-42118055634cn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:620a:1593:: with SMTP id d19mr24222234qkk.472.1627407008292;
Tue, 27 Jul 2021 10:30:08 -0700 (PDT)
X-Received: by 2002:aca:3144:: with SMTP id x65mr15533006oix.157.1627407008032;
Tue, 27 Jul 2021 10:30:08 -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: Tue, 27 Jul 2021 10:30:07 -0700 (PDT)
In-Reply-To: <sdog27$jc1$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:f4c4:e0a:8854:7a93;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:f4c4:e0a:8854:7a93
References: <sd9a9h$ro6$1@dont-email.me> <memo.20210721153537.10680P@jgd.cix.co.uk>
<e9c738bd-7c0e-4b3b-9385-3a0d0658b059n@googlegroups.com> <a74c6bf2-9ad1-4969-b3cb-b650ae8ebdadn@googlegroups.com>
<sde6m7$kr1$1@dont-email.me> <sde74m$nio$1@dont-email.me> <7cf5713e-f138-488b-9ccf-d85df84c50can@googlegroups.com>
<e7e0b9a2-7990-4ec8-9c40-a6e9a07bd306n@googlegroups.com> <fc5a33d0-7c17-4855-8ab3-162884bd6b7bn@googlegroups.com>
<713a35af-9cce-4954-b968-1b4b754e7b1en@googlegroups.com> <sdjghd$1i4a$1@gioia.aioe.org>
<sdk2kd$lu1$1@dont-email.me> <476a9f6b-5fa0-4606-aed6-cf31089b8c5bn@googlegroups.com>
<sdlo5n$da3$1@dont-email.me> <1f8827fe-a288-4f2e-8e4e-40cc343febbdn@googlegroups.com>
<48d7c07e-2684-4eb8-a480-a40664c48493n@googlegroups.com> <922f7388-1131-45c1-a8ef-cb4e61fbc4f1n@googlegroups.com>
<sdog27$jc1$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f518be30-3b21-4d38-ad4f-42118055634cn@googlegroups.com>
Subject: Re: The value of floating-point exceptions?
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Tue, 27 Jul 2021 17:30:08 +0000
Content-Type: text/plain; charset="UTF-8"
 by: MitchAlsup - Tue, 27 Jul 2021 17:30 UTC

On Tuesday, July 27, 2021 at 3:27:53 AM UTC-5, Ivan Godard wrote:
> On 7/26/2021 5:39 PM, MitchAlsup wrote:
> > On Monday, July 26, 2021 at 5:56:13 PM UTC-5, Quadibloc wrote:
> >> On Monday, July 26, 2021 at 10:19:32 AM UTC-6, MitchAlsup wrote:
> >>
> >>> Given that they cannot be in a GPR or an FPR, Oh wise one,
> >>> Where would you put them ?
> > <
> >> Given the nature of his complaints, obviously there is no other choice
> >> but to put the rounding mode in the instruction. If that is annoying,
> >> then only have the rounding mode specified in a special longer form of
> >> the instructions, with the normal form of the instruction always using the
> >> default rounding mode (usually round to nearest, presumably in a status
> >> register, _but only alterable there by a privileged instruction_).
> > <
> > Imagine Kahan wanting to do something like the following to test the
> > sensitivity to rounding::
> > <
> > for( i = 0 i < max i+=4 )
> > {
> > setRoundingMode(rm[i]);
> > a = b + c;
> > setRoundingMode(rm[i+1]);
> > d = a * f;
> > setRoundingMode(rm[i+2]);
> > b = d / g;
> > setRoundingMode(rm[i+4]);
> > c = sqrt( d*b );
> > }
> > Where rm is originally read in from a file. Show me how you put the rounding
> > mode exclusively in the instruction and have no other place in the machine
> > holding RM state ?
<
> That's why "from specReg" is one of our available static choices; the
> user who chooses that is accepting the SIMD/call/task/etc issues, thinks
> he knows what he is doing, and deserves it. The default for the less
> witting is static RNE.
>
> But the real problem with your example is linguistic: the notation
> itself implies that the mode is a variable, even if the argument to
> setRoundingMode is a literal. Change the notation to:
> withMode<RNA>{ doSomething(); }
> or even:
> mode dyn; f >> dyn;
> withMode<dynamic(dyn)>{ doSomething(); }
> and most of the issues go away, even if you really want dynamic.
<
Not said but I believe you mean::
<
withMode<RNA>{ doSomething(); }
<
to be::
{setRoundingMode(dyn); { doSomething(); } setRoundingMode(RNE);}
<
In any event, when the RM part of your FP control register is passed as
an operand to the FP units, it can be changed without pipeline flushes
with either simply interlocks (boo) or as another operand in the Reservation
stations (a lot less of a boo).
<
In any event::
How does one without a RM field in some control register obey 9.3.1 ?
and 9.3.2 ?

Re: Configurable rounding modes (was The value of floating-point exceptions?)

<e18db4b1-445e-4922-a417-4d48971b160bn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:ac8:540f:: with SMTP id b15mr20911405qtq.193.1627407172194;
Tue, 27 Jul 2021 10:32:52 -0700 (PDT)
X-Received: by 2002:a54:4194:: with SMTP id 20mr8723064oiy.78.1627407171951;
Tue, 27 Jul 2021 10:32:51 -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: Tue, 27 Jul 2021 10:32:51 -0700 (PDT)
In-Reply-To: <sdol45$69t$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:f4c4:e0a:8854:7a93;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:f4c4:e0a:8854:7a93
References: <sd9a9h$ro6$1@dont-email.me> <memo.20210721153537.10680P@jgd.cix.co.uk>
<e9c738bd-7c0e-4b3b-9385-3a0d0658b059n@googlegroups.com> <a74c6bf2-9ad1-4969-b3cb-b650ae8ebdadn@googlegroups.com>
<sde6m7$kr1$1@dont-email.me> <sde74m$nio$1@dont-email.me> <7cf5713e-f138-488b-9ccf-d85df84c50can@googlegroups.com>
<e7e0b9a2-7990-4ec8-9c40-a6e9a07bd306n@googlegroups.com> <fc5a33d0-7c17-4855-8ab3-162884bd6b7bn@googlegroups.com>
<713a35af-9cce-4954-b968-1b4b754e7b1en@googlegroups.com> <sdjghd$1i4a$1@gioia.aioe.org>
<sdk2kd$lu1$1@dont-email.me> <476a9f6b-5fa0-4606-aed6-cf31089b8c5bn@googlegroups.com>
<sdlo5n$da3$1@dont-email.me> <1f8827fe-a288-4f2e-8e4e-40cc343febbdn@googlegroups.com>
<sdol45$69t$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e18db4b1-445e-4922-a417-4d48971b160bn@googlegroups.com>
Subject: Re: Configurable rounding modes (was The value of floating-point exceptions?)
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Tue, 27 Jul 2021 17:32:52 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: MitchAlsup - Tue, 27 Jul 2021 17:32 UTC

On Tuesday, July 27, 2021 at 4:54:15 AM UTC-5, Marcus wrote:
> On 2021-07-26 18:19, MitchAlsup wrote:
> > On Monday, July 26, 2021 at 2:27:54 AM UTC-5, Marcus wrote:
> >> On 2021-07-25 19:22, MitchAlsup wrote:
> >>> On Sunday, July 25, 2021 at 11:14:08 AM UTC-5, BGB wrote:
> >>>> On 7/25/2021 6:05 AM, Terje Mathisen wrote:
> >>>>> MitchAlsup wrote:
> >>>>>> Having watched this from inside:
> >>>>>> a) HW designers know a lot more about this today than in 1980
> >>>>>> b) even systems that started out as IEEE-format gradually went
> >>>>>> closer and closer to full IEEE-compliant (GPUs) until there is no
> >>>>>> useful difference in the quality of the arithmetic.
> >>>>>> c) once 754-2009 came out the overhead to do denorms went to
> >>>>>> zero, and there is no reason to avoid full speed denorms in practice.
> >>>>>> (BGB's small FPGA prototyping environment aside.)
> >>>>>
> >>>>> I agree.
> >>>>>
> >>>>>> d) HW designers have learned how to perform all of the rounding
> >>>>>> modes at no overhead compared to RNE.
> >>>>>
> >>>>> This is actually dead easy since all the other modes are easier than
> >>>>> RNE: As soon as you have all four bits required for RNE (i.e.
> >>>>> sign/ulp/guard/sticky) then the remaining rounding modes only need
> >>>>> various subsets of these, so you use the rounding mode to route one of 5
> >>>>> or 6 possible 16-entry one-bit lookup tables into the rounding circuit
> >>>>> where it becomes the input to be added into the ulp position of the
> >>>>> final packed (sign/exp/mantissa) fp result.
> >>>>>
> >>>> Oddly enough, the extra cost to rounding itself is not the main issue
> >>>> with multiple rounding modes, but more the question of how the bits get
> >>>> there (if one doesn't already have an FPU status register or similar).
> >>>>
> >>>> Granted, could in theory put these bits in SR or similar, but, yeah....
> >>>>
> >>>> It would be better IMO if it were part of the instruction, but there
> >>>> isn't really any good / non-annoying way to encode this.
> >>> <
> >>> And this is why they are put in control/status registers.
> >>> <
> >> There are several problems with this, but the *main* problem is that the
> >> rounding mode setting becomes a super-global variable.
> > <
> > Given that they cannot be in a GPR or an FPR, Oh wise one,
> > Where would you put them ?
> > <
> At the same place that we specify the floating-point precision: in the
> instruction.
> >> If one subroutine
> >> touches the register, it affects all code in the same thread. And it's
> >> "super-global" because it crosses source code and language barriers
> > <
> > But does not cross thread or task boundaries. So its not "like memory" either.
> > <
> >> (e.g. consider a program written in Go that has a Python scripting back
> >> end that calls out to a DLL that is written in C++ that changes the
> >> floating-point rounding mode...).
> >>
> >> As I have accounted for elsewhere, this is a real problem. As a SW
> >> developer I therefore prefer to work with architectures that do not have
> >> an FPU control register - /even/ if that means that I can only use RNE
> >> (because let's face it - that's the only rounding mode I'm ever going
> >> to use anyway).
> > <
> > So you discount libraries that may contain interval arithmetic or properly
> > rounded transcendentals ?
> You might have misunderstood my point. As a software developer, if I
> have a choice between:
>
> 1. Rounding mode is configured in a thread global register.
> 2. Rounding mode is always RNE.
>
> ...then I pick 2, because that gives me 100% predictable results,
> whereas with 1 all bets are off (read my other examples as to why this
> is the case).
>
> *However*, if there is also the option:
>
> 3. Rounding mode is part of the instruction.
>
> ...then I pick 3.
<
Do you still pick 3 if the average instruction went from 32-bits in size to
37 bits in size ?
> >>
> >> Having the rounding modes as part of the instruction is *much* better
> >> from a SW developer's perspective - but that blows up opcode space for
> >> a feature that is never used.
> > <
> > And there are cases where this philosophy would blow up code space
> > when they were used. Does the compiler have to generate code for
> > foo() in RNE, and RTPI and RTNI, and RTZ, and RTMAG modes?
<
> Does the compiler have to generate code for foo() in binary16, binary32,
> binary64 and binary128? No. The developer selects the precision and
> rounding mode(s). The developer knows what rounding mode to use for a
> particular algorithm.
> >>
> >> Perhaps your prefix instruction paradigm could be used for this (e.g.
> >> like "CARRY")?
> > <
> > If I wanted 'per instruction RMs' this would be how I did it. A CARRY-like
> > RM-instruction-modifier could cast RM over 5-ish subsequent instructions.
> Sounds reasonable.
> >>
> >>> < Probably the
> >>>> "least awful" would probably be to use an Op64 encoding, which then uses
> >>>> some of the Immed extension bits to encode a rounding mode.
> >>> <
> >>> The argument against having them in instructions is that this prevents
> >>> someone from running the code several times with different rounding
> >>> modes set to detect any sensitivity to the actually chosen rounding mode.
> >>> Kahan said he uses this a lot.
> >>
> >> ......let me question the usefulness of that. If I were to do such
> >> experiments I would just compile the algorithm with different rounding
> >> modes set explicitly (e.g. as a C++ template argument or something).
> > <
> > So you would end up with 5 copies of FPPPP, one for each rounding mode
> > (at the cost of 8KĂ—sizeof(inst) per rounding mode = 32KB/mode = 165KB)
> > ??!!?
<
> The use case given here sounds like it has more to do with experimenting
> with different settings than to actually generate production code.
<
The use case is to determine if the code is stable enough to become production code.
<
> As
> such it would be easy to just re-compile the source code with different
> rounding mode settings. I occasionally do this when experimenting with
> different floating-point precisions (usually single precision vs
> double-precision), e.g. using a C DEFINE.
> >>
> >>>>
> >>>>
> >>>> * FFw0_00ii_F0nm_5eo8 FADD Rm, Ro, Rn, Imm8
> >>>> * FFw0_00ii_F0nm_5eo9 FSUB Rm, Ro, Rn, Imm8
> >>>> * FFw0_00ii_F0nm_5eoA FMUL Rm, Ro, Rn, Imm8
> >>>>
> >>>> Where the Imm8 field encodes the rounding mode, say:
> >>>> 00 = Round to Nearest.
> >>>> 01 = Truncate.
> >>>>
> >>>> Or could go the SR route, but I don't want FPU behavior to depend on SR.
> >>> <
> >>> When one has multi-threading and control/status register, one simply
> >>> reads the RM field and delivers it to the FU as an operand. A couple
> >>> of interlock checks means you don't really have to stall the pipeline
> >>> because these modes don't change all that often.
> >>> <
> >>
> >> Again, that's the HW perspective. But from a SW perspective you *don't*
> >> want RM to be part of a configuration register.
> >>
> >> Global variables are bad. This was well established some 50 years ago
> >> (e.g. Wulf, W.A., Shaw, M., "Global Variables Considered Harmful" from
> >> 1973). Global configuration registers even more so.
> > <
> > So Root pointers are now considered Harmful ?!?
> >>
> >>>>> Since the hidden bit is already hidden at this point, andy rounding
> >>>>> overflow of the mantissa from 0xfff.. to 0x000.. will cause the exponent
> >>>>> term to be incremented, possibly all the way to Inf. In all cases, this
> >>>>> is the exactly correct behaviour.
> >>>>>
> >>>> Yep.
> >>>>
> >>>> Main limiting factor though is that for bigger formats (Double or FP96),
> >>>> propagating the carry that far can be an issue.
> >>> <
> >>> Koogie-Stone adders !
> >>>>
> >>>> In the vast majority of cases, the carry gets absorbed within the low 8
> >>>> or 16 bits or so (or if it doesn't, leave these bits as-is).
> >>>>
> >>>> For narrowing conversions to Binary16 or Binary32, full width rounding
> >>>> is both easier and more useful.
> >>>>
> >>>>
> >>>>
> >>>> For FADD/FSUB, the vast majority of cases where a very long stream of
> >>>> 1's would have occured can be avoided by doing the math internally in
> >>>> twos complement form.
> >>>>
> >>>> Though, in this case, one can save a little cost by implementing the
> >>>> "twos complement" as essentially ones' complement with a carry bit input
> >>>> to the adder (one can't arrive at a case where both inputs are negative
> >>>> with FADD).
> >>> <
> >>> This is a standard trick that everyone should know--I first saw it in the
> >>> PDP-8 in the Complement and increment instruction--but it has come in
> >>> handy several times and is the way operands are negated and complemented
> >>> in My 66000. The operand is conditionally complemented with a carry in
> >>> conditionally asserted. IF the operand is being processed is integer there
> >>> is an adder that deals with the carry in. If the operand is logical, there is
> >>> no adder and the carry in is ignored.
> >>>>
> >>>>
> >>>> Cases can occur though where the result mantissa comes up negative
> >>>> though, which can itself require a sign inversion. The only alternative
> >>>> is to compare mantissa input values by value if the exponents are equal,
> >>>> which is also fairly expensive.
> >>>>
> >>>> Though, potentially one could use the rounding step to "absorb" part of
> >>>> the cost of the second sign inversion.
> >>>>
> >>>> Another possibility here could be to have an adder which produces two
> >>>> outputs, namely both ((A+B)+Cin) and (~(A+B)+(!Cin)), and then using the
> >>>> second output if the first came up negative.
> >>>>
> >>>> ...


Click here to read the complete article
Re: Configurable rounding modes (was The value of floating-point exceptions?)

<d52a2627-04f8-42ba-8572-ecb9bb3badd2n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:620a:1472:: with SMTP id j18mr23594027qkl.483.1627407275415;
Tue, 27 Jul 2021 10:34:35 -0700 (PDT)
X-Received: by 2002:a05:6830:1658:: with SMTP id h24mr15740391otr.182.1627407275212;
Tue, 27 Jul 2021 10:34:35 -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: Tue, 27 Jul 2021 10:34:34 -0700 (PDT)
In-Reply-To: <sdon6m$unn$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:f4c4:e0a:8854:7a93;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:f4c4:e0a:8854:7a93
References: <sd9a9h$ro6$1@dont-email.me> <memo.20210721153537.10680P@jgd.cix.co.uk>
<e9c738bd-7c0e-4b3b-9385-3a0d0658b059n@googlegroups.com> <a74c6bf2-9ad1-4969-b3cb-b650ae8ebdadn@googlegroups.com>
<sde6m7$kr1$1@dont-email.me> <sde74m$nio$1@dont-email.me> <7cf5713e-f138-488b-9ccf-d85df84c50can@googlegroups.com>
<e7e0b9a2-7990-4ec8-9c40-a6e9a07bd306n@googlegroups.com> <fc5a33d0-7c17-4855-8ab3-162884bd6b7bn@googlegroups.com>
<713a35af-9cce-4954-b968-1b4b754e7b1en@googlegroups.com> <sdjghd$1i4a$1@gioia.aioe.org>
<sdk2kd$lu1$1@dont-email.me> <476a9f6b-5fa0-4606-aed6-cf31089b8c5bn@googlegroups.com>
<sdk7e0$mk2$1@dont-email.me> <FyCLI.4763$xn6.2271@fx23.iad>
<sdmu62$rlr$1@dont-email.me> <ad8db496-015a-4c9f-bda9-2057ad61a373n@googlegroups.com>
<sdon6m$unn$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d52a2627-04f8-42ba-8572-ecb9bb3badd2n@googlegroups.com>
Subject: Re: Configurable rounding modes (was The value of floating-point exceptions?)
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Tue, 27 Jul 2021 17:34:35 +0000
Content-Type: text/plain; charset="UTF-8"
 by: MitchAlsup - Tue, 27 Jul 2021 17:34 UTC

On Tuesday, July 27, 2021 at 5:29:45 AM UTC-5, Marcus wrote:
> On 2021-07-27 00:12, MitchAlsup wrote:
> > On Monday, July 26, 2021 at 1:16:36 PM UTC-5, Ivan Godard wrote:
> >> On 7/26/2021 10:46 AM, EricP wrote:
> >>> Ivan Godard wrote:
> [snip]
> >>>> And then there's save/restore of the mode across calls.
> >>>>
> >>>> Status reg and ignoring the software is a good hardware solution. :-(
> >>>
> >>> Most of this problem is caused because x86 _only_ has dynamic precision
> >>> and rounding modes, forcing almost every FP instruction to be
> >>> dependent on FpControl's current setting.
> >>>
> >>> Everyone expects FpControl to be set their way but doesn't
> >>> want to pay the price of saving, setting and restoring it
> >>> on every FP using routine. So the setting of FpControl
> >>> becomes an invisible ABI register that no one talks about.
> > <
> > Why is the cost of saving and restoring something other than on the
> > order of 4 instructions:: ReadCR-STstack.......LDstack-WriteCR.
> > That is:: without requiring pipeline flushes and crap like that.
> The real problem is that neither developers nor compilers do this. To
> make it work (with rounding mode in a control register) I think that the
> control register needs to be an explicit part of the ABI as a callee-
> saved register (not just at the language level).
>
> In other words, any function that *uses* the RM register (i.e. any
> function that uses floating-point instructions) needs to:
>
> 1) Push the current RM state.
> 2) Set the requested RM state.
> 3) Do FP ops, call subroutines etc...
> 4) Pop the old RM state and exit.
<
<
where *uses* means *modifies*
>
> Maybe you can do less work, but I can't think of a simpler solution
> that would actually work in all situations.
>
> Since programmers make errors, this code must be generated by the
> compiler (just as is done for regular callee-saved GPR:s).
>
> All programming languages and ABI:s that I have come across so far
> are broken in this regard.
>
> /Marcus

Re: The value of floating-point exceptions?

<79577ce3-4bd4-4104-8a49-6da9ca1c14e3n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:620a:ceb:: with SMTP id c11mr22405108qkj.331.1627407655354; Tue, 27 Jul 2021 10:40:55 -0700 (PDT)
X-Received: by 2002:a05:6808:2d2:: with SMTP id a18mr15471666oid.84.1627407655073; Tue, 27 Jul 2021 10:40:55 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder1.feed.usenet.farm!feed.usenet.farm!tr2.eu1.usenetexpress.com!feeder.usenetexpress.com!tr2.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Tue, 27 Jul 2021 10:40:54 -0700 (PDT)
In-Reply-To: <NmVLI.28481$0N5.17498@fx06.iad>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:f4c4:e0a:8854:7a93; posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:f4c4:e0a:8854:7a93
References: <sd9a9h$ro6$1@dont-email.me> <memo.20210721153537.10680P@jgd.cix.co.uk> <e9c738bd-7c0e-4b3b-9385-3a0d0658b059n@googlegroups.com> <a74c6bf2-9ad1-4969-b3cb-b650ae8ebdadn@googlegroups.com> <sde6m7$kr1$1@dont-email.me> <sde74m$nio$1@dont-email.me> <7cf5713e-f138-488b-9ccf-d85df84c50can@googlegroups.com> <e7e0b9a2-7990-4ec8-9c40-a6e9a07bd306n@googlegroups.com> <fc5a33d0-7c17-4855-8ab3-162884bd6b7bn@googlegroups.com> <713a35af-9cce-4954-b968-1b4b754e7b1en@googlegroups.com> <sdjghd$1i4a$1@gioia.aioe.org> <sdk2kd$lu1$1@dont-email.me> <476a9f6b-5fa0-4606-aed6-cf31089b8c5bn@googlegroups.com> <sdk7e0$mk2$1@dont-email.me> <FyCLI.4763$xn6.2271@fx23.iad> <sdmu62$rlr$1@dont-email.me> <ad8db496-015a-4c9f-bda9-2057ad61a373n@googlegroups.com> <NmVLI.28481$0N5.17498@fx06.iad>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <79577ce3-4bd4-4104-8a49-6da9ca1c14e3n@googlegroups.com>
Subject: Re: The value of floating-point exceptions?
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Tue, 27 Jul 2021 17:40:55 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 47
 by: MitchAlsup - Tue, 27 Jul 2021 17:40 UTC

On Tuesday, July 27, 2021 at 10:11:44 AM UTC-5, EricP wrote:
> MitchAlsup wrote:
> >> On 7/26/2021 10:46 AM, EricP wrote:
> >>> Most of this problem is caused because x86 _only_ has dynamic precision
> >>> and rounding modes, forcing almost every FP instruction to be
> >>> dependent on FpControl's current setting.
> >>>
> >>> Everyone expects FpControl to be set their way but doesn't
> >>> want to pay the price of saving, setting and restoring it
> >>> on every FP using routine. So the setting of FpControl
> >>> becomes an invisible ABI register that no one talks about.
> > <
> > Why is the cost of saving and restoring something other than on the
> > order of 4 instructions:: ReadCR-STstack.......LDstack-WriteCR.
> > That is:: without requiring pipeline flushes and crap like that.
<
> Because x86/x64 and others (Alpha) put the control bits like round mode
> and denorms-are-zero and exceptions mask, which are inputs,
> in the same HW register as the result exception flags, which are outputs.
> So reading the control bits requires synchronizing with the status bits.
<
Yes, others did it wrong, that does not mean everyone has to do it wrong.
>
> This could penalizes anyone who reads the HW control register
> in order to preserve the control bits setting before changing them.
>
> The HW dependencies for these two sets of information are quite
> different and they never should have been put together.
<
Yes, others did it wrong, that does not mean everyone has to do it wrong
in perpetuity. In My 66000 this field is part of the thread header (256-bits)
and is accessible without privilege and does not have to wait for other
latent activities upon the "regsiter", only upon that 3-bit field. The inst
that read or write (or exchange!) this field only deal with the 3-bits and
the application does not even need to know where the field is located.
>
>
> I would keep the control bits in FpControl and status bits in
> FpStatus registers with separate read and write instructions.
> (I don't see anything so far in IEEE-754 that requires them
> to be stored together in the same HW register.)
<
Only that 9.3 and 9.4 are obeyed.
>
> FpControl bits are inherited from caller and are preserved across calls.
>
> Whether FpStatus flags are preserved or accumulated across any particular
> call is an application, language and/or library routine decision.

Re: The value of floating-point exceptions?

<sdphtb$nkp$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: iva...@millcomputing.com (Ivan Godard)
Newsgroups: comp.arch
Subject: Re: The value of floating-point exceptions?
Date: Tue, 27 Jul 2021 11:05:30 -0700
Organization: A noiseless patient Spider
Lines: 73
Message-ID: <sdphtb$nkp$1@dont-email.me>
References: <sd9a9h$ro6$1@dont-email.me>
<memo.20210721153537.10680P@jgd.cix.co.uk>
<e9c738bd-7c0e-4b3b-9385-3a0d0658b059n@googlegroups.com>
<a74c6bf2-9ad1-4969-b3cb-b650ae8ebdadn@googlegroups.com>
<sde6m7$kr1$1@dont-email.me> <sde74m$nio$1@dont-email.me>
<7cf5713e-f138-488b-9ccf-d85df84c50can@googlegroups.com>
<e7e0b9a2-7990-4ec8-9c40-a6e9a07bd306n@googlegroups.com>
<fc5a33d0-7c17-4855-8ab3-162884bd6b7bn@googlegroups.com>
<713a35af-9cce-4954-b968-1b4b754e7b1en@googlegroups.com>
<sdjghd$1i4a$1@gioia.aioe.org> <sdk2kd$lu1$1@dont-email.me>
<476a9f6b-5fa0-4606-aed6-cf31089b8c5bn@googlegroups.com>
<sdlo5n$da3$1@dont-email.me>
<1f8827fe-a288-4f2e-8e4e-40cc343febbdn@googlegroups.com>
<48d7c07e-2684-4eb8-a480-a40664c48493n@googlegroups.com>
<922f7388-1131-45c1-a8ef-cb4e61fbc4f1n@googlegroups.com>
<sdog27$jc1$1@dont-email.me>
<f518be30-3b21-4d38-ad4f-42118055634cn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 27 Jul 2021 18:05:31 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="6df56d348e3c793ead0a8bd16f950eb3";
logging-data="24217"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+qTIX8zQDlbiMFfFAdmhFB"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.12.0
Cancel-Lock: sha1:L/sacTLLZtGX01JvS+ASPJcKVvA=
In-Reply-To: <f518be30-3b21-4d38-ad4f-42118055634cn@googlegroups.com>
Content-Language: en-US
 by: Ivan Godard - Tue, 27 Jul 2021 18:05 UTC

On 7/27/2021 10:30 AM, MitchAlsup wrote:
> On Tuesday, July 27, 2021 at 3:27:53 AM UTC-5, Ivan Godard wrote:
>> On 7/26/2021 5:39 PM, MitchAlsup wrote:
>>> On Monday, July 26, 2021 at 5:56:13 PM UTC-5, Quadibloc wrote:
>>>> On Monday, July 26, 2021 at 10:19:32 AM UTC-6, MitchAlsup wrote:
>>>>
>>>>> Given that they cannot be in a GPR or an FPR, Oh wise one,
>>>>> Where would you put them ?
>>> <
>>>> Given the nature of his complaints, obviously there is no other choice
>>>> but to put the rounding mode in the instruction. If that is annoying,
>>>> then only have the rounding mode specified in a special longer form of
>>>> the instructions, with the normal form of the instruction always using the
>>>> default rounding mode (usually round to nearest, presumably in a status
>>>> register, _but only alterable there by a privileged instruction_).
>>> <
>>> Imagine Kahan wanting to do something like the following to test the
>>> sensitivity to rounding::
>>> <
>>> for( i = 0 i < max i+=4 )
>>> {
>>> setRoundingMode(rm[i]);
>>> a = b + c;
>>> setRoundingMode(rm[i+1]);
>>> d = a * f;
>>> setRoundingMode(rm[i+2]);
>>> b = d / g;
>>> setRoundingMode(rm[i+4]);
>>> c = sqrt( d*b );
>>> }
>>> Where rm is originally read in from a file. Show me how you put the rounding
>>> mode exclusively in the instruction and have no other place in the machine
>>> holding RM state ?
> <
>> That's why "from specReg" is one of our available static choices; the
>> user who chooses that is accepting the SIMD/call/task/etc issues, thinks
>> he knows what he is doing, and deserves it. The default for the less
>> witting is static RNE.
>>
>> But the real problem with your example is linguistic: the notation
>> itself implies that the mode is a variable, even if the argument to
>> setRoundingMode is a literal. Change the notation to:
>> withMode<RNA>{ doSomething(); }
>> or even:
>> mode dyn; f >> dyn;
>> withMode<dynamic(dyn)>{ doSomething(); }
>> and most of the issues go away, even if you really want dynamic.
> <
> Not said but I believe you mean::
> <
> withMode<RNA>{ doSomething(); }
> <
> to be::
> {setRoundingMode(dyn); { doSomething(); } setRoundingMode(RNE);}

No, I don't mean that. I mean a true scope, like with
constructor/destructors, so that the mode is restored even if you goto
out of the {}, or throw/longjmp out of it. You are not forcing the mode
at the "}" to RNE, you are restoring it to whatever it was in the
surrounding scope.

A macro paint job on a global variable won't do.

> <
> In any event, when the RM part of your FP control register is passed as
> an operand to the FP units, it can be changed without pipeline flushes
> with either simply interlocks (boo) or as another operand in the Reservation
> stations (a lot less of a boo).
> <
> In any event::
> How does one without a RM field in some control register obey 9.3.1 ?
> and 9.3.2 ?
>

Re: Configurable rounding modes (was The value of floating-point exceptions?)

<sdpiea$ub0$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: iva...@millcomputing.com (Ivan Godard)
Newsgroups: comp.arch
Subject: Re: Configurable rounding modes (was The value of floating-point
exceptions?)
Date: Tue, 27 Jul 2021 11:14:33 -0700
Organization: A noiseless patient Spider
Lines: 94
Message-ID: <sdpiea$ub0$1@dont-email.me>
References: <sd9a9h$ro6$1@dont-email.me>
<memo.20210721153537.10680P@jgd.cix.co.uk>
<e9c738bd-7c0e-4b3b-9385-3a0d0658b059n@googlegroups.com>
<a74c6bf2-9ad1-4969-b3cb-b650ae8ebdadn@googlegroups.com>
<sde6m7$kr1$1@dont-email.me> <sde74m$nio$1@dont-email.me>
<7cf5713e-f138-488b-9ccf-d85df84c50can@googlegroups.com>
<e7e0b9a2-7990-4ec8-9c40-a6e9a07bd306n@googlegroups.com>
<fc5a33d0-7c17-4855-8ab3-162884bd6b7bn@googlegroups.com>
<713a35af-9cce-4954-b968-1b4b754e7b1en@googlegroups.com>
<sdjghd$1i4a$1@gioia.aioe.org> <sdk2kd$lu1$1@dont-email.me>
<476a9f6b-5fa0-4606-aed6-cf31089b8c5bn@googlegroups.com>
<sdlo5n$da3$1@dont-email.me>
<1f8827fe-a288-4f2e-8e4e-40cc343febbdn@googlegroups.com>
<sdol45$69t$1@dont-email.me>
<e18db4b1-445e-4922-a417-4d48971b160bn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 27 Jul 2021 18:14:34 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="6df56d348e3c793ead0a8bd16f950eb3";
logging-data="31072"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+8nv8DTEYPCZs3g51TlCE9"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.12.0
Cancel-Lock: sha1:2w/QUReTFJ2sWs2Mb6Ld2N8bwb4=
In-Reply-To: <e18db4b1-445e-4922-a417-4d48971b160bn@googlegroups.com>
Content-Language: en-US
 by: Ivan Godard - Tue, 27 Jul 2021 18:14 UTC

On 7/27/2021 10:32 AM, MitchAlsup wrote:
> On Tuesday, July 27, 2021 at 4:54:15 AM UTC-5, Marcus wrote:
>> On 2021-07-26 18:19, MitchAlsup wrote:
>>> On Monday, July 26, 2021 at 2:27:54 AM UTC-5, Marcus wrote:
>>>> On 2021-07-25 19:22, MitchAlsup wrote:
>>>>> On Sunday, July 25, 2021 at 11:14:08 AM UTC-5, BGB wrote:
>>>>>> On 7/25/2021 6:05 AM, Terje Mathisen wrote:
>>>>>>> MitchAlsup wrote:
>>>>>>>> Having watched this from inside:
>>>>>>>> a) HW designers know a lot more about this today than in 1980
>>>>>>>> b) even systems that started out as IEEE-format gradually went
>>>>>>>> closer and closer to full IEEE-compliant (GPUs) until there is no
>>>>>>>> useful difference in the quality of the arithmetic.
>>>>>>>> c) once 754-2009 came out the overhead to do denorms went to
>>>>>>>> zero, and there is no reason to avoid full speed denorms in practice.
>>>>>>>> (BGB's small FPGA prototyping environment aside.)
>>>>>>>
>>>>>>> I agree.
>>>>>>>
>>>>>>>> d) HW designers have learned how to perform all of the rounding
>>>>>>>> modes at no overhead compared to RNE.
>>>>>>>
>>>>>>> This is actually dead easy since all the other modes are easier than
>>>>>>> RNE: As soon as you have all four bits required for RNE (i.e.
>>>>>>> sign/ulp/guard/sticky) then the remaining rounding modes only need
>>>>>>> various subsets of these, so you use the rounding mode to route one of 5
>>>>>>> or 6 possible 16-entry one-bit lookup tables into the rounding circuit
>>>>>>> where it becomes the input to be added into the ulp position of the
>>>>>>> final packed (sign/exp/mantissa) fp result.
>>>>>>>
>>>>>> Oddly enough, the extra cost to rounding itself is not the main issue
>>>>>> with multiple rounding modes, but more the question of how the bits get
>>>>>> there (if one doesn't already have an FPU status register or similar).
>>>>>>
>>>>>> Granted, could in theory put these bits in SR or similar, but, yeah...
>>>>>>
>>>>>> It would be better IMO if it were part of the instruction, but there
>>>>>> isn't really any good / non-annoying way to encode this.
>>>>> <
>>>>> And this is why they are put in control/status registers.
>>>>> <
>>>> There are several problems with this, but the *main* problem is that the
>>>> rounding mode setting becomes a super-global variable.
>>> <
>>> Given that they cannot be in a GPR or an FPR, Oh wise one,
>>> Where would you put them ?
>>> <
>> At the same place that we specify the floating-point precision: in the
>> instruction.
>>>> If one subroutine
>>>> touches the register, it affects all code in the same thread. And it's
>>>> "super-global" because it crosses source code and language barriers
>>> <
>>> But does not cross thread or task boundaries. So its not "like memory" either.
>>> <
>>>> (e.g. consider a program written in Go that has a Python scripting back
>>>> end that calls out to a DLL that is written in C++ that changes the
>>>> floating-point rounding mode...).
>>>>
>>>> As I have accounted for elsewhere, this is a real problem. As a SW
>>>> developer I therefore prefer to work with architectures that do not have
>>>> an FPU control register - /even/ if that means that I can only use RNE
>>>> (because let's face it - that's the only rounding mode I'm ever going
>>>> to use anyway).
>>> <
>>> So you discount libraries that may contain interval arithmetic or properly
>>> rounded transcendentals ?
>> You might have misunderstood my point. As a software developer, if I
>> have a choice between:
>>
>> 1. Rounding mode is configured in a thread global register.
>> 2. Rounding mode is always RNE.
>>
>> ...then I pick 2, because that gives me 100% predictable results,
>> whereas with 1 all bets are off (read my other examples as to why this
>> is the case).
>>
>> *However*, if there is also the option:
>>
>> 3. Rounding mode is part of the instruction.
>>
>> ...then I pick 3.
> <
> Do you still pick 3 if the average instruction went from 32-bits in size to
> 37 bits in size ?

Come on, no straw men please. If adding 3 bits to a dozen opcodes pushes
the average of the whole ISA from 32 to 37 bits then you have bigger
encoding problems than FP rounding.

Five modes times 12 opcodes adds 60 models to an existing ~1500, or
something like 2% of a bit to the entropy. If you can't do it in under a
bit then you should change your encoding to fix the crappy entropy
utilization.

Re: Configurable rounding modes (was The value of floating-point exceptions?)

<sdpja0$9mn$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: cr88...@gmail.com (BGB)
Newsgroups: comp.arch
Subject: Re: Configurable rounding modes (was The value of floating-point
exceptions?)
Date: Tue, 27 Jul 2021 13:28:56 -0500
Organization: A noiseless patient Spider
Lines: 312
Message-ID: <sdpja0$9mn$1@dont-email.me>
References: <sd9a9h$ro6$1@dont-email.me>
<memo.20210721153537.10680P@jgd.cix.co.uk>
<e9c738bd-7c0e-4b3b-9385-3a0d0658b059n@googlegroups.com>
<a74c6bf2-9ad1-4969-b3cb-b650ae8ebdadn@googlegroups.com>
<sde6m7$kr1$1@dont-email.me> <sde74m$nio$1@dont-email.me>
<7cf5713e-f138-488b-9ccf-d85df84c50can@googlegroups.com>
<e7e0b9a2-7990-4ec8-9c40-a6e9a07bd306n@googlegroups.com>
<fc5a33d0-7c17-4855-8ab3-162884bd6b7bn@googlegroups.com>
<713a35af-9cce-4954-b968-1b4b754e7b1en@googlegroups.com>
<sdjghd$1i4a$1@gioia.aioe.org> <sdk2kd$lu1$1@dont-email.me>
<476a9f6b-5fa0-4606-aed6-cf31089b8c5bn@googlegroups.com>
<sdlo5n$da3$1@dont-email.me>
<1f8827fe-a288-4f2e-8e4e-40cc343febbdn@googlegroups.com>
<sdol45$69t$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 27 Jul 2021 18:29:20 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="e545a2ab1291a9615aaf258b91be6805";
logging-data="9943"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX194nSkclVqytvZ2Ts95SDLX"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.12.0
Cancel-Lock: sha1:mO7IwUCtaVux6NgsJ6jRZo0HZcA=
In-Reply-To: <sdol45$69t$1@dont-email.me>
Content-Language: en-US
 by: BGB - Tue, 27 Jul 2021 18:28 UTC

On 7/27/2021 4:54 AM, Marcus wrote:
> On 2021-07-26 18:19, MitchAlsup wrote:
>> On Monday, July 26, 2021 at 2:27:54 AM UTC-5, Marcus wrote:
>>> On 2021-07-25 19:22, MitchAlsup wrote:
>>>> On Sunday, July 25, 2021 at 11:14:08 AM UTC-5, BGB wrote:
>>>>> On 7/25/2021 6:05 AM, Terje Mathisen wrote:
>>>>>> MitchAlsup wrote:
>>>>>>> Having watched this from inside:
>>>>>>> a) HW designers know a lot more about this today than in 1980
>>>>>>> b) even systems that started out as IEEE-format gradually went
>>>>>>> closer and closer to full IEEE-compliant (GPUs) until there is no
>>>>>>> useful difference in the quality of the arithmetic.
>>>>>>> c) once 754-2009 came out the overhead to do denorms went to
>>>>>>> zero, and there is no reason to avoid full speed denorms in
>>>>>>> practice.
>>>>>>> (BGB's small FPGA prototyping environment aside.)
>>>>>>
>>>>>> I agree.
>>>>>>
>>>>>>> d) HW designers have learned how to perform all of the rounding
>>>>>>> modes at no overhead compared to RNE.
>>>>>>
>>>>>> This is actually dead easy since all the other modes are easier than
>>>>>> RNE: As soon as you have all four bits required for RNE (i.e.
>>>>>> sign/ulp/guard/sticky) then the remaining rounding modes only need
>>>>>> various subsets of these, so you use the rounding mode to route
>>>>>> one of 5
>>>>>> or 6 possible 16-entry one-bit lookup tables into the rounding
>>>>>> circuit
>>>>>> where it becomes the input to be added into the ulp position of the
>>>>>> final packed (sign/exp/mantissa) fp result.
>>>>>>
>>>>> Oddly enough, the extra cost to rounding itself is not the main issue
>>>>> with multiple rounding modes, but more the question of how the bits
>>>>> get
>>>>> there (if one doesn't already have an FPU status register or similar).
>>>>>
>>>>> Granted, could in theory put these bits in SR or similar, but, yeah...
>>>>>
>>>>> It would be better IMO if it were part of the instruction, but there
>>>>> isn't really any good / non-annoying way to encode this.
>>>> <
>>>> And this is why they are put in control/status registers.
>>>> <
>>> There are several problems with this, but the *main* problem is that the
>>> rounding mode setting becomes a super-global variable.
>> <
>> Given that they cannot be in a GPR or an FPR, Oh wise one,
>> Where would you put them ?
>> <
>
> At the same place that we specify the floating-point precision: in the
> instruction.
>

FWIW:
SH-4 also put the FPU precision/format in FPSCR. Effectively, one had to
look at the state of this register to make any sense out of what
instructions to decode.

This kinda sucked, and for BJX2, I ended up going in the opposite
direction of not having any FPSCR at all.

>>>
>>> If one subroutine
>>> touches the register, it affects all code in the same thread. And it's
>>> "super-global" because it crosses source code and language barriers
>> <
>> But does not cross thread or task boundaries. So its not "like memory"
>> either.
>> <
>>> (e.g. consider a program written in Go that has a Python scripting back
>>> end that calls out to a DLL that is written in C++ that changes the
>>> floating-point rounding mode...).
>>>
>>> As I have accounted for elsewhere, this is a real problem. As a SW
>>> developer I therefore prefer to work with architectures that do not have
>>> an FPU control register - /even/ if that means that I can only use RNE
>>> (because let's face it - that's the only rounding mode I'm ever going
>>> to use anyway).
>> <
>> So you discount libraries that may contain interval arithmetic or
>> properly
>> rounded transcendentals ?
>
> You might have misunderstood my point. As a software developer, if I
> have a choice between:
>
> 1. Rounding mode is configured in a thread global register.
> 2. Rounding mode is always RNE.
>
> ...then I pick 2, because that gives me 100% predictable results,
> whereas with 1 all bets are off (read my other examples as to why this
> is the case).
>
> *However*, if there is also the option:
>
> 3. Rounding mode is part of the instruction.
>
> ...then I pick 3.
>
>>>
>>> Having the rounding modes as part of the instruction is *much* better
>>> from a SW developer's perspective - but that blows up opcode space for
>>> a feature that is never used.
>> <
>> And there are cases where this philosophy would blow up code space
>> when they were used. Does the compiler have to generate code for
>> foo() in RNE, and RTPI and RTNI, and RTZ, and RTMAG modes?
>
> Does the compiler have to generate code for foo() in binary16, binary32,
> binary64 and binary128? No. The developer selects the precision and
> rounding mode(s). The developer knows what rounding mode to use for a
> particular algorithm.
>

Agreed.

Though, one could imagine a situation where ABI-level register handling
gets messed up (say, because the official ABI and GCC disagreed as to
whose responsibility it is to save/restore the register), and the
decoded FPU instructions effectively get turned into confetti.

>>>
>>> Perhaps your prefix instruction paradigm could be used for this (e.g.
>>> like "CARRY")?
>> <
>> If I wanted 'per instruction RMs' this would be how I did it. A
>> CARRY-like
>> RM-instruction-modifier could cast RM over 5-ish subsequent instructions.
>
> Sounds reasonable.
>
>>>
>>>> < Probably the
>>>>> "least awful" would probably be to use an Op64 encoding, which then
>>>>> uses
>>>>> some of the Immed extension bits to encode a rounding mode.
>>>> <
>>>> The argument against having them in instructions is that this prevents
>>>> someone from running the code several times with different rounding
>>>> modes set to detect any sensitivity to the actually chosen rounding
>>>> mode.
>>>> Kahan said he uses this a lot.
>>>
>>> ......let me question the usefulness of that. If I were to do such
>>> experiments I would just compile the algorithm with different rounding
>>> modes set explicitly (e.g. as a C++ template argument or something).
>> <
>> So you would end up with 5 copies of FPPPP, one for each rounding mode
>> (at the cost of 8KĂ—sizeof(inst) per rounding mode = 32KB/mode = 165KB)
>> ??!!?
>
> The use case given here sounds like it has more to do with experimenting
> with different settings than to actually generate production code. As
> such it would be easy to just re-compile the source code with different
> rounding mode settings. I occasionally do this when experimenting with
> different floating-point precisions (usually single precision vs
> double-precision), e.g. using a C DEFINE.
>

Bigger question is what is the best way to go about telling the C
compiler to use a non-default rounding.

I am torn partly between either a pragma, of function-scale attributes.
There is also a possible choice here between:
* __declspec(whatever)
And:
* [[whatever]]

Though, this is more aesthetic than technical, and in BGBCC they are
more or less interchangeable:
* [[dllexport]] void Foo() { ... }
Which technically works I guess...

Then again, it is sort of a similar issue to how, in the recent addition
of lambdas to BGBCC, there are now several semi-redundant notations, eg:
__var():type { ... }
__function[...](...):type { ... }
[...](...)->type { ... }
...

Though, there are some minor differences:
__function allows using a capture list;
Both __var and __function allow lambdas with an unbounded lifespan.

The C23 proposal's lambdas seem to be automatic-lifetime only, and one
doesn't want to use unbounded lifespan where automatic is specified as
this would result in a memory leak (whereas __var and __function default
to unbounded lifetime, with an option to specify automatic lifetime via
__var! or __function!, which is similar to their behavior in BS2).


Click here to read the complete article
Re: Configurable rounding modes (was The value of floating-point exceptions?)

<sdpjdg$9ou$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!paganini.bofh.team!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: sfu...@alumni.cmu.edu.invalid (Stephen Fuld)
Newsgroups: comp.arch
Subject: Re: Configurable rounding modes (was The value of floating-point
exceptions?)
Date: Tue, 27 Jul 2021 11:31:12 -0700
Organization: A noiseless patient Spider
Lines: 51
Message-ID: <sdpjdg$9ou$1@dont-email.me>
References: <sd9a9h$ro6$1@dont-email.me>
<memo.20210721153537.10680P@jgd.cix.co.uk>
<e9c738bd-7c0e-4b3b-9385-3a0d0658b059n@googlegroups.com>
<a74c6bf2-9ad1-4969-b3cb-b650ae8ebdadn@googlegroups.com>
<sde6m7$kr1$1@dont-email.me> <sde74m$nio$1@dont-email.me>
<7cf5713e-f138-488b-9ccf-d85df84c50can@googlegroups.com>
<e7e0b9a2-7990-4ec8-9c40-a6e9a07bd306n@googlegroups.com>
<fc5a33d0-7c17-4855-8ab3-162884bd6b7bn@googlegroups.com>
<713a35af-9cce-4954-b968-1b4b754e7b1en@googlegroups.com>
<sdjghd$1i4a$1@gioia.aioe.org> <sdk2kd$lu1$1@dont-email.me>
<476a9f6b-5fa0-4606-aed6-cf31089b8c5bn@googlegroups.com>
<sdk7e0$mk2$1@dont-email.me> <FyCLI.4763$xn6.2271@fx23.iad>
<sdmu62$rlr$1@dont-email.me>
<ad8db496-015a-4c9f-bda9-2057ad61a373n@googlegroups.com>
<sdon6m$unn$1@dont-email.me>
<d52a2627-04f8-42ba-8572-ecb9bb3badd2n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 27 Jul 2021 18:31:12 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="6f3ec8c492ce83a39e223428281a641c";
logging-data="10014"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/xId0R5RWOvs9YzyLii/HLnnvOiqn+uVE="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.12.0
Cancel-Lock: sha1:+URTP3VgyutH13wZJl8Rce/Vpjw=
In-Reply-To: <d52a2627-04f8-42ba-8572-ecb9bb3badd2n@googlegroups.com>
Content-Language: en-US
 by: Stephen Fuld - Tue, 27 Jul 2021 18:31 UTC

On 7/27/2021 10:34 AM, MitchAlsup wrote:
> On Tuesday, July 27, 2021 at 5:29:45 AM UTC-5, Marcus wrote:
>> On 2021-07-27 00:12, MitchAlsup wrote:
>>> On Monday, July 26, 2021 at 1:16:36 PM UTC-5, Ivan Godard wrote:
>>>> On 7/26/2021 10:46 AM, EricP wrote:
>>>>> Ivan Godard wrote:
>> [snip]
>>>>>> And then there's save/restore of the mode across calls.
>>>>>>
>>>>>> Status reg and ignoring the software is a good hardware solution. :-(
>>>>>
>>>>> Most of this problem is caused because x86 _only_ has dynamic precision
>>>>> and rounding modes, forcing almost every FP instruction to be
>>>>> dependent on FpControl's current setting.
>>>>>
>>>>> Everyone expects FpControl to be set their way but doesn't
>>>>> want to pay the price of saving, setting and restoring it
>>>>> on every FP using routine. So the setting of FpControl
>>>>> becomes an invisible ABI register that no one talks about.
>>> <
>>> Why is the cost of saving and restoring something other than on the
>>> order of 4 instructions:: ReadCR-STstack.......LDstack-WriteCR.
>>> That is:: without requiring pipeline flushes and crap like that.
>> The real problem is that neither developers nor compilers do this. To
>> make it work (with rounding mode in a control register) I think that the
>> control register needs to be an explicit part of the ABI as a callee-
>> saved register (not just at the language level).
>>
>> In other words, any function that *uses* the RM register (i.e. any
>> function that uses floating-point instructions) needs to:
>>
>> 1) Push the current RM state.
>> 2) Set the requested RM state.
>> 3) Do FP ops, call subroutines etc...
>> 4) Pop the old RM state and exit.
> <
> <
> where *uses* means *modifies*

I think it is somewhere between the two formulations. If a function
*cares* what the RM is, it has to at least check, that it is in the
correct (for its requirements) mode. So it has to read the current RM
state, and only if it is different from its requirements, do the
save/modify/restore stuff. Given that, depending upon the specifics, it
may be cheaper to just do the save/change/restore, but that is very
system and application dependent.

--
- Stephen Fuld
(e-mail address disguised to prevent spam)

Re: Configurable rounding modes (was The value of floating-point exceptions?)

<sdpk4c$kdh$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: cr88...@gmail.com (BGB)
Newsgroups: comp.arch
Subject: Re: Configurable rounding modes (was The value of floating-point
exceptions?)
Date: Tue, 27 Jul 2021 13:43:22 -0500
Organization: A noiseless patient Spider
Lines: 123
Message-ID: <sdpk4c$kdh$1@dont-email.me>
References: <sd9a9h$ro6$1@dont-email.me>
<memo.20210721153537.10680P@jgd.cix.co.uk>
<e9c738bd-7c0e-4b3b-9385-3a0d0658b059n@googlegroups.com>
<a74c6bf2-9ad1-4969-b3cb-b650ae8ebdadn@googlegroups.com>
<sde6m7$kr1$1@dont-email.me> <sde74m$nio$1@dont-email.me>
<7cf5713e-f138-488b-9ccf-d85df84c50can@googlegroups.com>
<e7e0b9a2-7990-4ec8-9c40-a6e9a07bd306n@googlegroups.com>
<fc5a33d0-7c17-4855-8ab3-162884bd6b7bn@googlegroups.com>
<713a35af-9cce-4954-b968-1b4b754e7b1en@googlegroups.com>
<sdjghd$1i4a$1@gioia.aioe.org> <sdk2kd$lu1$1@dont-email.me>
<476a9f6b-5fa0-4606-aed6-cf31089b8c5bn@googlegroups.com>
<sdlo5n$da3$1@dont-email.me>
<1f8827fe-a288-4f2e-8e4e-40cc343febbdn@googlegroups.com>
<sdol45$69t$1@dont-email.me>
<e18db4b1-445e-4922-a417-4d48971b160bn@googlegroups.com>
<sdpiea$ub0$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 27 Jul 2021 18:43:24 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="e545a2ab1291a9615aaf258b91be6805";
logging-data="20913"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+FaiLPqdsXsFLn6cWILrAa"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.12.0
Cancel-Lock: sha1:iG+SEcOqqFrCuiJe0Jaz+IGrY0E=
In-Reply-To: <sdpiea$ub0$1@dont-email.me>
Content-Language: en-US
 by: BGB - Tue, 27 Jul 2021 18:43 UTC

On 7/27/2021 1:14 PM, Ivan Godard wrote:
> On 7/27/2021 10:32 AM, MitchAlsup wrote:
>> On Tuesday, July 27, 2021 at 4:54:15 AM UTC-5, Marcus wrote:
>>> On 2021-07-26 18:19, MitchAlsup wrote:
>>>> On Monday, July 26, 2021 at 2:27:54 AM UTC-5, Marcus wrote:
>>>>> On 2021-07-25 19:22, MitchAlsup wrote:
>>>>>> On Sunday, July 25, 2021 at 11:14:08 AM UTC-5, BGB wrote:
>>>>>>> On 7/25/2021 6:05 AM, Terje Mathisen wrote:
>>>>>>>> MitchAlsup wrote:
>>>>>>>>> Having watched this from inside:
>>>>>>>>> a) HW designers know a lot more about this today than in 1980
>>>>>>>>> b) even systems that started out as IEEE-format gradually went
>>>>>>>>> closer and closer to full IEEE-compliant (GPUs) until there is no
>>>>>>>>> useful difference in the quality of the arithmetic.
>>>>>>>>> c) once 754-2009 came out the overhead to do denorms went to
>>>>>>>>> zero, and there is no reason to avoid full speed denorms in
>>>>>>>>> practice.
>>>>>>>>> (BGB's small FPGA prototyping environment aside.)
>>>>>>>>
>>>>>>>> I agree.
>>>>>>>>
>>>>>>>>> d) HW designers have learned how to perform all of the rounding
>>>>>>>>> modes at no overhead compared to RNE.
>>>>>>>>
>>>>>>>> This is actually dead easy since all the other modes are easier
>>>>>>>> than
>>>>>>>> RNE: As soon as you have all four bits required for RNE (i.e.
>>>>>>>> sign/ulp/guard/sticky) then the remaining rounding modes only need
>>>>>>>> various subsets of these, so you use the rounding mode to route
>>>>>>>> one of 5
>>>>>>>> or 6 possible 16-entry one-bit lookup tables into the rounding
>>>>>>>> circuit
>>>>>>>> where it becomes the input to be added into the ulp position of the
>>>>>>>> final packed (sign/exp/mantissa) fp result.
>>>>>>>>
>>>>>>> Oddly enough, the extra cost to rounding itself is not the main
>>>>>>> issue
>>>>>>> with multiple rounding modes, but more the question of how the
>>>>>>> bits get
>>>>>>> there (if one doesn't already have an FPU status register or
>>>>>>> similar).
>>>>>>>
>>>>>>> Granted, could in theory put these bits in SR or similar, but,
>>>>>>> yeah...
>>>>>>>
>>>>>>> It would be better IMO if it were part of the instruction, but there
>>>>>>> isn't really any good / non-annoying way to encode this.
>>>>>> <
>>>>>> And this is why they are put in control/status registers.
>>>>>> <
>>>>> There are several problems with this, but the *main* problem is
>>>>> that the
>>>>> rounding mode setting becomes a super-global variable.
>>>> <
>>>> Given that they cannot be in a GPR or an FPR, Oh wise one,
>>>> Where would you put them ?
>>>> <
>>> At the same place that we specify the floating-point precision: in the
>>> instruction.
>>>>> If one subroutine
>>>>> touches the register, it affects all code in the same thread. And it's
>>>>> "super-global" because it crosses source code and language barriers
>>>> <
>>>> But does not cross thread or task boundaries. So its not "like
>>>> memory" either.
>>>> <
>>>>> (e.g. consider a program written in Go that has a Python scripting
>>>>> back
>>>>> end that calls out to a DLL that is written in C++ that changes the
>>>>> floating-point rounding mode...).
>>>>>
>>>>> As I have accounted for elsewhere, this is a real problem. As a SW
>>>>> developer I therefore prefer to work with architectures that do not
>>>>> have
>>>>> an FPU control register - /even/ if that means that I can only use RNE
>>>>> (because let's face it - that's the only rounding mode I'm ever going
>>>>> to use anyway).
>>>> <
>>>> So you discount libraries that may contain interval arithmetic or
>>>> properly
>>>> rounded transcendentals ?
>>> You might have misunderstood my point. As a software developer, if I
>>> have a choice between:
>>>
>>> 1. Rounding mode is configured in a thread global register.
>>> 2. Rounding mode is always RNE.
>>>
>>> ...then I pick 2, because that gives me 100% predictable results,
>>> whereas with 1 all bets are off (read my other examples as to why this
>>> is the case).
>>>
>>> *However*, if there is also the option:
>>>
>>> 3. Rounding mode is part of the instruction.
>>>
>>> ...then I pick 3.
>> <
>> Do you still pick 3 if the average instruction went from 32-bits in
>> size to
>> 37 bits in size ?
>
> Come on, no straw men please. If adding 3 bits to a dozen opcodes pushes
> the average of the whole ISA from 32 to 37 bits then you have bigger
> encoding problems than FP rounding.
>
> Five modes times 12 opcodes adds 60 models to an existing ~1500, or
> something like 2% of a bit to the entropy. If you can't do it in under a
> bit then you should change your encoding to fix the crappy entropy
> utilization.

I agree.

In my case, while this option effectively doubles the size of the
instructions in question, I expect that the average case impact will be
much smaller than this, given:
FPU instructions are statistically infrequent (vs memory or ALU ops);
One is only likely to need specialized rounding modes in obscure edge
cases (if at all).

I could have done it within the existing 32-bit encoding, but was not
feeling inclined to do so (not common enough to be worth the cost in
encoding space).

Re: The value of floating-point exceptions?

<8ffacd2f-bd00-4247-b674-f748a73a53f3n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a37:b145:: with SMTP id a66mr25355886qkf.329.1627423593901;
Tue, 27 Jul 2021 15:06:33 -0700 (PDT)
X-Received: by 2002:a9d:6f84:: with SMTP id h4mr17620631otq.240.1627423593612;
Tue, 27 Jul 2021 15:06:33 -0700 (PDT)
Path: i2pn2.org!i2pn.org!paganini.bofh.team!news.dns-netz.com!news.freedyn.net!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!feeder1.cambriumusenet.nl!feed.tweak.nl!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: Tue, 27 Jul 2021 15:06:33 -0700 (PDT)
In-Reply-To: <1bacdbc7-4d7f-4d94-8f1f-82b697fd38fan@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:56a:f39c:db00:6567:98f1:677f:acc2;
posting-account=1nOeKQkAAABD2jxp4Pzmx9Hx5g9miO8y
NNTP-Posting-Host: 2001:56a:f39c:db00:6567:98f1:677f:acc2
References: <sd9a9h$ro6$1@dont-email.me> <memo.20210721153537.10680P@jgd.cix.co.uk>
<e9c738bd-7c0e-4b3b-9385-3a0d0658b059n@googlegroups.com> <a74c6bf2-9ad1-4969-b3cb-b650ae8ebdadn@googlegroups.com>
<sde6m7$kr1$1@dont-email.me> <sde74m$nio$1@dont-email.me> <7cf5713e-f138-488b-9ccf-d85df84c50can@googlegroups.com>
<e7e0b9a2-7990-4ec8-9c40-a6e9a07bd306n@googlegroups.com> <sdf4t3$6cl$2@newsreader4.netcologne.de>
<c0917435-65c8-45f1-b745-5fd7ff4f58c0n@googlegroups.com> <548e3590-e939-40b7-8f78-3040d59358f7n@googlegroups.com>
<sdj9rq$ue1$2@newsreader4.netcologne.de> <91b95806-d901-48db-912d-0b0e5c119f9fn@googlegroups.com>
<95b1c11a-0e6f-49e7-91f9-44d7b133753en@googlegroups.com> <2f3aee04-2cbb-4246-9f32-aa37f966c607n@googlegroups.com>
<1bacdbc7-4d7f-4d94-8f1f-82b697fd38fan@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8ffacd2f-bd00-4247-b674-f748a73a53f3n@googlegroups.com>
Subject: Re: The value of floating-point exceptions?
From: jsav...@ecn.ab.ca (Quadibloc)
Injection-Date: Tue, 27 Jul 2021 22:06:33 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Quadibloc - Tue, 27 Jul 2021 22:06 UTC

On Tuesday, July 27, 2021 at 11:13:12 AM UTC-6, MitchAlsup wrote:

> Then there is the fact that while a DRAM cell can store for milliseconds
> a positive voltage, it can only store a negative voltage for microseconds.
> (It leaks when storing negative, whereas it does not when positive)

I'm not asking the DRAM cells to store negative voltages. The negative
voltage is only used on the pins for signalling with more states - to give
three states, as opposed to the four used by GDDR6x.

John Savard

Re: The value of floating-point exceptions?

<99f24173-11f4-4350-96bc-a5fd139acaa1n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a37:7c7:: with SMTP id 190mr24189583qkh.269.1627423692487;
Tue, 27 Jul 2021 15:08:12 -0700 (PDT)
X-Received: by 2002:a05:6830:3109:: with SMTP id b9mr17122680ots.276.1627423692280;
Tue, 27 Jul 2021 15:08:12 -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: Tue, 27 Jul 2021 15:08:12 -0700 (PDT)
In-Reply-To: <79577ce3-4bd4-4104-8a49-6da9ca1c14e3n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:56a:f39c:db00:6567:98f1:677f:acc2;
posting-account=1nOeKQkAAABD2jxp4Pzmx9Hx5g9miO8y
NNTP-Posting-Host: 2001:56a:f39c:db00:6567:98f1:677f:acc2
References: <sd9a9h$ro6$1@dont-email.me> <memo.20210721153537.10680P@jgd.cix.co.uk>
<e9c738bd-7c0e-4b3b-9385-3a0d0658b059n@googlegroups.com> <a74c6bf2-9ad1-4969-b3cb-b650ae8ebdadn@googlegroups.com>
<sde6m7$kr1$1@dont-email.me> <sde74m$nio$1@dont-email.me> <7cf5713e-f138-488b-9ccf-d85df84c50can@googlegroups.com>
<e7e0b9a2-7990-4ec8-9c40-a6e9a07bd306n@googlegroups.com> <fc5a33d0-7c17-4855-8ab3-162884bd6b7bn@googlegroups.com>
<713a35af-9cce-4954-b968-1b4b754e7b1en@googlegroups.com> <sdjghd$1i4a$1@gioia.aioe.org>
<sdk2kd$lu1$1@dont-email.me> <476a9f6b-5fa0-4606-aed6-cf31089b8c5bn@googlegroups.com>
<sdk7e0$mk2$1@dont-email.me> <FyCLI.4763$xn6.2271@fx23.iad>
<sdmu62$rlr$1@dont-email.me> <ad8db496-015a-4c9f-bda9-2057ad61a373n@googlegroups.com>
<NmVLI.28481$0N5.17498@fx06.iad> <79577ce3-4bd4-4104-8a49-6da9ca1c14e3n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <99f24173-11f4-4350-96bc-a5fd139acaa1n@googlegroups.com>
Subject: Re: The value of floating-point exceptions?
From: jsav...@ecn.ab.ca (Quadibloc)
Injection-Date: Tue, 27 Jul 2021 22:08:12 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Quadibloc - Tue, 27 Jul 2021 22:08 UTC

On Tuesday, July 27, 2021 at 11:40:56 AM UTC-6, MitchAlsup wrote:
> On Tuesday, July 27, 2021 at 10:11:44 AM UTC-5, EricP wrote:

> > Because x86/x64 and others (Alpha) put the control bits like round mode
> > and denorms-are-zero and exceptions mask, which are inputs,
> > in the same HW register as the result exception flags, which are outputs.
> > So reading the control bits requires synchronizing with the status bits.

> Yes, others did it wrong, that does not mean everyone has to do it wrong.

Oh dear. I'll have to revise the *original* Concertina architecture, then!

John Savard

Re: Configurable rounding modes (was The value of floating-point exceptions?)

<8a10f8dc-df84-4f3d-a0a3-a87935c929a4n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a37:6154:: with SMTP id v81mr25474929qkb.38.1627423852164; Tue, 27 Jul 2021 15:10:52 -0700 (PDT)
X-Received: by 2002:aca:ac46:: with SMTP id v67mr15772996oie.99.1627423851960; Tue, 27 Jul 2021 15:10:51 -0700 (PDT)
Path: i2pn2.org!i2pn.org!paganini.bofh.team!news.dns-netz.com!news.freedyn.net!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!tr3.eu1.usenetexpress.com!feeder.usenetexpress.com!tr2.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Tue, 27 Jul 2021 15:10:51 -0700 (PDT)
In-Reply-To: <sdpiea$ub0$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:56a:f39c:db00:6567:98f1:677f:acc2; posting-account=1nOeKQkAAABD2jxp4Pzmx9Hx5g9miO8y
NNTP-Posting-Host: 2001:56a:f39c:db00:6567:98f1:677f:acc2
References: <sd9a9h$ro6$1@dont-email.me> <memo.20210721153537.10680P@jgd.cix.co.uk> <e9c738bd-7c0e-4b3b-9385-3a0d0658b059n@googlegroups.com> <a74c6bf2-9ad1-4969-b3cb-b650ae8ebdadn@googlegroups.com> <sde6m7$kr1$1@dont-email.me> <sde74m$nio$1@dont-email.me> <7cf5713e-f138-488b-9ccf-d85df84c50can@googlegroups.com> <e7e0b9a2-7990-4ec8-9c40-a6e9a07bd306n@googlegroups.com> <fc5a33d0-7c17-4855-8ab3-162884bd6b7bn@googlegroups.com> <713a35af-9cce-4954-b968-1b4b754e7b1en@googlegroups.com> <sdjghd$1i4a$1@gioia.aioe.org> <sdk2kd$lu1$1@dont-email.me> <476a9f6b-5fa0-4606-aed6-cf31089b8c5bn@googlegroups.com> <sdlo5n$da3$1@dont-email.me> <1f8827fe-a288-4f2e-8e4e-40cc343febbdn@googlegroups.com> <sdol45$69t$1@dont-email.me> <e18db4b1-445e-4922-a417-4d48971b160bn@googlegroups.com> <sdpiea$ub0$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8a10f8dc-df84-4f3d-a0a3-a87935c929a4n@googlegroups.com>
Subject: Re: Configurable rounding modes (was The value of floating-point exceptions?)
From: jsav...@ecn.ab.ca (Quadibloc)
Injection-Date: Tue, 27 Jul 2021 22:10:52 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 19
 by: Quadibloc - Tue, 27 Jul 2021 22:10 UTC

On Tuesday, July 27, 2021 at 12:14:36 PM UTC-6, Ivan Godard wrote:
> On 7/27/2021 10:32 AM, MitchAlsup wrote:

> > Do you still pick 3 if the average instruction went from 32-bits in size to
> > 37 bits in size ?

> Come on, no straw men please. If adding 3 bits to a dozen opcodes pushes
> the average of the whole ISA from 32 to 37 bits then you have bigger
> encoding problems than FP rounding.

Well, I'm going to assume that a typical architecture doesn't have bit
addressing.
So if one makes a few instructions longer to specify the FP rounding
mode, they're going to be 8 bits longer or 16 bits longer or even 32
bits longer - not 3 bits longer.
Would that make the average instruction 5 bits longer?
If you're doing a lot of floating-point arithmetic, at least in the third
case, it _could_.

John Savard

Pages:12345678910
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor