Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

EARTH smog | bricks AIR -- mud -- FIRE soda water | tequila WATER


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: Configurable rounding modes (was The value of floating-point exceptions?)

<64e3b3f6-4bc1-490d-9e15-5deceb24d570n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a37:a004:: with SMTP id j4mr24237743qke.499.1627424164320;
Tue, 27 Jul 2021 15:16:04 -0700 (PDT)
X-Received: by 2002:a9d:61d9:: with SMTP id h25mr17226604otk.81.1627424164121;
Tue, 27 Jul 2021 15:16:04 -0700 (PDT)
Path: i2pn2.org!i2pn.org!paganini.bofh.team!news.dns-netz.com!news.freedyn.net!newsfeed.xs4all.nl!newsfeed9.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:16:03 -0700 (PDT)
In-Reply-To: <8a10f8dc-df84-4f3d-a0a3-a87935c929a4n@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>
<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> <8a10f8dc-df84-4f3d-a0a3-a87935c929a4n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <64e3b3f6-4bc1-490d-9e15-5deceb24d570n@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:16:04 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Quadibloc - Tue, 27 Jul 2021 22:16 UTC

On Tuesday, July 27, 2021 at 4:10:53 PM UTC-6, Quadibloc wrote:
> 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_.

In previous iterations of the Concertina II architecture, I used a few
bits in my block headers to indicate that the FP instructions used an
alternate set of lengths for floating-point operands. Now I might bring
a similar feature back, but to indicate the *rounding mode*.

That would avoid problems due to 16-bit instruction granularity - three
otherwise unused bits would specify the same rounding mode for
all the FP instructions in a block, which would work if one wants an
entire routine to use a consistent but non-default rounding mode.

John Savard

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

<220b143a-48ab-4d0c-8def-a8c9d95f97fen@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:622a:188d:: with SMTP id v13mr21835575qtc.192.1627427263343;
Tue, 27 Jul 2021 16:07:43 -0700 (PDT)
X-Received: by 2002:a4a:ad4d:: with SMTP id s13mr15398098oon.74.1627427263104;
Tue, 27 Jul 2021 16:07:43 -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 16:07:42 -0700 (PDT)
In-Reply-To: <sdpiea$ub0$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:ddb7:499a:3e72:ecd6;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:ddb7:499a:3e72:ecd6
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: <220b143a-48ab-4d0c-8def-a8c9d95f97fen@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 23:07:43 +0000
Content-Type: text/plain; charset="UTF-8"
 by: MitchAlsup - Tue, 27 Jul 2021 23:07 UTC

On Tuesday, July 27, 2021 at 1:14:36 PM UTC-5, 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.
<
You may work in a space where the instruction container size is a free
variable; almost nobody else does. So if a few percent of your instruction
stream needs feature x and feature x requires another whole 32-bit container,
then it is not just the 3-bits that get counted it is also the overhead of the
delivery mechanism.
>
> 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 am acutely aware of entropy................

Re: The value of floating-point exceptions?

<4f6731f1-db37-47cf-95e0-14b1dced6cd0n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a0c:e904:: with SMTP id a4mr16133596qvo.56.1627427366073;
Tue, 27 Jul 2021 16:09:26 -0700 (PDT)
X-Received: by 2002:a4a:2a05:: with SMTP id k5mr15306438oof.0.1627427365867;
Tue, 27 Jul 2021 16:09:25 -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 16:09:25 -0700 (PDT)
In-Reply-To: <sdphtb$nkp$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:ddb7:499a:3e72:ecd6;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:ddb7:499a:3e72:ecd6
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>
<sdphtb$nkp$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <4f6731f1-db37-47cf-95e0-14b1dced6cd0n@googlegroups.com>
Subject: Re: The value of floating-point exceptions?
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Tue, 27 Jul 2021 23:09:26 +0000
Content-Type: text/plain; charset="UTF-8"
 by: MitchAlsup - Tue, 27 Jul 2021 23:09 UTC

On Tuesday, July 27, 2021 at 1:05:33 PM UTC-5, Ivan Godard wrote:
> On 7/27/2021 10:30 AM, MitchAlsup wrote:

> > 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.
<
So you mean::
<
{oldRM=getRoundingMode();setRoundingMode(dyn); { doSomething(); } setRoundingMode(oldRM);}
<
>
> 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?)

<26a8f5c8-0207-403c-be71-d8c23593f2dbn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:622a:30d:: with SMTP id q13mr21726044qtw.147.1627427696560;
Tue, 27 Jul 2021 16:14:56 -0700 (PDT)
X-Received: by 2002:a4a:e9e8:: with SMTP id w8mr13530187ooc.5.1627427696413;
Tue, 27 Jul 2021 16:14:56 -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 16:14:56 -0700 (PDT)
In-Reply-To: <sdpja0$9mn$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:ddb7:499a:3e72:ecd6;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:ddb7:499a:3e72:ecd6
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> <sdpja0$9mn$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <26a8f5c8-0207-403c-be71-d8c23593f2dbn@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 23:14:56 +0000
Content-Type: text/plain; charset="UTF-8"
 by: MitchAlsup - Tue, 27 Jul 2021 23:14 UTC

On Tuesday, July 27, 2021 at 1:29:22 PM UTC-5, BGB wrote:
> On 7/27/2021 4:54 AM, Marcus wrote:

> > 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.
> >
<snip>
> >
> > 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.
<
IEEE 754-2019 says to use::
<
binaryRoundingDirection oldRM = getBinaryRoundingDirection(void)
and
void setBinaryRoundingDirection(binaryRoundingDirection)
<
What has not yet happened is for C (and many other languages) to decide
if this feature is static/threadLocal/global or whether it is embedded in scope:
<
withMode<RNA>{ doSomething(); }
<

Re: The value of floating-point exceptions?

<sdq5fh$eks$1@dont-email.me>

  copy mid

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

  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 16:39:29 -0700
Organization: A noiseless patient Spider
Lines: 36
Message-ID: <sdq5fh$eks$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>
<sdphtb$nkp$1@dont-email.me>
<4f6731f1-db37-47cf-95e0-14b1dced6cd0n@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 23:39:29 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="b26a368feec6b240bb732819daee4ddb";
logging-data="15004"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+uYSZkDuWEBHatOMEa0vis"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.12.0
Cancel-Lock: sha1:fTZU1dxjrqRK1N9DorWjuB6tamA=
In-Reply-To: <4f6731f1-db37-47cf-95e0-14b1dced6cd0n@googlegroups.com>
Content-Language: en-US
 by: Ivan Godard - Tue, 27 Jul 2021 23:39 UTC

On 7/27/2021 4:09 PM, MitchAlsup wrote:
> On Tuesday, July 27, 2021 at 1:05:33 PM UTC-5, Ivan Godard wrote:
>> On 7/27/2021 10:30 AM, MitchAlsup wrote:
>
>>> 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.
> <
> So you mean::
> <
> {oldRM=getRoundingMode();setRoundingMode(dyn); { doSomething(); } setRoundingMode(oldRM);}

No. that would leave the mode in a random state if doSomething threw or
longjmp'd out of the outer "{}".

You cannot turn a global variable into a scoped region. In C++ you could
code it as:
class modeSaver {
roundingMode old;
modeSaver(roundingMode rm) : old(getRoundingMode()){
setRoundingMode(rm);}
~modeSaver() { setRoundingMode(rold); }
}

{ modeSaver save(RNA); doSomething(); }

But that piggybacks on a scoped notion that the language already has.

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

<sdq5k2$eks$2@dont-email.me>

  copy mid

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

  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 16:41:54 -0700
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <sdq5k2$eks$2@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>
<8a10f8dc-df84-4f3d-a0a3-a87935c929a4n@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 23:41:54 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="b26a368feec6b240bb732819daee4ddb";
logging-data="15004"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19tIoYN3g0OT/ZYLR5B37zk"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.12.0
Cancel-Lock: sha1:6ujnrYofHwwnXX+WJDcORl0piEg=
In-Reply-To: <8a10f8dc-df84-4f3d-a0a3-a87935c929a4n@googlegroups.com>
Content-Language: en-US
 by: Ivan Godard - Tue, 27 Jul 2021 23:41 UTC

On 7/27/2021 3:10 PM, Quadibloc wrote:
> 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.

Typical architectures have broken and wasteful encoding.

> 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_.

Only if you insist on encoding bits instead of entropy. But that's not a
fault of rounding modes.

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

<sdq5p9$eks$3@dont-email.me>

  copy mid

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

  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 16:44:42 -0700
Organization: A noiseless patient Spider
Lines: 112
Message-ID: <sdq5p9$eks$3@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>
<220b143a-48ab-4d0c-8def-a8c9d95f97fen@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 23:44:42 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="b26a368feec6b240bb732819daee4ddb";
logging-data="15004"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19yQPL5Bqgf9rz1X4ZxQO0l"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.12.0
Cancel-Lock: sha1:mSmkGqTroJQPSJY3oWL2SnVkFnE=
In-Reply-To: <220b143a-48ab-4d0c-8def-a8c9d95f97fen@googlegroups.com>
Content-Language: en-US
 by: Ivan Godard - Tue, 27 Jul 2021 23:44 UTC

On 7/27/2021 4:07 PM, MitchAlsup wrote:
> On Tuesday, July 27, 2021 at 1:14:36 PM UTC-5, 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.
> <
> You may work in a space where the instruction container size is a free
> variable; almost nobody else does. So if a few percent of your instruction
> stream needs feature x and feature x requires another whole 32-bit container,
> then it is not just the 3-bits that get counted it is also the overhead of the
> delivery mechanism.

Then work in a space where instruction container size *is* a free
variable; we don't have a patent on entropy-dense encoding.

>>
>> 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 am acutely aware of entropy................
>

Why not use it then?

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

<35c6d8fe-67d6-4e7d-a171-3948e23f5347n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a37:6154:: with SMTP id v81mr26209409qkb.38.1627435926019;
Tue, 27 Jul 2021 18:32:06 -0700 (PDT)
X-Received: by 2002:a9d:61d9:: with SMTP id h25mr17657004otk.81.1627435925769;
Tue, 27 Jul 2021 18:32:05 -0700 (PDT)
Path: i2pn2.org!i2pn.org!news.niel.me!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: Tue, 27 Jul 2021 18:32:05 -0700 (PDT)
In-Reply-To: <sdq5k2$eks$2@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:56a:f39c:db00:dd85:9b47:afc7:d0ad;
posting-account=1nOeKQkAAABD2jxp4Pzmx9Hx5g9miO8y
NNTP-Posting-Host: 2001:56a:f39c:db00:dd85:9b47:afc7:d0ad
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> <8a10f8dc-df84-4f3d-a0a3-a87935c929a4n@googlegroups.com>
<sdq5k2$eks$2@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <35c6d8fe-67d6-4e7d-a171-3948e23f5347n@googlegroups.com>
Subject: Re: Configurable rounding modes (was The value of floating-point exceptions?)
From: jsav...@ecn.ab.ca (Quadibloc)
Injection-Date: Wed, 28 Jul 2021 01:32:06 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Quadibloc - Wed, 28 Jul 2021 01:32 UTC

On Tuesday, July 27, 2021 at 5:41:56 PM UTC-6, Ivan Godard wrote:

> Typical architectures have broken and wasteful encoding.

Wasteful, yes, but the waste is a side-effect of the encoding
being kept very simple.

John Savard

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

<37dc3074-a60d-4ee9-aa8b-74176039d894n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a37:7141:: with SMTP id m62mr16767749qkc.496.1627436464249;
Tue, 27 Jul 2021 18:41:04 -0700 (PDT)
X-Received: by 2002:a9d:7f14:: with SMTP id j20mr16537524otq.82.1627436464009;
Tue, 27 Jul 2021 18:41:04 -0700 (PDT)
Path: i2pn2.org!i2pn.org!paganini.bofh.team!usenet.pasdenom.info!usenet-fr.net!fdn.fr!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 18:41:03 -0700 (PDT)
In-Reply-To: <sdq5p9$eks$3@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:56a:f39c:db00:dd85:9b47:afc7:d0ad;
posting-account=1nOeKQkAAABD2jxp4Pzmx9Hx5g9miO8y
NNTP-Posting-Host: 2001:56a:f39c:db00:dd85:9b47:afc7:d0ad
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> <220b143a-48ab-4d0c-8def-a8c9d95f97fen@googlegroups.com>
<sdq5p9$eks$3@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <37dc3074-a60d-4ee9-aa8b-74176039d894n@googlegroups.com>
Subject: Re: Configurable rounding modes (was The value of floating-point exceptions?)
From: jsav...@ecn.ab.ca (Quadibloc)
Injection-Date: Wed, 28 Jul 2021 01:41:04 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Quadibloc - Wed, 28 Jul 2021 01:41 UTC

On Tuesday, July 27, 2021 at 5:44:44 PM UTC-6, Ivan Godard wrote:

> Then work in a space where instruction container size *is* a free
> variable; we don't have a patent on entropy-dense encoding.

Concertina II, despite being apparently in the same straitjacket as all
the other conventional architectures out there, actually achieves this.

By organizing instructions into 256-bit blocks, in order to use something
similar to heads-and-tails for Mitch Alsup's immediates, in a previous
incarnation I used 1111 as a header for a block built from 18-bit and
36-bit instructions, even if the _default_ instruction encoding was
plain old 32 bit.

And I had extra space in the headers to indicate stuff like the FP
rounding mode - if it stays the same for an entire subroutine,
that would be adequate, instead of doing it per instruction. But it's
the easiest thing in the world to stipulate a mode that says 'you've
got six instead of seven instructions in a block so you can add an
extra five bits to each instruction'... with a field in the _first_ 32-bit
slot that gives _hundreds_ of choices for what those extra five bits
are used for.

Don't tempt me.

But it's better to build an FPGA into a processor than to try and
anticipate every possible special feature someone might want and
then build them all in. For obvious reasons.

John Savard

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

<0fe7852d-666a-43ce-aaa9-3ca96cd1cc83n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:ac8:5546:: with SMTP id o6mr22681759qtr.69.1627442024669;
Tue, 27 Jul 2021 20:13:44 -0700 (PDT)
X-Received: by 2002:a9d:5603:: with SMTP id e3mr17401965oti.178.1627442024388;
Tue, 27 Jul 2021 20:13:44 -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 20:13:44 -0700 (PDT)
In-Reply-To: <37dc3074-a60d-4ee9-aa8b-74176039d894n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:56a:f39c:db00:dd85:9b47:afc7:d0ad;
posting-account=1nOeKQkAAABD2jxp4Pzmx9Hx5g9miO8y
NNTP-Posting-Host: 2001:56a:f39c:db00:dd85:9b47:afc7:d0ad
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> <220b143a-48ab-4d0c-8def-a8c9d95f97fen@googlegroups.com>
<sdq5p9$eks$3@dont-email.me> <37dc3074-a60d-4ee9-aa8b-74176039d894n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0fe7852d-666a-43ce-aaa9-3ca96cd1cc83n@googlegroups.com>
Subject: Re: Configurable rounding modes (was The value of floating-point exceptions?)
From: jsav...@ecn.ab.ca (Quadibloc)
Injection-Date: Wed, 28 Jul 2021 03:13:44 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Quadibloc - Wed, 28 Jul 2021 03:13 UTC

On Tuesday, July 27, 2021 at 7:41:05 PM UTC-6, Quadibloc wrote:

> And I had extra space in the headers to indicate stuff like the FP
> rounding mode - if it stays the same for an entire subroutine,
> that would be adequate, instead of doing it per instruction. But it's
> the easiest thing in the world to stipulate a mode that says 'you've
> got six instead of seven instructions in a block so you can add an
> extra five bits to each instruction'... with a field in the _first_ 32-bit
> slot that gives _hundreds_ of choices for what those extra five bits
> are used for.

> Don't tempt me.

That would be one way of getting rid of the competition. :)

But, of course, I am no competition to you, because even if I
resist temptation in one area, I will gleefully fall into it in another.

However, this discussion has inspired me to come up with an
invention! Which I now give freely to the world...

You've heard of the present-day supercomputer, which
connects together thousands of microprocessors working
in parallel to solve gigantic problems!

I give you... the super-_silly_-computer!

How do you implement an ISA that is so complicated
that Moore's law has not yet run for long enough to permit
it to be implemented on a single die?

Well, you could go back to implementing it across multiple
dies, and having its cycle time be measured in megahertz
instead of gigahertz. But that would make it useless!

Instead...

Let us assume that said complex ISA consists of
a conventional ISA, plus thousands of extensions to
support special data types like sexagesimal floating-point
that will be very rarely used.

So:

Instead of building chips with sixteen cores on them,
let us build chips consisting of eight cores, each of which
includes a co-processor for *one* of the many rarely-used
extensions to the instruction set.

And let that chip come in, oh, say, 128 different variations,
each containing eight _different_ extensions to the instruction
set in its cores, for a total of 1,024 extensions.

So one builds a computer with 128 chips, and when a
program uses one of those extensions, it is sent to one
of the chips that has a core capable of executing that
kind of instruction!!!

Voila - a computer capable of efficiently executing programs
written in an ISA so complicated that no single chip can
hold it!

John Savard

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

<85ad019b-64d1-440d-a6a3-d48eff234121n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:620a:90c:: with SMTP id v12mr25455962qkv.190.1627443213522;
Tue, 27 Jul 2021 20:33:33 -0700 (PDT)
X-Received: by 2002:aca:3144:: with SMTP id x65mr16840777oix.157.1627443213262;
Tue, 27 Jul 2021 20:33:33 -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: Tue, 27 Jul 2021 20:33:33 -0700 (PDT)
In-Reply-To: <0fe7852d-666a-43ce-aaa9-3ca96cd1cc83n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:56a:f39c:db00:dd85:9b47:afc7:d0ad;
posting-account=1nOeKQkAAABD2jxp4Pzmx9Hx5g9miO8y
NNTP-Posting-Host: 2001:56a:f39c:db00:dd85:9b47:afc7:d0ad
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> <220b143a-48ab-4d0c-8def-a8c9d95f97fen@googlegroups.com>
<sdq5p9$eks$3@dont-email.me> <37dc3074-a60d-4ee9-aa8b-74176039d894n@googlegroups.com>
<0fe7852d-666a-43ce-aaa9-3ca96cd1cc83n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <85ad019b-64d1-440d-a6a3-d48eff234121n@googlegroups.com>
Subject: Re: Configurable rounding modes (was The value of floating-point exceptions?)
From: jsav...@ecn.ab.ca (Quadibloc)
Injection-Date: Wed, 28 Jul 2021 03:33:33 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Quadibloc - Wed, 28 Jul 2021 03:33 UTC

On Tuesday, July 27, 2021 at 9:13:45 PM UTC-6, Quadibloc wrote:

> Instead of building chips with sixteen cores on them,
> let us build chips consisting of eight cores, each of which
> includes a co-processor for *one* of the many rarely-used
> extensions to the instruction set.
>
> And let that chip come in, oh, say, 128 different variations,
> each containing eight _different_ extensions to the instruction
> set in its cores, for a total of 1,024 extensions.

Think of it as a natural extension to what AMD did with
the floating-point unit in Bulldozer...

John Savard

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

<sdqk5u$udm$1@dont-email.me>

  copy mid

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

  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 22:50:19 -0500
Organization: A noiseless patient Spider
Lines: 118
Message-ID: <sdqk5u$udm$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> <sdpja0$9mn$1@dont-email.me>
<26a8f5c8-0207-403c-be71-d8c23593f2dbn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 28 Jul 2021 03:50:22 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="7c79c4a3f13d5bd91860f90c8d06b95d";
logging-data="31158"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19upvjSp3uSOCQReJ4xNTTj"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.12.0
Cancel-Lock: sha1:QmUe1kmDqRoBKbP6laees5qz7eU=
In-Reply-To: <26a8f5c8-0207-403c-be71-d8c23593f2dbn@googlegroups.com>
Content-Language: en-US
 by: BGB - Wed, 28 Jul 2021 03:50 UTC

On 7/27/2021 6:14 PM, MitchAlsup wrote:
> On Tuesday, July 27, 2021 at 1:29:22 PM UTC-5, BGB wrote:
>> On 7/27/2021 4:54 AM, Marcus wrote:
>
>>> 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.
>>>
> <snip>
>>>
>>> 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.
> <
> IEEE 754-2019 says to use::
> <
> binaryRoundingDirection oldRM = getBinaryRoundingDirection(void)
> and
> void setBinaryRoundingDirection(binaryRoundingDirection)
> <
> What has not yet happened is for C (and many other languages) to decide
> if this feature is static/threadLocal/global or whether it is embedded in scope:
> <
> withMode<RNA>{ doSomething(); }
> <
>

Not aware of any compilers doing it that way...

FWIW:
MSVC uses _controlfp and _controlfp_s.
OpenCL uses:
#pragma OPENCL SELECT_ROUNDING_MODE mode

I had considered:
#pragma rounding_mode(mode)
Or:
[[rounding_mode(mode)]]

Where the latter could be used like, say:

[[rounding_mode(truncate)]] double func(double x, double y)
{ ...
}

Or maybe:
double func(double x, double y)
{ [[rounding_mode(truncate)]] {
...
}
}

Where in the latter case, the rounding mode attribute would apply to a
particular block. I would need to figure out how to express this in the
IR stages though (per-function would be easier in this case).

As can be noted, my compiler is a bit mix-and-match regarding its use of
C standards, more following a pattern of implementing whatever I feel is
useful at a given time, rather than trying to implement everything in
the order they were added to the standards.

As, is:
C89:
Should be more-or-less good;
Well, excluding some stuff that is "mostly irrelevant", ...
C99:
A few edge-cases involving designated initializers;
_Imaginary is treated as analogous to _Complex;
VLAs exist, sorta, but they "kinda suck";
...
C11:
Various misc features supported;
Things like _Generic, still unsupported;
(Could add, I don't really "get it" though.)
...
C17:
Nothing notable was added vs C11.
C23:
Still proposal stage.
Had been cherry picking some of the features I liked.

There is a higher priority in my case for features that overlap with
BS2, some of which exist as extensions. Some of this stuff may also end
up being used indirectly via stuff happening in the runtime (analogous
to how crashes in MSVCRT may land on a bunch of C++ and/or C++/CLI stuff
in an otherwise C program).

I put a lower priority on C++ because I don't feel like C++ support is
terribly realistic at this stage.

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

<sdrnl6$jeh$1@dont-email.me>

  copy mid

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

  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: Wed, 28 Jul 2021 15:55:50 +0200
Organization: A noiseless patient Spider
Lines: 55
Message-ID: <sdrnl6$jeh$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: Wed, 28 Jul 2021 13:55:50 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="25b93c569393ef4150c7a99561baa33c";
logging-data="19921"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18kC/t1v/Hj1M22PnQ5/AhWg1fULGWBvJM="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:V0geUSYbGw7iH/Z6kD4sq/cJFEE=
In-Reply-To: <d52a2627-04f8-42ba-8572-ecb9bb3badd2n@googlegroups.com>
Content-Language: en-US
 by: Marcus - Wed, 28 Jul 2021 13:55 UTC

On 2021-07-27 19:34, 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*

That also works, as long as the default / parent RM state is restored
before any subroutine call (and reset to the requested RM state when
then subroutine returns).

>>
>> 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?

<sdro37$re5$1@dont-email.me>

  copy mid

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

  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: The value of floating-point exceptions?
Date: Wed, 28 Jul 2021 16:03:18 +0200
Organization: A noiseless patient Spider
Lines: 95
Message-ID: <sdro37$re5$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>
<sdphtb$nkp$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 28 Jul 2021 14:03:19 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="25b93c569393ef4150c7a99561baa33c";
logging-data="28101"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/e8eGyeXpp0iKGfMhEvwyCe31GB9kxu1Q="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:SBEYfTXB/FklVkWwgwZnksVk2FM=
In-Reply-To: <sdphtb$nkp$1@dont-email.me>
Content-Language: en-US
 by: Marcus - Wed, 28 Jul 2021 14:03 UTC

On 2021-07-27 20:05, Ivan Godard wrote:
> 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.

Exactly. Scoped FP configuration is probably the sanest language
construct (it should be simple and natural to scope it down to a single
instruction, e.g. if you need a special rounding mode in some step in
a transcendental function implementation for instance).

>
>> <
>> 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 ?

My interpretation of the situation is that IEEE 754 was largely inspired
by x87 (and similar architectures), and later IEEE 754 conformant
implementations mimicked that design (in order to be standard
compliant, if nothing else).

Does that mean that we need to make the same mistakes. I don't see why
9.3.1 & 9.3.2 need to be mandated.

/Marcus

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

<sdrupc$ibc$1@dont-email.me>

  copy mid

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

  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: Wed, 28 Jul 2021 17:57:27 +0200
Organization: A noiseless patient Spider
Lines: 140
Message-ID: <sdrupc$ibc$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> <sdpk4c$kdh$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 28 Jul 2021 15:57:32 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="25b93c569393ef4150c7a99561baa33c";
logging-data="18796"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+x+iO6qxl/aVx7QwDrEkUq7fkYIgHYJN8="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:Bn1R3YIEiIX5ZnlMbEMjIDxfNNs=
In-Reply-To: <sdpk4c$kdh$1@dont-email.me>
Content-Language: en-US
 by: Marcus - Wed, 28 Jul 2021 15:57 UTC

On 2021-07-27 20:43, BGB wrote:
> 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).

I agree too. Using up some 50 opcodes for FP instructions would be
doable, but given how rare non-RNE rounding modes are, I think I'll just
punt the problem and add a prefix mechanism at a later time (I have
spared some encoding pages for things like that, and I'm already
thinking about adding something like Mitch's CARRY prefix for multi-
precision arithmetic).

That would increase the size of FP instructions that use non-default
rounding modes from 32 bits to 64 bits (worst case), which is
acceptable in my book.

/Marcus

Re: The value of floating-point exceptions?

<d81caae9-cbdb-47a0-8f69-728061ea8092n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:620a:903:: with SMTP id v3mr316229qkv.235.1627487928690;
Wed, 28 Jul 2021 08:58:48 -0700 (PDT)
X-Received: by 2002:aca:c78d:: with SMTP id x135mr6769793oif.30.1627487928505;
Wed, 28 Jul 2021 08:58:48 -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: Wed, 28 Jul 2021 08:58:48 -0700 (PDT)
In-Reply-To: <sdro37$re5$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:56a:f39c:db00:e022:c6ef:6d82:f580;
posting-account=1nOeKQkAAABD2jxp4Pzmx9Hx5g9miO8y
NNTP-Posting-Host: 2001:56a:f39c:db00:e022:c6ef:6d82:f580
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>
<sdphtb$nkp$1@dont-email.me> <sdro37$re5$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d81caae9-cbdb-47a0-8f69-728061ea8092n@googlegroups.com>
Subject: Re: The value of floating-point exceptions?
From: jsav...@ecn.ab.ca (Quadibloc)
Injection-Date: Wed, 28 Jul 2021 15:58:48 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Quadibloc - Wed, 28 Jul 2021 15:58 UTC

On Wednesday, July 28, 2021 at 8:03:21 AM UTC-6, Marcus wrote:

> Does that mean that we need to make the same mistakes. I don't see why
> 9.3.1 & 9.3.2 need to be mandated.

Since these sections only apply to implementations that support
dynamic modes, if only static modes specified in the instruction
are present, they aren't required for compliance.

John Savard

Re: The value of floating-point exceptions?

<2021Jul28.192134@mips.complang.tuwien.ac.at>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ant...@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.arch
Subject: Re: The value of floating-point exceptions?
Date: Wed, 28 Jul 2021 17:21:34 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 39
Message-ID: <2021Jul28.192134@mips.complang.tuwien.ac.at>
References: <sd9a9h$ro6$1@dont-email.me> <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> <sdphtb$nkp$1@dont-email.me> <sdro37$re5$1@dont-email.me>
Injection-Info: reader02.eternal-september.org; posting-host="8b18bbfdfdd9080e119a794836100169";
logging-data="4740"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Yl+fOeH2SsltIPp99HGo3"
Cancel-Lock: sha1:nYZH9NK7HwnvT3sOia5BoXp9E0s=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Wed, 28 Jul 2021 17:21 UTC

Marcus <m.delete@this.bitsnbites.eu> writes:
>On 2021-07-27 20:05, Ivan Godard wrote:
>> 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.

You want the old rounding mode restored whenever you leave the scope,
by whatever means. That's just proper scoping. Lisp has
unwind-protect for that, Java has finally, other languages have
similar mechanisms.

Programming languages can implement this based on the architectural
(global) dynamic rounding mode, just like they implement local
variables based on (global) registers. Do those who think that the
dynamic rounding mode bits are a bad architectural feature have a
better alternative?

>My interpretation of the situation is that IEEE 754 was largely inspired
>by x87 (and similar architectures)

The story that I read (and you can find it in various places on the
net) is that Kahan advised Intel on the 8087 at around the same time
when he and others worked on IEEE 754. And Intel wanted to be
compatible with the upcoming standard.

If IEEE 754 just had wanted to standardize an existing implementation,
the highly successful VAX would have been a more likely target than
the newcomer 8087. And actually, I think that IEEE single and double
are the VAX F and G formats for normal numbers (minus the byte order
perversity of the VAX); but IEEE also added denormal numbers,
infinities, and NaNs, and defined the FP operations appropriately to
deal with that.

- anton
--
'Anyone trying for "industrial quality" ISA should avoid undefined behavior.'
Mitch Alsup, <c17fcd89-f024-40e7-a594-88a85ac10d20o@googlegroups.com>

Re: The value of floating-point exceptions?

<747eaef9-87a0-4d0c-b59d-327ccd28f287n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a0c:edb0:: with SMTP id h16mr1696834qvr.11.1627500735259;
Wed, 28 Jul 2021 12:32:15 -0700 (PDT)
X-Received: by 2002:a05:6830:929:: with SMTP id v41mr1091338ott.16.1627500735027;
Wed, 28 Jul 2021 12:32:15 -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: Wed, 28 Jul 2021 12:32:14 -0700 (PDT)
In-Reply-To: <2021Jul28.192134@mips.complang.tuwien.ac.at>
Injection-Info: google-groups.googlegroups.com; posting-host=87.68.182.112; posting-account=ow8VOgoAAAAfiGNvoH__Y4ADRwQF1hZW
NNTP-Posting-Host: 87.68.182.112
References: <sd9a9h$ro6$1@dont-email.me> <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>
<sdphtb$nkp$1@dont-email.me> <sdro37$re5$1@dont-email.me> <2021Jul28.192134@mips.complang.tuwien.ac.at>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <747eaef9-87a0-4d0c-b59d-327ccd28f287n@googlegroups.com>
Subject: Re: The value of floating-point exceptions?
From: already5...@yahoo.com (Michael S)
Injection-Date: Wed, 28 Jul 2021 19:32:15 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Michael S - Wed, 28 Jul 2021 19:32 UTC

On Wednesday, July 28, 2021 at 8:45:42 PM UTC+3, Anton Ertl wrote:
> Marcus <m.de...@this.bitsnbites.eu> writes:
> >On 2021-07-27 20:05, Ivan Godard wrote:
> >> 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.
> You want the old rounding mode restored whenever you leave the scope,
> by whatever means. That's just proper scoping. Lisp has
> unwind-protect for that, Java has finally, other languages have
> similar mechanisms.
>
> Programming languages can implement this based on the architectural
> (global) dynamic rounding mode, just like they implement local
> variables based on (global) registers. Do those who think that the
> dynamic rounding mode bits are a bad architectural feature have a
> better alternative?
> >My interpretation of the situation is that IEEE 754 was largely inspired
> >by x87 (and similar architectures)
> The story that I read (and you can find it in various places on the
> net) is that Kahan advised Intel on the 8087 at around the same time
> when he and others worked on IEEE 754. And Intel wanted to be
> compatible with the upcoming standard.
>
> If IEEE 754 just had wanted to standardize an existing implementation,
> the highly successful VAX would have been a more likely target than
> the newcomer 8087. And actually, I think that IEEE single and double
> are the VAX F and G formats for normal numbers (minus the byte order
> perversity of the VAX); but IEEE also added denormal numbers,
> infinities, and NaNs, and defined the FP operations appropriately to
> deal with that.
>

Out of memory, another difference apart from mixed endianness is that exponent bias differs by one.
I don't remember which one is bigger.
Also, I don't think you are correct about infinities. IIRC, VAX floating point formats have no NaN or subnormals but Inf is here.

> - anton
> --
> 'Anyone trying for "industrial quality" ISA should avoid undefined behavior.'
> Mitch Alsup, <c17fcd89-f024-40e7...@googlegroups.com>

Re: The value of floating-point exceptions?

<907ad68e-9672-4406-83e9-03114f9339a1n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a37:a6d2:: with SMTP id p201mr1476478qke.98.1627501996623;
Wed, 28 Jul 2021 12:53:16 -0700 (PDT)
X-Received: by 2002:a9d:7f14:: with SMTP id j20mr1113769otq.82.1627501996161;
Wed, 28 Jul 2021 12:53:16 -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: Wed, 28 Jul 2021 12:53:15 -0700 (PDT)
In-Reply-To: <sdro37$re5$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:56a:f39c:db00:4d79:150e:21fd:7a19;
posting-account=1nOeKQkAAABD2jxp4Pzmx9Hx5g9miO8y
NNTP-Posting-Host: 2001:56a:f39c:db00:4d79:150e:21fd:7a19
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>
<sdphtb$nkp$1@dont-email.me> <sdro37$re5$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <907ad68e-9672-4406-83e9-03114f9339a1n@googlegroups.com>
Subject: Re: The value of floating-point exceptions?
From: jsav...@ecn.ab.ca (Quadibloc)
Injection-Date: Wed, 28 Jul 2021 19:53:16 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Quadibloc - Wed, 28 Jul 2021 19:53 UTC

On Wednesday, July 28, 2021 at 8:03:21 AM UTC-6, Marcus wrote:

> My interpretation of the situation is that IEEE 754 was largely inspired
> by x87 (and similar architectures), and later IEEE 754 conformant
> implementations mimicked that design (in order to be standard
> compliant, if nothing else).

As this is _basically_ true, I saw no need to correct you, but since
other people have, but their corrections are... in my view, somewhat
incomplete... I now think I need to speak up.

Intel's 8087 did not pre-date the IEEE 754 standard.

But Intel was working on the 8087 at the time that the IEEE 754
standard was being drawn up. And what it presented to the committee
drawing it up was basically the *specification* for the 8087.

Which they adopted, minus a few of the rounding modes that the
original 8087 provided.

This was despite the fact that until Intel got their patents in hand,
Kahan wasn't able to reveal that, yes, it was actually possible to
achieve the perfect rounding that it was desired to include in the
standard. But eventually the secret of guard, round, and sticky
did get revealed in time.

John Savard

Re: The value of floating-point exceptions?

<7a2d58b7-dff4-46f1-8bf5-684bf43ced17n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:ad4:5965:: with SMTP id eq5mr1443894qvb.41.1627503323349; Wed, 28 Jul 2021 13:15:23 -0700 (PDT)
X-Received: by 2002:aca:c78d:: with SMTP id x135mr7452104oif.30.1627503323155; Wed, 28 Jul 2021 13:15:23 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!4.us.feeder.erje.net!2.eu.feeder.erje.net!feeder.erje.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!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: Wed, 28 Jul 2021 13:15:22 -0700 (PDT)
In-Reply-To: <907ad68e-9672-4406-83e9-03114f9339a1n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:56a:f39c:db00:4d79:150e:21fd:7a19; posting-account=1nOeKQkAAABD2jxp4Pzmx9Hx5g9miO8y
NNTP-Posting-Host: 2001:56a:f39c:db00:4d79:150e:21fd:7a19
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> <sdphtb$nkp$1@dont-email.me> <sdro37$re5$1@dont-email.me> <907ad68e-9672-4406-83e9-03114f9339a1n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <7a2d58b7-dff4-46f1-8bf5-684bf43ced17n@googlegroups.com>
Subject: Re: The value of floating-point exceptions?
From: jsav...@ecn.ab.ca (Quadibloc)
Injection-Date: Wed, 28 Jul 2021 20:15:23 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 15
 by: Quadibloc - Wed, 28 Jul 2021 20:15 UTC

On Wednesday, July 28, 2021 at 1:53:17 PM UTC-6, Quadibloc wrote:

> But Intel was working on the 8087 at the time that the IEEE 754
> standard was being drawn up. And what it presented to the committee
> drawing it up was basically the *specification* for the 8087.

While the IEEE 754 standard wasn't finalized and published until 1985,
and the 8087 was announced in 1980, the main part of the discussions
leading to its adoption took place earlier.

> Which they adopted, minus a few of the rounding modes that the
> original 8087 provided.

It was projective infinity that they dropped.

John Savard

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

<0fa6bb55-cbc9-400f-82de-a1102b7f9c34n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a0c:be85:: with SMTP id n5mr1852197qvi.59.1627504020799; Wed, 28 Jul 2021 13:27:00 -0700 (PDT)
X-Received: by 2002:a9d:4e0a:: with SMTP id p10mr1169520otf.329.1627504020568; Wed, 28 Jul 2021 13:27:00 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!tr3.eu1.usenetexpress.com!feeder.usenetexpress.com!tr3.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: Wed, 28 Jul 2021 13:27:00 -0700 (PDT)
In-Reply-To: <0fe7852d-666a-43ce-aaa9-3ca96cd1cc83n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:56a:f39c:db00:4d79:150e:21fd:7a19; posting-account=1nOeKQkAAABD2jxp4Pzmx9Hx5g9miO8y
NNTP-Posting-Host: 2001:56a:f39c:db00:4d79:150e:21fd:7a19
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> <220b143a-48ab-4d0c-8def-a8c9d95f97fen@googlegroups.com> <sdq5p9$eks$3@dont-email.me> <37dc3074-a60d-4ee9-aa8b-74176039d894n@googlegroups.com> <0fe7852d-666a-43ce-aaa9-3ca96cd1cc83n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0fa6bb55-cbc9-400f-82de-a1102b7f9c34n@googlegroups.com>
Subject: Re: Configurable rounding modes (was The value of floating-point exceptions?)
From: jsav...@ecn.ab.ca (Quadibloc)
Injection-Date: Wed, 28 Jul 2021 20:27:00 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 14
 by: Quadibloc - Wed, 28 Jul 2021 20:27 UTC

On Tuesday, July 27, 2021 at 9:13:45 PM UTC-6, Quadibloc wrote:
> Let us assume that said complex ISA consists of
> a conventional ISA, plus thousands of extensions to
> support special data types like sexagesimal floating-point
> that will be very rarely used.

And of course sexagesimal fixed point would be supported
as well.

After all, unless a computer could efficiently generate invoices
in Babylonian cuneiform, how could it possibly be considered
the very model of a modern micro-computer?

John Savard

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

<sdsglg$pn1$1@dont-email.me>

  copy mid

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

  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: Wed, 28 Jul 2021 16:02:38 -0500
Organization: A noiseless patient Spider
Lines: 171
Message-ID: <sdsglg$pn1$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> <sdpk4c$kdh$1@dont-email.me>
<sdrupc$ibc$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 28 Jul 2021 21:02:40 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="7c79c4a3f13d5bd91860f90c8d06b95d";
logging-data="26337"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Ol2kB5FC7JWXGRaskJcXV"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.12.0
Cancel-Lock: sha1:czhqZtmkhdA3+tHn7BTUA6SB9Sk=
In-Reply-To: <sdrupc$ibc$1@dont-email.me>
Content-Language: en-US
 by: BGB - Wed, 28 Jul 2021 21:02 UTC

On 7/28/2021 10:57 AM, Marcus wrote:
> On 2021-07-27 20:43, BGB wrote:
>> 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).
>
> I agree too. Using up some 50 opcodes for FP instructions would be
> doable, but given how rare non-RNE rounding modes are, I think I'll just
> punt the problem and add a prefix mechanism at a later time (I have
> spared some encoding pages for things like that, and I'm already
> thinking about adding something like Mitch's CARRY prefix for multi-
> precision arithmetic).
>

Yeah. As noted, I did it via an Op64 prefix:
FFwZ_ZZii

Where:
w: Extend GPR bits.
ZZZ: Extend Opcode (000 maps to the 32-bit encoding space)
ii: Extend Immed (or function as a 4th Imm8/Reg6).

Then made it so that the existing FADD/FSUB/FMUL ops will decode into a
form where the Imm8 extension serves as a rounding mode.

In terms of 3R->4R ops, one of several expansions can happen:
Rm, Ro, Rn, Rn: Default (Same as normal 3R), Imm8 is ignored.
Rm, Ro, I8, Rn: Possibility 1 (Used as Imm8)
Rm, Ro, Rp, Rn: Possibility 2 (Used as a Register)

When decoded without the Op64 prefix:
Rm, Ro, Rn, Rn: Default.
Rm, Ro, 0, Rn: Possibility 1 (Rp gets 0)
Rm, Ro, Rn, Rn: Possibility 2 (Rp gets Rn)


Click here to read the complete article
Re: The value of floating-point exceptions?

<sdsk71$1pav$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!aioe.org!ux6ld97kLXxG8kVFFLnoWg.user.46.165.242.75.POSTED!not-for-mail
From: chris.m....@gmail.com (Chris M. Thomasson)
Newsgroups: comp.arch
Subject: Re: The value of floating-point exceptions?
Date: Wed, 28 Jul 2021 15:03:10 -0700
Organization: Aioe.org NNTP Server
Message-ID: <sdsk71$1pav$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>
<905454f4-6aa8-4a4e-b0ef-6b55340c61d7n@googlegroups.com>
<sdfcrn$2s3$1@dont-email.me>
<2ec34aff-417e-4e2c-ad88-c500e17b1e78n@googlegroups.com>
<d3b65e22-c7de-4bf3-a650-63ca49ca623cn@googlegroups.com>
<b195fbdb-0cab-44a9-bb9d-5fd0c469fc10n@googlegroups.com>
<sdgek0$70h$1@dont-email.me> <sdhqj9$1l9s$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="58719"; posting-host="ux6ld97kLXxG8kVFFLnoWg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.12.0
X-Mozilla-News-Host: news://nntp.aioe.org
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Chris M. Thomasson - Wed, 28 Jul 2021 22:03 UTC

On 7/24/2021 12:44 PM, Chris M. Thomasson wrote:
> On 7/24/2021 12:14 AM, BGB wrote:
>> On 7/24/2021 1:05 AM, Quadibloc wrote:
>>> On Saturday, July 24, 2021 at 12:01:35 AM UTC-6, Quadibloc wrote:
>>>
>>>> I remember specifically that one particular failed Ariane launch was
>>>> held up as what bad floating-point can cause...
>>>
>>> Ah. A Google search led me to what really happened.
>>>
>>> The maiden flight of Ariane 5 failed because conversion from
>>> floating-point to 16-bit integer caused an exception, as the
>>> floating-point valule was not within the range of such integers.
>>>
>>> No doubt bad software design, but not really necessarily
>>> about the kind of numerical analysis concern that IEEE 754
>>> addresses.
>>>
>>
>> IME:
>> Inexact rounding is hardly ever the source of problems (excluding
>> integer-exact math in codecs, but this sort of stuff is typically
>> fixed-point).
>>
>>
>> However, more serious bugs, like unexpected overflow, saturation, or
>> traps, these sorts of things can ruin ones' day.
>>
>> Likewise for algorithms whose domain is "all real numbers except
>> zero", which just so happens to fail catastrophically and nuke the
>> program if the input just so happens to be zero.
>>
>>
>> Insufficient precision can also be a source of problems.
>>
>> Issues with the use of single precision coordinates in games trying to
>> deal with large worlds is a fairly common example (typically a lot of
>> workarounds are needed to make all the math work for worlds much
>> larger than a few km or so).
>
> Fwiw, I did a fractal encoding thing for pure fun where I map symbols to
> complex roots. The code only encodes/decodes data in a Julia set with a
> power of 16 to conveniently map into hexbytes. This is a pure
> experiment, but it works. Rounding errors and other floating point
> issues can make it crap out by decrypting part of the plaintext with
> some "junk" on it. So, I found an arbitrary precision lib in JavaScript,
> Decimal.js, and put it up online. Here it is:
>
> http://fractallife247.com/test/rifc_cipher
>
> A ciphertext is a single complex number. For instance here is one that
> contains my name:
>
> real:
> -0.70928383564905214400492596591643890200098992164665980782966227733203960188288097070737389345985516069300117982413622497654113697
>
>
> imag:
> 0.75006448767684071252250616852543657203512420946592887596427538863664520584158627985390890157772176873489867565028334553930789721
>

When you copy and paste there must be no errors, spaces, ect. In other
words this version is not fault tolerant at all wrt its crude bastard
parser.

So,

(-0.70928383564905214400492596591643890200098992164665980782966227733203960188288097070737389345985516069300117982413622497654113697)

Focus on the real between the parenthesis, no spaces or padding. It will
f*** up decrypting.

Re: The value of floating-point exceptions?

<ime30aF8vr7U1@mid.individual.net>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: niklas.h...@tidorum.invalid (Niklas Holsti)
Newsgroups: comp.arch
Subject: Re: The value of floating-point exceptions?
Date: Thu, 29 Jul 2021 01:11:22 +0300
Organization: Tidorum Ltd
Lines: 27
Message-ID: <ime30aF8vr7U1@mid.individual.net>
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>
<905454f4-6aa8-4a4e-b0ef-6b55340c61d7n@googlegroups.com>
<sdfcrn$2s3$1@dont-email.me>
<2ec34aff-417e-4e2c-ad88-c500e17b1e78n@googlegroups.com>
<d3b65e22-c7de-4bf3-a650-63ca49ca623cn@googlegroups.com>
<b195fbdb-0cab-44a9-bb9d-5fd0c469fc10n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net sGJ/CWbehV8L/Oh0hKUPTgPpiZxC0rl3T0ye5+ynDyS4pi4tdO
Cancel-Lock: sha1:iTTQLxmghLPZKP/9en28nVRmyAc=
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0)
Gecko/20100101 Thunderbird/78.12.0
In-Reply-To: <b195fbdb-0cab-44a9-bb9d-5fd0c469fc10n@googlegroups.com>
Content-Language: en-US
 by: Niklas Holsti - Wed, 28 Jul 2021 22:11 UTC

On 2021-07-24 9:05, Quadibloc wrote:
> On Saturday, July 24, 2021 at 12:01:35 AM UTC-6, Quadibloc wrote:
>
>> I remember specifically that one particular failed Ariane launch was
>> held up as what bad floating-point can cause...
>
> Ah. A Google search led me to what really happened.
>
> The maiden flight of Ariane 5 failed because conversion from
> floating-point to 16-bit integer caused an exception, as the
> floating-point valule was not within the range of such integers.
>
> No doubt bad software design,

The software in question was reused from the earlier Ariane 4 launchers.
It was carefully analyzed with respect to the Ariane 4 launch
trajectory, and the quantity in question was shown stay within 16-bit
integer range. Unfortunately that analysis was not repeated for Ariane
5, which has a different launch trajectory with a higher horizontal
velocity.

> but not really necessarily about the kind of numerical analysis
> concern that IEEE 754 addresses.

Yeah.

Re: The value of floating-point exceptions?

<d682d1da-b783-4758-8c08-ca2af2be4f05n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:620a:129a:: with SMTP id w26mr2083523qki.330.1627512161236;
Wed, 28 Jul 2021 15:42:41 -0700 (PDT)
X-Received: by 2002:aca:ac46:: with SMTP id v67mr1121435oie.99.1627512161049;
Wed, 28 Jul 2021 15:42:41 -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: Wed, 28 Jul 2021 15:42:40 -0700 (PDT)
In-Reply-To: <747eaef9-87a0-4d0c-b59d-327ccd28f287n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:b902:cdd8:91d0:9b96;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:b902:cdd8:91d0:9b96
References: <sd9a9h$ro6$1@dont-email.me> <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>
<sdphtb$nkp$1@dont-email.me> <sdro37$re5$1@dont-email.me> <2021Jul28.192134@mips.complang.tuwien.ac.at>
<747eaef9-87a0-4d0c-b59d-327ccd28f287n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d682d1da-b783-4758-8c08-ca2af2be4f05n@googlegroups.com>
Subject: Re: The value of floating-point exceptions?
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Wed, 28 Jul 2021 22:42:41 +0000
Content-Type: text/plain; charset="UTF-8"
 by: MitchAlsup - Wed, 28 Jul 2021 22:42 UTC

On Wednesday, July 28, 2021 at 2:32:16 PM UTC-5, Michael S wrote:
> On Wednesday, July 28, 2021 at 8:45:42 PM UTC+3, Anton Ertl wrote:
> > Marcus <m.de...@this.bitsnbites.eu> writes:
> > >On 2021-07-27 20:05, Ivan Godard wrote:

> >
> Out of memory, another difference apart from mixed endianness is that exponent bias differs by one.
> I don't remember which one is bigger.
<
754 choose an exponent whereby the largest denormal binade does not
cause overflow when reciprocated.
<
> Also, I don't think you are correct about infinities. IIRC, VAX floating point formats have no NaN or subnormals but Inf is here.
> > - anton
> > --
> > 'Anyone trying for "industrial quality" ISA should avoid undefined behavior.'
> > Mitch Alsup, <c17fcd89-f024-40e7...@googlegroups.com>

Pages:12345678910
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor