Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

"Here comes Mr. Bill's dog." -- Narrator, Saturday Night Live


devel / comp.arch / The synergy of type tags on register file registers

SubjectAuthor
* The synergy of type tags on register file registersJimBrakefield
+* Re: The synergy of type tags on register file registersTerje Mathisen
|`- Re: The synergy of type tags on register file registersrobf...@gmail.com
`* Re: The synergy of type tags on register file registersluke.l...@gmail.com
 +* Re: The synergy of type tags on register file registersluke.l...@gmail.com
 |`- Re: The synergy of type tags on register file registersScott Lurndal
 +* Re: The synergy of type tags on register file registersNiklas Holsti
 |`- Re: The synergy of type tags on register file registersluke.l...@gmail.com
 `* Re: The synergy of type tags on register file registersMitchAlsup
  +* Re: The synergy of type tags on register file registersJimBrakefield
  |+- Re: The synergy of type tags on register file registersluke.l...@gmail.com
  |`* Re: The synergy of type tags on register file registersMitchAlsup
  | +* Re: The synergy of type tags on register file registersJimBrakefield
  | |+- Re: The synergy of type tags on register file registersMitchAlsup
  | |+* Re: The synergy of type tags on register file registersluke.l...@gmail.com
  | ||+* Re: The synergy of type tags on register file registersMitchAlsup
  | |||`* Re: The synergy of type tags on register file registersThomas Koenig
  | ||| +* Re: The synergy of type tags on register file registersluke.l...@gmail.com
  | ||| |`- Re: The synergy of type tags on register file registersMitchAlsup
  | ||| +* Re: The synergy of type tags on register file registersBGB
  | ||| |`* Re: The synergy of type tags on register file registersMitchAlsup
  | ||| | `- Re: The synergy of type tags on register file registersBGB
  | ||| `* Re: The synergy of type tags on register file registersTerje Mathisen
  | |||  +* Re: The synergy of type tags on register file registersMitchAlsup
  | |||  |`- Re: The synergy of type tags on register file registersTerje Mathisen
  | |||  `* Re: The synergy of type tags on register file registersThomas Koenig
  | |||   `* Re: The synergy of type tags on register file registersTerje Mathisen
  | |||    `* Re: The synergy of type tags on register file registersluke.l...@gmail.com
  | |||     +* Re: The synergy of type tags on register file registersScott Lurndal
  | |||     |`* Re: The synergy of type tags on register file registersluke.l...@gmail.com
  | |||     | `- Re: The synergy of type tags on register file registersMitchAlsup
  | |||     +* Re: The synergy of type tags on register file registersThomas Koenig
  | |||     |`- Re: The synergy of type tags on register file registersBGB
  | |||     +* Re: The synergy of type tags on register file registersTerje Mathisen
  | |||     |`* Re: The synergy of type tags on register file registersMitchAlsup
  | |||     | +* Re: The synergy of type tags on register file registersTerje Mathisen
  | |||     | |+- Re: The synergy of type tags on register file registersMitchAlsup
  | |||     | |`* Re: The synergy of type tags on register file registersluke.l...@gmail.com
  | |||     | | +- Re: The synergy of type tags on register file registersMitchAlsup
  | |||     | | `- Re: The synergy of type tags on register file registersJimBrakefield
  | |||     | `* Re: The synergy of type tags on register file registersScott Lurndal
  | |||     |  +- Re: The synergy of type tags on register file registersluke.l...@gmail.com
  | |||     |  +* Re: The synergy of type tags on register file registersBGB
  | |||     |  |`* Re: The synergy of type tags on register file registersAnton Ertl
  | |||     |  | `* Re: The synergy of type tags on register file registersMitchAlsup
  | |||     |  |  `* Re: The synergy of type tags on register file registersBGB
  | |||     |  |   `* Re: The synergy of type tags on register file registersAnton Ertl
  | |||     |  |    +* Re: The synergy of type tags on register file registersBGB
  | |||     |  |    |`* Re: The synergy of type tags on register file registersMitchAlsup
  | |||     |  |    | `- Re: The synergy of type tags on register file registersBGB
  | |||     |  |    `* Re: The synergy of type tags on register file registersThomas Koenig
  | |||     |  |     `- Re: The synergy of type tags on register file registersTerje Mathisen
  | |||     |  `* Re: The synergy of type tags on register file registersAnton Ertl
  | |||     |   `- Re: The synergy of type tags on register file registersMichael S
  | |||     +- Re: The synergy of type tags on register file registersBGB
  | |||     `* Re: The synergy of type tags on register file registersMitchAlsup
  | |||      +- Re: The synergy of type tags on register file registersluke.l...@gmail.com
  | |||      `* Re: The synergy of type tags on register file registersStephen Fuld
  | |||       +* Re: The synergy of type tags on register file registersMitchAlsup
  | |||       |`- Re: The synergy of type tags on register file registersStephen Fuld
  | |||       `* Re: The synergy of type tags on register file registersAnton Ertl
  | |||        +* Re: The synergy of type tags on register file registersStephen Fuld
  | |||        |+* Re: The synergy of type tags on register file registersMitchAlsup
  | |||        ||+- Re: The synergy of type tags on register file registersScott Lurndal
  | |||        ||`* Re: The synergy of type tags on register file registersStephen Fuld
  | |||        || +- Re: The synergy of type tags on register file registersThomas Koenig
  | |||        || `* Re: The synergy of type tags on register file registersJohn Dallman
  | |||        ||  `* Re: The synergy of type tags on register file registersThomas Koenig
  | |||        ||   +* Re: The synergy of type tags on register file registersJohn Dallman
  | |||        ||   |`- Re: The synergy of type tags on register file registersThomas Koenig
  | |||        ||   `* Re: The synergy of type tags on register file registersTerje Mathisen
  | |||        ||    `* Re: The synergy of type tags on register file registersMitchAlsup
  | |||        ||     `- Re: The synergy of type tags on register file registersTerje Mathisen
  | |||        |`* Re: The synergy of type tags on register file registersAnton Ertl
  | |||        | +* Re: The synergy of type tags on register file registersStephen Fuld
  | |||        | |+* Re: The synergy of type tags on register file registersBGB
  | |||        | ||`* Re: The synergy of type tags on register file registersrobf...@gmail.com
  | |||        | || +* Re: The synergy of type tags on register file registersMitchAlsup
  | |||        | || |`* Re: The synergy of type tags on register file registersMichael S
  | |||        | || | `* Re: The synergy of type tags on register file registersMitchAlsup
  | |||        | || |  `* Re: The synergy of type tags on register file registersMichael S
  | |||        | || |   `- Re: The synergy of type tags on register file registersMitchAlsup
  | |||        | || +* Re: The synergy of type tags on register file registersBGB
  | |||        | || |`- Re: The synergy of type tags on register file registersMitchAlsup
  | |||        | || `* Re: The synergy of type tags on register file registersScott Lurndal
  | |||        | ||  +- Re: The synergy of type tags on register file registersBGB
  | |||        | ||  `* Re: The synergy of type tags on register file registersMitchAlsup
  | |||        | ||   +- Re: The synergy of type tags on register file registersBGB
  | |||        | ||   +* Re: The synergy of type tags on register file registersluke.l...@gmail.com
  | |||        | ||   |`* Re: The synergy of type tags on register file registersScott Lurndal
  | |||        | ||   | `* Re: The synergy of type tags on register file registersBGB
  | |||        | ||   |  `* Re: The synergy of type tags on register file registersScott Lurndal
  | |||        | ||   |   `* Re: The synergy of type tags on register file registersBGB
  | |||        | ||   |    `* Re: The synergy of type tags on register file registersScott Lurndal
  | |||        | ||   |     +* Re: The synergy of type tags on register file registersStephen Fuld
  | |||        | ||   |     |`- Re: The synergy of type tags on register file registersScott Lurndal
  | |||        | ||   |     +* Re: The synergy of type tags on register file registersMitchAlsup
  | |||        | ||   |     |`* Re: The synergy of type tags on register file registersScott Lurndal
  | |||        | ||   |     | `* Re: The synergy of type tags on register file registersMitchAlsup
  | |||        | ||   |     |  `- Re: The synergy of type tags on register file registersScott Lurndal
  | |||        | ||   |     `* Re: The synergy of type tags on register file registersBGB
  | |||        | ||   `- Re: The synergy of type tags on register file registersIvan Godard
  | |||        | |+* Re: The synergy of type tags on register file registersAnton Ertl
  | |||        | |`* Re: The synergy of type tags on register file registersTerje Mathisen
  | |||        | +* Re: The synergy of type tags on register file registersBill Findlay
  | |||        | `- Re: The synergy of type tags on register file registersTerje Mathisen
  | |||        `- Re: The synergy of type tags on register file registersMitchAlsup
  | ||`* Re: The synergy of type tags on register file registersScott Lurndal
  | |`- Re: The synergy of type tags on register file registersNiklas Holsti
  | `- Re: The synergy of type tags on register file registersScott Lurndal
  `* Re: The synergy of type tags on register file registersPaul A. Clayton

Pages:12345678910
Re: The synergy of type tags on register file registers

<u5ejpq$3g18m$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=32589&group=comp.arch#32589

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: cr88192@gmail.com (BGB)
Newsgroups: comp.arch
Subject: Re: The synergy of type tags on register file registers
Date: Sat, 3 Jun 2023 00:41:11 -0500
Organization: A noiseless patient Spider
Lines: 180
Message-ID: <u5ejpq$3g18m$1@dont-email.me>
References: <08f739ac-2200-408c-a578-79e93f9cb272n@googlegroups.com>
<u57v63$2f5km$1@dont-email.me>
<4168d555-a14c-4ed8-b2dc-7ae34588544fn@googlegroups.com>
<Ds1eM.858712$PXw7.741546@fx45.iad>
<c1e79245-bbc8-443c-aacd-0441d49ab84bn@googlegroups.com>
<f70924d3-49c8-4e0e-83d8-140a5c7ae4d2n@googlegroups.com>
<QrneM.597255$mmyc.279072@fx37.iad> <u5d4fa$37u8l$1@dont-email.me>
<9speM.529570$0dpc.321120@fx33.iad> <u5dbvr$38nbs$1@dont-email.me>
<08reM.2343550$MVg8.1754411@fx12.iad> <u5e9bl$3f0pv$1@dont-email.me>
<2IyeM.438218$jiuc.158540@fx44.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 3 Jun 2023 05:41:14 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="ec2bbef6d9205169dcd520037c2a05a3";
logging-data="3671318"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+1rkbTOVHCE8F+C7MoGEZ9"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.11.2
Cancel-Lock: sha1:TVxlr//FbpEJnEcjciBj7/0UZkM=
Content-Language: en-US
In-Reply-To: <2IyeM.438218$jiuc.158540@fx44.iad>
 by: BGB - Sat, 3 Jun 2023 05:41 UTC

On 6/2/2023 10:46 PM, Scott Lurndal wrote:
> BGB <cr88192@gmail.com> writes:
>> On 6/2/2023 2:09 PM, Scott Lurndal wrote:
>>> BGB <cr88192@gmail.com> writes:
>>>> On 6/2/2023 12:14 PM, Scott Lurndal wrote:
>>>>> BGB <cr88192@gmail.com> writes:
>>>>>> On 6/2/2023 9:57 AM, Scott Lurndal wrote:
>>>
>>>>>
>>>>> Again, why do you believe this to be a major weakness, and what
>>>>> "traditional access control" mechanism do you believe is superior?
>>>>>
>>>>
>>>> If you can find a way to forge capabilities, or steal capabilities from
>>>> elsewhere, this shoots a big hole in the security model.
>>>
>>> So how is that any different from any other security model?
>>>
>>> The idea is to make the security footprint as small as possible,
>>> and capabilities are the ideal there, and the corresponding hardware
>>> is easier to make secure.
>>>
>>
>> But, not entirely transparent to "ye olde C".
>
> The CHERI folks have described language extensions to
> adapt C to this type of architecture.
>

Fair enough.

At least with my bounds-check scheme, I was able to use mostly unmodified C.

Main exception was explicit 128-bit pointers within the 64-bit ABI
needing a non-standard keyword ("__huge").

But, this is N/A if not using 128-bit pointers (typically, not used
directly), or if using exclusively 128-bit pointers (though this mode
still needs more debugging work).

>>
>> At least if one accepts all the various ways people like to abuse the
>> language as at least "semi valid".
>
> They can always devolve to in-line assembler (e.g. for OS/Hypervisors)
> to "abuse" the language.
>
>>>
>>> The compilers handle everything. There is no 'significant hindrance
>>> to software development'.
>>>
>>
>> If your language looks like Java or C# or similar.
>
> Two of the top 5 in use today. Python, C++ and soon
> Rust all of which can use capabilites opaque to the
> programmer.
>

OK.

For Python or JavaScript, they have no reason to care.

One downsize though is that capabilities don't allow bit-twiddling the
pointers to encode type-tag bits; and presumably, don't allow falling
back to non-capability pointers (as this would defeat the point).

In my case though, one is allowed to fall back to unchecked pointers,
given the assumption of page-level protections in the background.

Granted, this is likely the most major functional difference between the
models.

Well, and in my project, bounds-checked pointers are merely one type of
pointer, and it also functions as a tagref system, say:
Bare / Object-Type Tagged Pointers;
Various small value types;
Bounds-checked pointers;
Fixnums;
Flonums;
...

In this case, dynamic types are used in a few places as well (and some
of the support mechanisms used for dynamic types are shared with those
used for working with bounds-checked pointers). No current canonical
textual representation for dynamic types though, but if there were, it
would likely sorta resemble JSON or similar.

With bounds-checks disabled, C pointers default to being zero-extended
(untagged). When enabled, the default is to use Bounds-checked pointers
for all array-like types (doesn't bother for structs, but these don't
really hurt anything either).

In the kernel, the "malloc" calls also use bounds-checked pointers, but
this is not currently done in userspace.

>>
>> Or, one is happy to use a subset of C that doesn't allow "abusing"
>> pointers and type-casts in various ways, or makes various other "non
>> portable" assumptions.
>
> You mean code for security rather than convenience. I think you
> overestimate the amount of language abuse that is tolerated in
> production code.
>

Possibly, or a lot of the code I had looked at before is not
particularly portable.

Granted, a fair chunk of the 3rd party code I had ported to BJX2 was
originally written by (or based on code written by) John Carmack back in
the 1990s, not sure how this falls on the spectrum.

Still better than the "raging trash fire" of a lot of the code I saw
that had been released by Apogee / 3D Realms.

Most of it required rewriting parts to work on more modern systems (or
on systems with 64-bit pointers, ...).

Well, and had also used some (older) code originally written by Paul
Edwards (of PDOS fame). But ended up mostly rewriting a lot of it, as
some of it was a bit lacking.

I have tested a few things with bounds-checked pointers:
Doom, Heretic, ROTT, and TestKern itself.

Basically works, though due to misc reasons, seems to generally have
around a 5% performance penalty.

It is possible, that in many cases, the gain in terms of "out of bounds
will immediately trap" outweighs the performance cost, and the overhead
could be reduced slightly by adding more specialized helper cases (such
as a dedicated "compare pointers by address" instruction).

My uses thus far had mostly been debugging-related though (as they can
help catch a lot of subtle bugs one might otherwise miss).

>>
>> But, if someone tries to compile code and the compiler is like "error:
>> that aint gonna fly here", they are liable to blame the architecture
>> rather than fix the code.
>
> Come now, every new warning added to gcc or clang is basically
> 'that ain't gonna fly here' and people aren't blaming anything
> but the compiler, if they complain at all, which they don't in
> general.
>

Fair enough.

I added some warnings for misc things, like emitting a warning whenever
a variable is used without first being initialized. But, the current
implementation has some false positives, to it is necessary sometimes to
add an otherwise frivolous "x=0;" or similar at the top of the function,
even if using the variable uninitialized will not effect the final
result of the function.

Comparably though, GCC and Clang emit lots of warnings (but then allow
some things that are an error in MSVC, like doing pointer arithmetic on
"void *").

Sometimes, comparing warnings between compilers can point out bugs though.

....

Re: The synergy of type tags on register file registers

<u5epbh$3ggrq$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=32591&group=comp.arch#32591

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ivan@millcomputing.com (Ivan Godard)
Newsgroups: comp.arch
Subject: Re: The synergy of type tags on register file registers
Date: Sat, 3 Jun 2023 00:16:02 -0700
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <u5epbh$3ggrq$1@dont-email.me>
References: <08f739ac-2200-408c-a578-79e93f9cb272n@googlegroups.com>
<u50c3t$10g9m$1@dont-email.me> <u51j2o$270ah$1@newsreader4.netcologne.de>
<u51v6p$1cf9p$2@dont-email.me>
<806573a4-0ee6-4bc7-a99b-37957669b868n@googlegroups.com>
<d94b9337-52e2-4b05-a26b-ca4b011df7d5n@googlegroups.com>
<u53cfh$1mn06$1@dont-email.me> <2023May30.192304@mips.complang.tuwien.ac.at>
<u55f2q$22hh1$1@dont-email.me> <2023May31.075457@mips.complang.tuwien.ac.at>
<u57ond$2edvp$1@dont-email.me> <2023Jun1.081845@mips.complang.tuwien.ac.at>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 3 Jun 2023 07:16:01 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="cf3f6b73038519fcab70d06a79c4798a";
logging-data="3687290"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/IdqMHSkeN1+nro9Uuh9XG"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.11.2
Cancel-Lock: sha1:0q+rnBRPQu5IeHKobagV7S2pBbU=
In-Reply-To: <2023Jun1.081845@mips.complang.tuwien.ac.at>
Content-Language: en-US
 by: Ivan Godard - Sat, 3 Jun 2023 07:16 UTC

On 5/31/2023 11:18 PM, Anton Ertl wrote:
> Stephen Fuld <sfuld@alumni.cmu.edu.invalid> writes:
>> If 128 bit arithmetic becomes popular, and it is only
>> implemented in the SIMD registers, you could end up with something like
>> the 68000 with separate data versus address registers. :-(
>
> Yes, or the CDC 6600 A/B and X registers. But I don't expect that
> 128-bit arithmetic will become popular enough that popular
> architectures add 128-bit instructions for them. As for 128-bit
> addresses, given the slowdown in semiconductor advances, we may never
> get there.
>
> - anton

Arithmetic already is in the commercial world: 33-digit decimal requires
128. Agreed probably not for a while for raw addresses, but caps need at
least that much.

Re: The synergy of type tags on register file registers

<u5epfs$3ggrq$2@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=32592&group=comp.arch#32592

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ivan@millcomputing.com (Ivan Godard)
Newsgroups: comp.arch
Subject: Re: The synergy of type tags on register file registers
Date: Sat, 3 Jun 2023 00:18:21 -0700
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <u5epfs$3ggrq$2@dont-email.me>
References: <08f739ac-2200-408c-a578-79e93f9cb272n@googlegroups.com>
<u51v6p$1cf9p$2@dont-email.me>
<806573a4-0ee6-4bc7-a99b-37957669b868n@googlegroups.com>
<d94b9337-52e2-4b05-a26b-ca4b011df7d5n@googlegroups.com>
<u53cfh$1mn06$1@dont-email.me> <2023May30.192304@mips.complang.tuwien.ac.at>
<u55f2q$22hh1$1@dont-email.me> <2023May31.075457@mips.complang.tuwien.ac.at>
<u57ond$2edvp$1@dont-email.me> <u57v63$2f5km$1@dont-email.me>
<4168d555-a14c-4ed8-b2dc-7ae34588544fn@googlegroups.com>
<Ds1eM.858712$PXw7.741546@fx45.iad>
<c1e79245-bbc8-443c-aacd-0441d49ab84bn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 3 Jun 2023 07:18:20 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="cf3f6b73038519fcab70d06a79c4798a";
logging-data="3687290"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19ok+1rtSGel1HcW2mUqu4t"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.11.2
Cancel-Lock: sha1:XimS/P8ZhllS6ZXQt/jmR1GeZxo=
Content-Language: en-US
In-Reply-To: <c1e79245-bbc8-443c-aacd-0441d49ab84bn@googlegroups.com>
 by: Ivan Godard - Sat, 3 Jun 2023 07:18 UTC

On 6/1/2023 7:03 PM, MitchAlsup wrote:
> On Thursday, June 1, 2023 at 8:56:55 AM UTC-5, Scott Lurndal wrote:
>>
>> See https://www.cl.cam.ac.uk/research/security/ctsrd/cheri/
> <
> If there is one thing I am smart enough to understand::
> <
> It is that I am not smart enough to grasp capabilities to the extent
> needed to architect a capability machine.
> <
> ............

:-)

The machine is not the problem; you certainly can do that in your sleep.
The problem is the semantics.

Re: The synergy of type tags on register file registers

<2023Jun3.123354@mips.complang.tuwien.ac.at>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=32595&group=comp.arch#32595

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.arch
Subject: Re: The synergy of type tags on register file registers
Date: Sat, 03 Jun 2023 10:33:54 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 25
Message-ID: <2023Jun3.123354@mips.complang.tuwien.ac.at>
References: <08f739ac-2200-408c-a578-79e93f9cb272n@googlegroups.com> <Ds1eM.858712$PXw7.741546@fx45.iad> <c1e79245-bbc8-443c-aacd-0441d49ab84bn@googlegroups.com> <f70924d3-49c8-4e0e-83d8-140a5c7ae4d2n@googlegroups.com> <QrneM.597255$mmyc.279072@fx37.iad> <u5d4fa$37u8l$1@dont-email.me> <9speM.529570$0dpc.321120@fx33.iad> <u5dbvr$38nbs$1@dont-email.me> <08reM.2343550$MVg8.1754411@fx12.iad> <u5e9bl$3f0pv$1@dont-email.me> <2IyeM.438218$jiuc.158540@fx44.iad>
Injection-Info: dont-email.me; posting-host="48cceea1648e163db3d5948604c1101d";
logging-data="3735338"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/ys45fHf2obYLM5rahdzxj"
Cancel-Lock: sha1:oXNReDr04Kk+jr6cueYBQjBEydI=
X-newsreader: xrn 10.11
 by: Anton Ertl - Sat, 3 Jun 2023 10:33 UTC

scott@slp53.sl.home (Scott Lurndal) writes:
>BGB <cr88192@gmail.com> writes:
>>But, if someone tries to compile code and the compiler is like "error:
>>that aint gonna fly here", they are liable to blame the architecture
>>rather than fix the code.
>
>Come now, every new warning added to gcc or clang is basically
>'that ain't gonna fly here' and people aren't blaming anything
>but the compiler, if they complain at all, which they don't in
>general.

That's because the compiler *is* to blame. E.g., programmers know
that the architectures they use support modulo arithmetic; they know
that the compiler usually performs modulo arithmetic. So when the
compiler does something else in select situations, why would the
programmer blame the architecture?

For comparison, when, as on MacOS on Apple Silicon, my mmap() calls
fail, and these calls work on MacOS on Intel, and on Linux on Apple
Silicon, I blame MacOS.

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

Re: The synergy of type tags on register file registers

<2023Jun3.124957@mips.complang.tuwien.ac.at>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=32596&group=comp.arch#32596

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.arch
Subject: Re: The synergy of type tags on register file registers
Date: Sat, 03 Jun 2023 10:49:57 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 33
Message-ID: <2023Jun3.124957@mips.complang.tuwien.ac.at>
References: <08f739ac-2200-408c-a578-79e93f9cb272n@googlegroups.com> <u51v6p$1cf9p$2@dont-email.me> <806573a4-0ee6-4bc7-a99b-37957669b868n@googlegroups.com> <d94b9337-52e2-4b05-a26b-ca4b011df7d5n@googlegroups.com> <u53cfh$1mn06$1@dont-email.me> <2023May30.192304@mips.complang.tuwien.ac.at> <u55f2q$22hh1$1@dont-email.me> <2023May31.075457@mips.complang.tuwien.ac.at> <u57ond$2edvp$1@dont-email.me> <2023Jun1.081845@mips.complang.tuwien.ac.at> <u5epbh$3ggrq$1@dont-email.me>
Injection-Info: dont-email.me; posting-host="48cceea1648e163db3d5948604c1101d";
logging-data="3735338"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19yUgnOsPSOMPwxBhas6co/"
Cancel-Lock: sha1:wuCOARP+8GorLpSzyOVyLqd/LgY=
X-newsreader: xrn 10.11
 by: Anton Ertl - Sat, 3 Jun 2023 10:49 UTC

Ivan Godard <ivan@millcomputing.com> writes:
>On 5/31/2023 11:18 PM, Anton Ertl wrote:
>> Stephen Fuld <sfuld@alumni.cmu.edu.invalid> writes:
>>> If 128 bit arithmetic becomes popular, and it is only
>>> implemented in the SIMD registers, you could end up with something like
>>> the 68000 with separate data versus address registers. :-(
>>
>> Yes, or the CDC 6600 A/B and X registers. But I don't expect that
>> 128-bit arithmetic will become popular enough that popular
>> architectures add 128-bit instructions for them. As for 128-bit
>> addresses, given the slowdown in semiconductor advances, we may never
>> get there.
>>
>> - anton
>
>Arithmetic already is in the commercial world: 33-digit decimal requires
>128.

A competent programmer gets 38 digits out of 128 bits. I guess you
waste some bits on the decimal FP nonsense. Please show any evidence
that there is significant usage of that. The fact that Intel's
implementation has not been updated in years (and there is a lot of
potential for improvement) speaks against significant usage.

>Agreed probably not for a while for raw addresses, but caps need at
>least that much.

Which have even less usage than decimal FP.

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

Re: The synergy of type tags on register file registers

<2eIeM.2362599$Tcw8.731334@fx10.iad>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=32597&group=comp.arch#32597

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx10.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: scott@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: The synergy of type tags on register file registers
Newsgroups: comp.arch
References: <08f739ac-2200-408c-a578-79e93f9cb272n@googlegroups.com> <Ds1eM.858712$PXw7.741546@fx45.iad> <c1e79245-bbc8-443c-aacd-0441d49ab84bn@googlegroups.com> <f70924d3-49c8-4e0e-83d8-140a5c7ae4d2n@googlegroups.com> <QrneM.597255$mmyc.279072@fx37.iad> <u5d4fa$37u8l$1@dont-email.me> <9speM.529570$0dpc.321120@fx33.iad> <u5dbvr$38nbs$1@dont-email.me> <08reM.2343550$MVg8.1754411@fx12.iad> <u5e9bl$3f0pv$1@dont-email.me> <2IyeM.438218$jiuc.158540@fx44.iad> <u5ejpq$3g18m$1@dont-email.me>
Lines: 48
Message-ID: <2eIeM.2362599$Tcw8.731334@fx10.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Sat, 03 Jun 2023 14:36:46 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Sat, 03 Jun 2023 14:36:46 GMT
X-Received-Bytes: 2581
 by: Scott Lurndal - Sat, 3 Jun 2023 14:36 UTC

BGB <cr88192@gmail.com> writes:
>On 6/2/2023 10:46 PM, Scott Lurndal wrote:
>> BGB <cr88192@gmail.com> writes:
>>> On 6/2/2023 2:09 PM, Scott Lurndal wrote:
>>>> BGB <cr88192@gmail.com> writes:
>>>>> On 6/2/2023 12:14 PM, Scott Lurndal wrote:
>>>>>> BGB <cr88192@gmail.com> writes:
>>>>>>> On 6/2/2023 9:57 AM, Scott Lurndal wrote:

>
>OK.
>
>
>For Python or JavaScript, they have no reason to care.
>
>One downsize though is that capabilities don't allow bit-twiddling the
>pointers to encode type-tag bits; and presumably, don't allow falling
>back to non-capability pointers (as this would defeat the point).

A downside? How many programmers have "bit-twiddled" pointers to
encode type-tag bits?

And have you read through the CHERI proposal? IIRC, there's a
"default data" capability that regular pointers would implicitly use.

>
>
>>>
>>> Or, one is happy to use a subset of C that doesn't allow "abusing"
>>> pointers and type-casts in various ways, or makes various other "non
>>> portable" assumptions.
>>
>> You mean code for security rather than convenience. I think you
>> overestimate the amount of language abuse that is tolerated in
>> production code.
>>
>
>Possibly, or a lot of the code I had looked at before is not
>particularly portable.

Or representative.

>Well, and had also used some (older) code originally written by Paul
>Edwards (of PDOS fame). But ended up mostly rewriting a lot of it, as
>some of it was a bit lacking.

Speaking of hardly representative :-)

Re: The synergy of type tags on register file registers

<ufIeM.2362600$Tcw8.479430@fx10.iad>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=32598&group=comp.arch#32598

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!panix!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx10.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: scott@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: The synergy of type tags on register file registers
Newsgroups: comp.arch
References: <08f739ac-2200-408c-a578-79e93f9cb272n@googlegroups.com> <Ds1eM.858712$PXw7.741546@fx45.iad> <c1e79245-bbc8-443c-aacd-0441d49ab84bn@googlegroups.com> <f70924d3-49c8-4e0e-83d8-140a5c7ae4d2n@googlegroups.com> <QrneM.597255$mmyc.279072@fx37.iad> <u5d4fa$37u8l$1@dont-email.me> <9speM.529570$0dpc.321120@fx33.iad> <u5dbvr$38nbs$1@dont-email.me> <08reM.2343550$MVg8.1754411@fx12.iad> <u5e9bl$3f0pv$1@dont-email.me> <2IyeM.438218$jiuc.158540@fx44.iad> <2023Jun3.123354@mips.complang.tuwien.ac.at>
Lines: 26
Message-ID: <ufIeM.2362600$Tcw8.479430@fx10.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Sat, 03 Jun 2023 14:38:18 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Sat, 03 Jun 2023 14:38:18 GMT
X-Received-Bytes: 2255
 by: Scott Lurndal - Sat, 3 Jun 2023 14:38 UTC

anton@mips.complang.tuwien.ac.at (Anton Ertl) writes:
>scott@slp53.sl.home (Scott Lurndal) writes:
>>BGB <cr88192@gmail.com> writes:
>>>But, if someone tries to compile code and the compiler is like "error:
>>>that aint gonna fly here", they are liable to blame the architecture
>>>rather than fix the code.
>>
>>Come now, every new warning added to gcc or clang is basically
>>'that ain't gonna fly here' and people aren't blaming anything
>>but the compiler, if they complain at all, which they don't in
>>general.
>
>That's because the compiler *is* to blame. E.g., programmers know
>that the architectures they use support modulo arithmetic; they know
>that the compiler usually performs modulo arithmetic. So when the
>compiler does something else in select situations, why would the
>programmer blame the architecture?
>
>For comparison, when, as on MacOS on Apple Silicon, my mmap() calls
>fail, and these calls work on MacOS on Intel, and on Linux on Apple
>Silicon, I blame MacOS.

Given that mmap() is a defined POSIX interface, and Apple claims
compliance to the single unix specification, were you using the
standard capabilities of mmap, or some apple-private flags?

Re: The synergy of type tags on register file registers

<CgIeM.2362601$Tcw8.1398203@fx10.iad>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=32599&group=comp.arch#32599

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx10.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: scott@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: The synergy of type tags on register file registers
Newsgroups: comp.arch
References: <08f739ac-2200-408c-a578-79e93f9cb272n@googlegroups.com> <u51v6p$1cf9p$2@dont-email.me> <806573a4-0ee6-4bc7-a99b-37957669b868n@googlegroups.com> <d94b9337-52e2-4b05-a26b-ca4b011df7d5n@googlegroups.com> <u53cfh$1mn06$1@dont-email.me> <2023May30.192304@mips.complang.tuwien.ac.at> <u55f2q$22hh1$1@dont-email.me> <2023May31.075457@mips.complang.tuwien.ac.at> <u57ond$2edvp$1@dont-email.me> <2023Jun1.081845@mips.complang.tuwien.ac.at> <u5epbh$3ggrq$1@dont-email.me>
Lines: 22
Message-ID: <CgIeM.2362601$Tcw8.1398203@fx10.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Sat, 03 Jun 2023 14:39:30 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Sat, 03 Jun 2023 14:39:30 GMT
X-Received-Bytes: 1953
 by: Scott Lurndal - Sat, 3 Jun 2023 14:39 UTC

Ivan Godard <ivan@millcomputing.com> writes:
>On 5/31/2023 11:18 PM, Anton Ertl wrote:
>> Stephen Fuld <sfuld@alumni.cmu.edu.invalid> writes:
>>> If 128 bit arithmetic becomes popular, and it is only
>>> implemented in the SIMD registers, you could end up with something like
>>> the 68000 with separate data versus address registers. :-(
>>
>> Yes, or the CDC 6600 A/B and X registers. But I don't expect that
>> 128-bit arithmetic will become popular enough that popular
>> architectures add 128-bit instructions for them. As for 128-bit
>> addresses, given the slowdown in semiconductor advances, we may never
>> get there.
>>
>> - anton
>
>Arithmetic already is in the commercial world: 33-digit decimal requires
>128. Agreed probably not for a while for raw addresses, but caps need at
>least that much.

Burroughs had 100 digit decimal in the 1960s. Real decimal, not binary
masquerading as decimal.

Re: The synergy of type tags on register file registers

<j4pm7i5hefmvsv6mqrg942sa2g9sc4qa56@4ax.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=32600&group=comp.arch#32600

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!news.swapon.de!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: gneuner2@comcast.net (George Neuner)
Newsgroups: comp.arch
Subject: Re: The synergy of type tags on register file registers
Date: Sat, 03 Jun 2023 12:18:57 -0400
Organization: A noiseless patient Spider
Lines: 46
Message-ID: <j4pm7i5hefmvsv6mqrg942sa2g9sc4qa56@4ax.com>
References: <Ds1eM.858712$PXw7.741546@fx45.iad> <c1e79245-bbc8-443c-aacd-0441d49ab84bn@googlegroups.com> <f70924d3-49c8-4e0e-83d8-140a5c7ae4d2n@googlegroups.com> <QrneM.597255$mmyc.279072@fx37.iad> <u5d4fa$37u8l$1@dont-email.me> <9speM.529570$0dpc.321120@fx33.iad> <u5dbvr$38nbs$1@dont-email.me> <08reM.2343550$MVg8.1754411@fx12.iad> <u5e9bl$3f0pv$1@dont-email.me> <2IyeM.438218$jiuc.158540@fx44.iad> <u5ejpq$3g18m$1@dont-email.me> <2eIeM.2362599$Tcw8.731334@fx10.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="ae9de087186742724cb72ca5ee0d9429";
logging-data="3798054"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19FgqDkM3o9yhJWAk+BrGGlRpwxNmhcbOQ="
User-Agent: ForteAgent/8.00.32.1272
Cancel-Lock: sha1:CKblR/TisLQzo5fv017p+kdBCgU=
 by: George Neuner - Sat, 3 Jun 2023 16:18 UTC

On Sat, 03 Jun 2023 14:36:46 GMT, scott@slp53.sl.home (Scott Lurndal)
wrote:

>BGB <cr88192@gmail.com> writes:
>>On 6/2/2023 10:46 PM, Scott Lurndal wrote:
>>> BGB <cr88192@gmail.com> writes:
>>>> On 6/2/2023 2:09 PM, Scott Lurndal wrote:
>>>>> BGB <cr88192@gmail.com> writes:
>>>>>> On 6/2/2023 12:14 PM, Scott Lurndal wrote:
>>>>>>> BGB <cr88192@gmail.com> writes:
>>>>>>>> On 6/2/2023 9:57 AM, Scott Lurndal wrote:
>
>>
>>OK.
>>
>>
>>For Python or JavaScript, they have no reason to care.
>>
>>One downsize though is that capabilities don't allow bit-twiddling the
>>pointers to encode type-tag bits; and presumably, don't allow falling
>>back to non-capability pointers (as this would defeat the point).
>
>A downside? How many programmers have "bit-twiddled" pointers to
>encode type-tag bits?

I have. 8-)

But that is the wrong question ... the right question is "how many
programmers use language implementations that bit-twiddle pointers to
encode type tags".

Of course, the answer still is "relatively few". There are better
ways to handle type information than by embedding tags into the
pointers.

>And have you read through the CHERI proposal? IIRC, there's a
>"default data" capability that regular pointers would implicitly use.

I read about CHERI quite some time ago, and I expect things have
changed since - but I can't recall anything in particular that would
prevent, e.g., a BiBOP implementation in which types were segregated
and identified by (some bits of the) object address.

YMMV,
George

Re: The synergy of type tags on register file registers

<2023Jun3.194009@mips.complang.tuwien.ac.at>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=32602&group=comp.arch#32602

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.arch
Subject: Re: The synergy of type tags on register file registers
Date: Sat, 03 Jun 2023 17:40:09 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 53
Message-ID: <2023Jun3.194009@mips.complang.tuwien.ac.at>
References: <Ds1eM.858712$PXw7.741546@fx45.iad> <f70924d3-49c8-4e0e-83d8-140a5c7ae4d2n@googlegroups.com> <QrneM.597255$mmyc.279072@fx37.iad> <u5d4fa$37u8l$1@dont-email.me> <9speM.529570$0dpc.321120@fx33.iad> <u5dbvr$38nbs$1@dont-email.me> <08reM.2343550$MVg8.1754411@fx12.iad> <u5e9bl$3f0pv$1@dont-email.me> <2IyeM.438218$jiuc.158540@fx44.iad> <u5ejpq$3g18m$1@dont-email.me> <2eIeM.2362599$Tcw8.731334@fx10.iad> <j4pm7i5hefmvsv6mqrg942sa2g9sc4qa56@4ax.com>
Injection-Info: dont-email.me; posting-host="48cceea1648e163db3d5948604c1101d";
logging-data="3818816"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/l9uAGrUWOTe6EIqqOp8Un"
Cancel-Lock: sha1:6V2ZTeN26XDh+xeAoNyXFiWRUGg=
X-newsreader: xrn 10.11
 by: Anton Ertl - Sat, 3 Jun 2023 17:40 UTC

George Neuner <gneuner2@comcast.net> writes:
>On Sat, 03 Jun 2023 14:36:46 GMT, scott@slp53.sl.home (Scott Lurndal)
>wrote:
>
>>BGB <cr88192@gmail.com> writes:
>>>One downsize though is that capabilities don't allow bit-twiddling the
>>>pointers to encode type-tag bits; and presumably, don't allow falling
>>>back to non-capability pointers (as this would defeat the point).
>>
>>A downside? How many programmers have "bit-twiddled" pointers to
>>encode type-tag bits?
>
>I have. 8-)

And here's another one. And a significant number of the students of
my compiler course.

>But that is the wrong question ... the right question is "how many
>programmers use language implementations that bit-twiddle pointers to
>encode type tags".
>
>Of course, the answer still is "relatively few".

Really? How do Python (TIOBE #1), JavaScript (#7), Scratch (#13),
MATLAB (#15), R (#16) and Ruby (#18) implement their dynamic type
informations?

Also, the real issue is: How many users never use programs written in
a language that encodes type information in pointers?

>There are better
>ways to handle type information than by embedding tags into the
>pointers.

I don't think there are better ways for Prolog, and probably a number
of other dynamically-typed programming languages. There is a reason
why this technique is used. And ARM, AMD, and Intel have added
architectural features to better support this usage
<https://lwn.net/Articles/888914/>. I think there are many more CPUs
from ARM, AMD, and Intel around than CHERI CPUs.

>I read about CHERI quite some time ago, and I expect things have
>changed since - but I can't recall anything in particular that would
>prevent, e.g., a BiBOP implementation in which types were segregated
>and identified by (some bits of the) object address.

I don't think BiBOP would work with the way we implemented
backtracking in our Prolog implementation.

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

Re: The synergy of type tags on register file registers

<u5fv1k$2ftv8$1@newsreader4.netcologne.de>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=32603&group=comp.arch#32603

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2001-4dd4-fddc-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoenig@netcologne.de (Thomas Koenig)
Newsgroups: comp.arch
Subject: Re: The synergy of type tags on register file registers
Date: Sat, 3 Jun 2023 17:59:16 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <u5fv1k$2ftv8$1@newsreader4.netcologne.de>
References: <08f739ac-2200-408c-a578-79e93f9cb272n@googlegroups.com>
<05c50c9e-122a-4e12-b762-abf56ecaf5ben@googlegroups.com>
<b26dc80b-afbf-426e-ad34-ea82f8600d18n@googlegroups.com>
<u4vonr$25ppt$1@newsreader4.netcologne.de> <u50c3t$10g9m$1@dont-email.me>
<u51j2o$270ah$1@newsreader4.netcologne.de> <u51v6p$1cf9p$2@dont-email.me>
<806573a4-0ee6-4bc7-a99b-37957669b868n@googlegroups.com>
<d94b9337-52e2-4b05-a26b-ca4b011df7d5n@googlegroups.com>
<u53cfh$1mn06$1@dont-email.me>
<2023May30.192304@mips.complang.tuwien.ac.at>
<u55f2q$22hh1$1@dont-email.me>
<ee431e57-2644-46aa-9c34-3758237158fan@googlegroups.com>
<u56frb$29tvu$1@dont-email.me>
Injection-Date: Sat, 3 Jun 2023 17:59:16 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd4-fddc-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2001:4dd4:fddc:0:7285:c2ff:fe6c:992d";
logging-data="2619368"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Sat, 3 Jun 2023 17:59 UTC

Stephen Fuld <sfuld@alumni.cmu.edu.invalid> schrieb:
> On 5/30/2023 12:31 PM, MitchAlsup wrote:
>> It really depends on what your target(s) is(are).
>> a) do you want to perform 128-bits occasionally,
>> b) do you want to perform 128-bits rather often,
>> c) do you want to perform 128-bits all the time.
>
> I think that is true, but with some caveats.
>
> 1. I don't know what the market today wants. Perhaps John Dallman or
> Thomas Koenig, with their perspective can chime in.

I don't have any special insight. One of the disadvantages of
free software is that you don't get feedback from a fraction of
1-10**(-n) of your users, with n unknown, but presumed to be
six or larger.

I know that IBM cares enough to go through a lot of pain changing
the default ABI from IBM paired double to IEEE 128-bit (with
-mabi=ieeelongdouble).

It was a fine example of software being harder than hardware,
(more difficult to change, presumably).

And their old long double format really wasn't great.

> 2. Whatever the market is today, it will be different some years from
> now. I don't have a prediction as to the speed of adoption, however,

As long as it is not supported in hardware, the performance cost
will mean that people will not use it. There is also the mess
with C's long double and 80-bit floats on x86.

(Fortran has the much better type system).

Re: The synergy of type tags on register file registers

<2023Jun3.195912@mips.complang.tuwien.ac.at>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=32604&group=comp.arch#32604

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.arch
Subject: Re: The synergy of type tags on register file registers
Date: Sat, 03 Jun 2023 17:59:12 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 41
Message-ID: <2023Jun3.195912@mips.complang.tuwien.ac.at>
References: <08f739ac-2200-408c-a578-79e93f9cb272n@googlegroups.com> <c1e79245-bbc8-443c-aacd-0441d49ab84bn@googlegroups.com> <f70924d3-49c8-4e0e-83d8-140a5c7ae4d2n@googlegroups.com> <QrneM.597255$mmyc.279072@fx37.iad> <u5d4fa$37u8l$1@dont-email.me> <9speM.529570$0dpc.321120@fx33.iad> <u5dbvr$38nbs$1@dont-email.me> <08reM.2343550$MVg8.1754411@fx12.iad> <u5e9bl$3f0pv$1@dont-email.me> <2IyeM.438218$jiuc.158540@fx44.iad> <2023Jun3.123354@mips.complang.tuwien.ac.at> <ufIeM.2362600$Tcw8.479430@fx10.iad>
Injection-Info: dont-email.me; posting-host="48cceea1648e163db3d5948604c1101d";
logging-data="3818816"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19USoa7St01zt03ls4mxjG9"
Cancel-Lock: sha1:0jzdQqj4P5inxVldoYdL6P5yLLg=
X-newsreader: xrn 10.11
 by: Anton Ertl - Sat, 3 Jun 2023 17:59 UTC

scott@slp53.sl.home (Scott Lurndal) writes:
>anton@mips.complang.tuwien.ac.at (Anton Ertl) writes:
>>scott@slp53.sl.home (Scott Lurndal) writes:
>>>BGB <cr88192@gmail.com> writes:
>>>>But, if someone tries to compile code and the compiler is like "error:
>>>>that aint gonna fly here", they are liable to blame the architecture
>>>>rather than fix the code.
>>>
>>>Come now, every new warning added to gcc or clang is basically
>>>'that ain't gonna fly here' and people aren't blaming anything
>>>but the compiler, if they complain at all, which they don't in
>>>general.
>>
>>That's because the compiler *is* to blame. E.g., programmers know
>>that the architectures they use support modulo arithmetic; they know
>>that the compiler usually performs modulo arithmetic. So when the
>>compiler does something else in select situations, why would the
>>programmer blame the architecture?
>>
>>For comparison, when, as on MacOS on Apple Silicon, my mmap() calls
>>fail, and these calls work on MacOS on Intel, and on Linux on Apple
>>Silicon, I blame MacOS.
>
>Given that mmap() is a defined POSIX interface, and Apple claims
>compliance to the single unix specification, were you using the
>standard capabilities of mmap, or some apple-private flags?

They were certainly not Apple-private. They work on Linux and lots of
other Unix systems. Lowest-common denominator standards like POSIX (I
think SUS has been superseded by the newest POSIXes) or ANSI C are not
an acceptable excuse for breaking programs. Currently the development
version of Gforth does not work on MacOS on Apple Silicon, and working
around Apple's intentional breakage is not high on my agenda, so the
next release will probably not work on MacOS on Apple Silicon. And
the workaround I have in mind will make it significantly slower on
MacOS than on Linux.

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

Re: The synergy of type tags on register file registers

<u5fvir$2ftv8$2@newsreader4.netcologne.de>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=32605&group=comp.arch#32605

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2001-4dd4-fddc-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoenig@netcologne.de (Thomas Koenig)
Newsgroups: comp.arch
Subject: Re: The synergy of type tags on register file registers
Date: Sat, 3 Jun 2023 18:08:27 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <u5fvir$2ftv8$2@newsreader4.netcologne.de>
References: <08f739ac-2200-408c-a578-79e93f9cb272n@googlegroups.com>
<Ds1eM.858712$PXw7.741546@fx45.iad>
<c1e79245-bbc8-443c-aacd-0441d49ab84bn@googlegroups.com>
<f70924d3-49c8-4e0e-83d8-140a5c7ae4d2n@googlegroups.com>
<QrneM.597255$mmyc.279072@fx37.iad> <u5d4fa$37u8l$1@dont-email.me>
<9speM.529570$0dpc.321120@fx33.iad> <u5dbvr$38nbs$1@dont-email.me>
<08reM.2343550$MVg8.1754411@fx12.iad> <u5e9bl$3f0pv$1@dont-email.me>
<2IyeM.438218$jiuc.158540@fx44.iad>
<2023Jun3.123354@mips.complang.tuwien.ac.at>
<ufIeM.2362600$Tcw8.479430@fx10.iad>
Injection-Date: Sat, 3 Jun 2023 18:08:27 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd4-fddc-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2001:4dd4:fddc:0:7285:c2ff:fe6c:992d";
logging-data="2619368"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Sat, 3 Jun 2023 18:08 UTC

Scott Lurndal <scott@slp53.sl.home> schrieb:
> anton@mips.complang.tuwien.ac.at (Anton Ertl) writes:

>>For comparison, when, as on MacOS on Apple Silicon, my mmap() calls
>>fail, and these calls work on MacOS on Intel, and on Linux on Apple
>>Silicon, I blame MacOS.
>
> Given that mmap() is a defined POSIX interface, and Apple claims
> compliance to the single unix specification, were you using the
> standard capabilities of mmap, or some apple-private flags?

One of the things I don't like about MacOS is that you cannot
extend a shared memory region obtained via mmap() with ftruncate().

This works on Linux, but MacOS does not permit it. That can be a
hassle if you don't know the size of your memory region on startup,
so you have to allocate a huge chunk, hope it's enough and fail
otherwise (which is unfriendly).

I think Windows has the same problem (as far as I remember).

Re: The synergy of type tags on register file registers

<35da65ae-05d9-4677-8d66-70f64909e6f5n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=32606&group=comp.arch#32606

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:622a:1aa6:b0:3f8:48fc:290d with SMTP id s38-20020a05622a1aa600b003f848fc290dmr621340qtc.3.1685817974053;
Sat, 03 Jun 2023 11:46:14 -0700 (PDT)
X-Received: by 2002:a05:6870:7731:b0:19f:8ef6:ec7c with SMTP id
dw49-20020a056870773100b0019f8ef6ec7cmr1837566oab.5.1685817973666; Sat, 03
Jun 2023 11:46:13 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Sat, 3 Jun 2023 11:46:13 -0700 (PDT)
In-Reply-To: <8f4715b7-35f3-4607-870d-b1f6fd50587fn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2a0d:6fc2:55b0:ca00:39bd:cff6:8e24:fa66;
posting-account=ow8VOgoAAAAfiGNvoH__Y4ADRwQF1hZW
NNTP-Posting-Host: 2a0d:6fc2:55b0:ca00:39bd:cff6:8e24:fa66
References: <08f739ac-2200-408c-a578-79e93f9cb272n@googlegroups.com>
<b26dc80b-afbf-426e-ad34-ea82f8600d18n@googlegroups.com> <u4vonr$25ppt$1@newsreader4.netcologne.de>
<u50c3t$10g9m$1@dont-email.me> <u51j2o$270ah$1@newsreader4.netcologne.de>
<u51v6p$1cf9p$2@dont-email.me> <806573a4-0ee6-4bc7-a99b-37957669b868n@googlegroups.com>
<d94b9337-52e2-4b05-a26b-ca4b011df7d5n@googlegroups.com> <u53cfh$1mn06$1@dont-email.me>
<2023May30.192304@mips.complang.tuwien.ac.at> <u55f2q$22hh1$1@dont-email.me>
<2023May31.075457@mips.complang.tuwien.ac.at> <u57ond$2edvp$1@dont-email.me>
<u57v63$2f5km$1@dont-email.me> <4168d555-a14c-4ed8-b2dc-7ae34588544fn@googlegroups.com>
<b510bc37-bbd4-474b-8023-5bc607012f4dn@googlegroups.com> <b5dd4107-57f4-4e76-9231-8f8a18d61568n@googlegroups.com>
<8f4715b7-35f3-4607-870d-b1f6fd50587fn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <35da65ae-05d9-4677-8d66-70f64909e6f5n@googlegroups.com>
Subject: Re: The synergy of type tags on register file registers
From: already5chosen@yahoo.com (Michael S)
Injection-Date: Sat, 03 Jun 2023 18:46:14 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 9566
 by: Michael S - Sat, 3 Jun 2023 18:46 UTC

On Friday, June 2, 2023 at 8:16:27 PM UTC+3, MitchAlsup wrote:
> On Friday, June 2, 2023 at 5:03:06 AM UTC-5, Michael S wrote:
> > On Thursday, June 1, 2023 at 4:50:26 AM UTC+3, MitchAlsup wrote:
> > > On Wednesday, May 31, 2023 at 8:04:47 PM UTC-5, robf...@gmail..com wrote:
> > > > On Wednesday, May 31, 2023 at 1:12:39 PM UTC-4, BGB wrote:
> > > > > On 5/31/2023 10:22 AM, Stephen Fuld wrote:
> > > > > > On 5/30/2023 10:54 PM, Anton Ertl wrote:
> > > > > >> Stephen Fuld <sf...@alumni.cmu.edu.invalid> writes:
> > > > > >>> But then how do you propose
> > > > > >>> handling 128 bit arithmetic (both integer and floating), assuming these
> > > > > >>> are requirements? ISTM that if you don't use paired registers, then you
> > > > > >>> have to double the number of register specifiers in each ALU
> > > > > >>> instruction or do something like Mitch's instruction modifier mechanism
> > > > > >>> or go to 128 bit registers.
> > > > > >>
> > > > > >> 128-bit registers look fine to me. AMD64 has them already (the xmm
> > > > > >> registers), ARMv8-A has them already (and I think ARMv7-A, too;
> > > > > >> ARMv9-A is an extension of ARMv8.5-A, and so also supports these
> > > > > >> registers). So you just need to add the instructions that use them
> > > > > >> for computing with 128-bit values.
> > > > > >
> > > > > > Fair enough. I agree with Mitch in that I don't like the separate SIMD
> > > > > > register approach, preferring VVM, but that would mean 128 bit GPRs,
> > > > > > which we are not ready for yet. (The key word here is yet. I expect
> > > > > > they will come.) If 128 bit arithmetic becomes popular, and it is only
> > > > > > implemented in the SIMD registers, you could end up with something like
> > > > > > the 68000 with separate data versus address registers. :-(
> > > > > >
> > > > > I would personally much rather see a single unified register file, in
> > > > > any case.
> > > > >
> > > > >
> > > > > An ISA with 128-bit GPRs would be the more preferable option, and one
> > > > > could likely use the large registers either for a large address space,
> > > > > or maybe bounds-checked access or capabilities.
> > > > >
> > > > >
> > > > > Say, Array Pointer:
> > > > > ( 63: 0): Address Field
> > > > > ( 83: 64): Array Size (Scaled)
> > > > > (103: 84): Array Lower Bias
> > > > > (108:104): Array Scale / Exponent
> > > > > (111:109): Array RWX Mode
> > > > > (123:112): Array Element Tag
> > > > > (127:124): Top-Level Tag (Say, 0011 for Array)
> > > > >
> > > > > Could still need fine adjustment, potentially 20 bits is overkill for
> > > > > the size field when combined with an exponent.
> > > > > Say, if we allow an 8B alignment, this allows an array that is 8MB which
> > > > > is, most likely, going to be page-aligned.
> > > > >
> > > > > If we assume a 4K alignment, this allows up to 4GB. OTOH, if the field
> > > > > were smaller, this would mean more likely needing to pad arrays in many
> > > > > cases.
> > > > >
> > > > >
> > > > > Main drawback being that, if the program is primarily working with
> > > > > 32-bit 'int' values, then 128-bit registers would be kind of a waste.
> > > > >
> > > > >
> > > > > It is usually only in edge cases that 128-bit integers really "make
> > > > > sense", and even then, existing C compilers tend to not support them.
> > > > >
> > > > > Like, if on many targets, if one does "__int128", the compiler is like
> > > > > "Not supported on this target", this is a disincentive to use them, and
> > > > > means that typically the program will (at most) end up only using half
> > > > > the register.
> > > > >
> > > > >
> > > > > Though, could have the amusing property if, say, one supports fixnum's,
> > > > > and the fixnum ends up having a larger value range than C's 'long' and
> > > > > 'long long' types...
> > > > >
> > > > >
> > > > > Other concerns:
> > > > > Resource cost would likely be higher, as now supporting superscalar is a
> > > > > bit more of an ask;
> > > > > Maximum clock speed would likely be lower;
> > > > > ...
> > > > >
> > > > > Could be OK for a 1-wide scalar machine though (or maybe a future 2-wide
> > > > > superscalar).
> > > > >
> > > > >
> > > > > But, yeah, could work...
> > > > >
> > > > >
> > > > > >
> > > > > >
> > > > I think 64-bits for the address field may not be enough for a virtual address. I
> > > > seem to recall a demand for 100-bit addressing in an alternate reality, but that
> > > > is probably quite a few years away. I also think it is better to have registers
> > > > just as a plain bucket. As soon as structure is added the design is stuck with
> > > > it. A separate tags file associated with registers might be easier to manage.
> > > >
> > > > I am not so sure about the slowness of a superscalar. I think it may have more
> > > > to do with how full the FPGA is, the size and style of the design. I have been
> > > > able to hit close to 50 MHz timing according to the tools. I think 50 MHz is on
> > > > par with many other FPGA designs. Even if it is a few MHz slower the ability of
> > > > OoO to hide latency may make it worth it.
> > > >
> > > > *****
> > > > I cannot believe I ignored Cordic for so long, having discovered its beauty.
> > > <
> > > Beautiful and slow as crap.
> > > <
> > > > Answering my own engineering question, 10-bits max micro-code it is; that
> > > > should be overkill. It should not take very many, if any micro-code words for
> > > > basic trig. Previously seven bits were used for Thor2021, but only about a half
> > > > dozen non-math instructions were micro-coded.
> > > >
> > > > Having done some head scratching over cordic and how to calculate the tan,
> > > > I am thinking of just providing a cordic instruction that takes all three
> > > > arguments and calculates away, and then leave it up to the programmer to
> > > > decide on operands and what is being calculated. I get how to calculate sin
> > > > and cosine via cordic and I think tan finally. Specifying that x, y must be
> > > > fractions between 0 and 1, and that the angle must be radians between 0
> > > > and 2 pi.
> > > >
> > > > I gather that modern processor do not use Cordic, and use polynomial
> > > > expansions instead.
> > > <
> > > Typical SW can perform tan() in 150± cycles.
> > How do you know?
> > From past experience I would guess that you didn't actually measure it, do you?
> <
> https://hal.inria.fr/inria-00070636/document
> and
> http://www.cl.cam.ac.uk/~jrh13/slides/gelato-25may05/slides.pdf
> <
> the later using 2 FMACs simultaneously.
> But there is scant little data on it.

The 1st does not contain results for tan() at all and the second is much faster
than your claim. And both 20 years old. Do you really believe that today's CPUs
are not faster than those of 20 years ago? Especially in throughput?

Re: The synergy of type tags on register file registers

<u5g1tv$3kr3b$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=32607&group=comp.arch#32607

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: cr88192@gmail.com (BGB)
Newsgroups: comp.arch
Subject: Re: The synergy of type tags on register file registers
Date: Sat, 3 Jun 2023 13:48:31 -0500
Organization: A noiseless patient Spider
Lines: 234
Message-ID: <u5g1tv$3kr3b$1@dont-email.me>
References: <08f739ac-2200-408c-a578-79e93f9cb272n@googlegroups.com>
<Ds1eM.858712$PXw7.741546@fx45.iad>
<c1e79245-bbc8-443c-aacd-0441d49ab84bn@googlegroups.com>
<f70924d3-49c8-4e0e-83d8-140a5c7ae4d2n@googlegroups.com>
<QrneM.597255$mmyc.279072@fx37.iad> <u5d4fa$37u8l$1@dont-email.me>
<9speM.529570$0dpc.321120@fx33.iad> <u5dbvr$38nbs$1@dont-email.me>
<08reM.2343550$MVg8.1754411@fx12.iad> <u5e9bl$3f0pv$1@dont-email.me>
<2IyeM.438218$jiuc.158540@fx44.iad> <u5ejpq$3g18m$1@dont-email.me>
<2eIeM.2362599$Tcw8.731334@fx10.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 3 Jun 2023 18:48:31 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="ec2bbef6d9205169dcd520037c2a05a3";
logging-data="3828843"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19wpKksIrBayxZnmXoaHej+"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.11.2
Cancel-Lock: sha1:Fh0E/ZHzbh8RIaEBwiS230q+18Y=
In-Reply-To: <2eIeM.2362599$Tcw8.731334@fx10.iad>
Content-Language: en-US
 by: BGB - Sat, 3 Jun 2023 18:48 UTC

On 6/3/2023 9:36 AM, Scott Lurndal wrote:
> BGB <cr88192@gmail.com> writes:
>> On 6/2/2023 10:46 PM, Scott Lurndal wrote:
>>> BGB <cr88192@gmail.com> writes:
>>>> On 6/2/2023 2:09 PM, Scott Lurndal wrote:
>>>>> BGB <cr88192@gmail.com> writes:
>>>>>> On 6/2/2023 12:14 PM, Scott Lurndal wrote:
>>>>>>> BGB <cr88192@gmail.com> writes:
>>>>>>>> On 6/2/2023 9:57 AM, Scott Lurndal wrote:
>
>>
>> OK.
>>
>>
>> For Python or JavaScript, they have no reason to care.
>>
>> One downsize though is that capabilities don't allow bit-twiddling the
>> pointers to encode type-tag bits; and presumably, don't allow falling
>> back to non-capability pointers (as this would defeat the point).
>
> A downside? How many programmers have "bit-twiddled" pointers to
> encode type-tag bits?
>

Not sure how many, but it is (AFAIK) a pretty common way to implement
languages like Scheme and similar. IIRC, some of the Ruby
implementations also use this strategy, ...

Whereas, instead, some of the JavaScript implementations went with NaN
boxing (may also be encoded in my case).

Ironically CPython is an exception here as, IIRC, its values are
struct-based rather than using bit-twiddled pointers or similar.

> And have you read through the CHERI proposal? IIRC, there's a
> "default data" capability that regular pointers would implicitly use.
>

I have skimmed through a lot of it, and get the general idea.

May have missed stuff though.

>>
>>
>>>>
>>>> Or, one is happy to use a subset of C that doesn't allow "abusing"
>>>> pointers and type-casts in various ways, or makes various other "non
>>>> portable" assumptions.
>>>
>>> You mean code for security rather than convenience. I think you
>>> overestimate the amount of language abuse that is tolerated in
>>> production code.
>>>
>>
>> Possibly, or a lot of the code I had looked at before is not
>> particularly portable.
>
> Or representative.
>

I have looked at a lot of code in my life besides just old game code.
It seems pretty variable.

>
>> Well, and had also used some (older) code originally written by Paul
>> Edwards (of PDOS fame). But ended up mostly rewriting a lot of it, as
>> some of it was a bit lacking.
>
> Speaking of hardly representative :-)

Yeah.

Stuff replaced:
Most of the math functions:
Originals were prone to:
get stuck in infinite loops;
or give incorrect values;
...
And were horridly slow.
Unrolled Taylor expansion being orders of magnitude faster;
Lots of very naive loops, recursive logic, etc.
...
Removed most of the 'MVS' stuff, ..., All N/A to me;
Rewrote most of the 'string.h' stuff and similar as well:
Looping on bytes for "memcpy()"/etc being painfully slow.
...

Also I am mostly using the MIT license (rather than 'public domain' or CC0).

Doom and similar are GPL, so can't use any code from them in TestKern
(would effectively pollute the whole project with GPL in this case).
But, using them as test programs is OK (however, people will need to
supply their own WADs and similar).

I had almost considered doing a full rewrite of the C library, but
haven't done so mostly due to inertia.

My partial rewrite attempts would have used a different structure:
C library is split into "frontend" and "backend" parts;
Frontend parts are always statically linked with the binary;
Backend is accessed from the front-end via COM-style interface.
The backend would typically be linked with the main executable;
DLLs only get the frontend.
The backend is mostly responsible for file IO and memory management.

This is partly to avoid an annoyance (also happens with MSVCRT), where
each effectively gets its own set of incompatible 'FILE' objects, and
trying to "malloc()" memory in one library and "free()" in another
causes the C library to explode, ...

Better, IMO, if one can "fopen()" in one place and "fread/fclose/..." it
from anywhere, and "malloc()" and "free()" from anywhere in the program.

On many targets, for example, GLIBC is dynamically linked, which has a
similar property.

However, for more subtle reasons, this approach does not map over
perfectly to PE/COFF and DLLs (also a DLL based C library would be
incompatible with "bare metal" booting, since the boot-loader does not
support DLL loading). Whereas, a COM-Interface approach is compatible
with loading DLLs as extension libraries (say, could be later extended
to things like loadable kernel modules and drivers).

In the current implementation, the DLL versions of the C library still
use a COM object for stdio and malloc and similar, but there is no clean
"frontend/backend" split.

Sadly, nor is there a clean divide (in TestKern) between userland
functionality and kernel functionality (and most of the binaries have
the kernel linked in, even if intended to be used in userland). I intend
to fix this eventually (but, for now, it does allow "bare metal" booting
most binaries in the emulator).

Note that my use of the term "COM objects" is a bit more general:
Does not assume use of the relevant parts of the Win32 API
(for probably obvious reasons);
Does not assume MIDL (likewise).
So, it is instead mostly:
VTable objects following a similar structure:
First 4 entries are special/reserved;
First argument of any method is a pointer to the object.
The object begins with a pointer to the VTable;
Anything beyond this first pointer depends on the object instance.

so, for example:
typedef struct FooSomeObject_s FooSomeObject;
typedef struct FooSomeObjectVTable_s FooSomeObjectVTable;

struct FooSomeObjectVTable_s {
void *resv0;
void *resv1;
void *resv2;
void *resv3;
void (*FirstMethod)(FooSomeObject *self);
...
};
struct FooSomeObject_s {
FooSomeObjectVTable *vt;
//... undefined for client code.
};

For imported objects, typically only the vtable pointer is valid, and
the vtable is instead a collection of "generic" methods whos sole
purpose is to capture the argument list and perform the relevant system
call (with the object used to figure out where the call should be directed).

Though, for normal "Load DLL into an application" cases, the object is
"merely" a local interface exported by the main binary.

There are typically C API wrappers, which may also manage things like
wrangling arguments into shared memory areas (say, if a call passes a
BITMAPINFOHEADER pointer, it needs to be in an area where the called API
can access it, well along with any bitmap data and other things).

Internally, there is a "malloc_cat()" function which supplies a
"category" which can be used as a stand-in for calls like
"GlobalAlloc()" in the Win32 API and similar.

Though, I guess I could probably add:
void *tkgGlobalAlloc(size_t size);
Or similar, as an explicit "allocate memory somewhere where TKGDI can
access it" call (and remove the implicit assumption that TKGDI has
access to the caller's heap).

Could in theory use tagged dynamic types, but most of the existing APIs
thus far are passing structs and bulk data, which doesn't map over well.

Likewise, "small object sharing" has considerably higher overhead than
"have a region of memory that is implicitly shared by the parties involved".

Say, for small object sharing:
Effectively, object gets copied from local memory to shared memory, then
copied again into the callee's local memory, then copied back to shared
memory on return, and then back into the original object (can sort of
work for BITMAPINFOHEADER and similar due to biSize, or in contexts
where one can figure out the size of the data in question).

Side Note:

TKGDI partly serves a vaguely similar purpose to GDI, VFW, and MMSYSTEM
(all glued together), but omits most USER32 functionality (as-is, the
idea is that the application would be itself responsible for drawing its
UI).

If I get to it, there may be eventually be a widget toolkit, but it
would likely be based on drawing small DIB BITMAP objects into the
window or similar (well, and/or add a small command-language for things
like drawing lines, text, and performing flood-fill). Note that using
TKRA-GL for widget drawing would be overkill and inefficient (and
creating and filling in bitmap objects to draw a buttons and similar
seems "kinda weak").

I have yet to decide whether things like title bar and similar should be
handled by TKGDI (like in Win32 GDI), or offloaded to the client or
window manager (like in X11). Right at the moment, leaning is that
window decorations will also be client-side (similar to other GUI elements).


Click here to read the complete article
Re: The synergy of type tags on register file registers

<eed0548a-1a77-48b9-96d0-6ee7c2ef6891n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=32608&group=comp.arch#32608

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:620a:25ca:b0:75c:b18b:713c with SMTP id y10-20020a05620a25ca00b0075cb18b713cmr4901194qko.14.1685819594268;
Sat, 03 Jun 2023 12:13:14 -0700 (PDT)
X-Received: by 2002:a4a:4f4f:0:b0:54c:c8f5:49d9 with SMTP id
c76-20020a4a4f4f000000b0054cc8f549d9mr4538567oob.0.1685819593922; Sat, 03 Jun
2023 12:13:13 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Sat, 3 Jun 2023 12:13:13 -0700 (PDT)
In-Reply-To: <35da65ae-05d9-4677-8d66-70f64909e6f5n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:2103:71:3a42:aff5;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:2103:71:3a42:aff5
References: <08f739ac-2200-408c-a578-79e93f9cb272n@googlegroups.com>
<b26dc80b-afbf-426e-ad34-ea82f8600d18n@googlegroups.com> <u4vonr$25ppt$1@newsreader4.netcologne.de>
<u50c3t$10g9m$1@dont-email.me> <u51j2o$270ah$1@newsreader4.netcologne.de>
<u51v6p$1cf9p$2@dont-email.me> <806573a4-0ee6-4bc7-a99b-37957669b868n@googlegroups.com>
<d94b9337-52e2-4b05-a26b-ca4b011df7d5n@googlegroups.com> <u53cfh$1mn06$1@dont-email.me>
<2023May30.192304@mips.complang.tuwien.ac.at> <u55f2q$22hh1$1@dont-email.me>
<2023May31.075457@mips.complang.tuwien.ac.at> <u57ond$2edvp$1@dont-email.me>
<u57v63$2f5km$1@dont-email.me> <4168d555-a14c-4ed8-b2dc-7ae34588544fn@googlegroups.com>
<b510bc37-bbd4-474b-8023-5bc607012f4dn@googlegroups.com> <b5dd4107-57f4-4e76-9231-8f8a18d61568n@googlegroups.com>
<8f4715b7-35f3-4607-870d-b1f6fd50587fn@googlegroups.com> <35da65ae-05d9-4677-8d66-70f64909e6f5n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <eed0548a-1a77-48b9-96d0-6ee7c2ef6891n@googlegroups.com>
Subject: Re: The synergy of type tags on register file registers
From: MitchAlsup@aol.com (MitchAlsup)
Injection-Date: Sat, 03 Jun 2023 19:13:14 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3606
 by: MitchAlsup - Sat, 3 Jun 2023 19:13 UTC

On Saturday, June 3, 2023 at 1:46:15 PM UTC-5, Michael S wrote:
> On Friday, June 2, 2023 at 8:16:27 PM UTC+3, MitchAlsup wrote:

> > > > Typical SW can perform tan() in 150± cycles.
> > > How do you know?
> > > From past experience I would guess that you didn't actually measure it, do you?
> > <
> > https://hal.inria.fr/inria-00070636/document
> > and
> > http://www.cl.cam.ac.uk/~jrh13/slides/gelato-25may05/slides.pdf
> > <
> > the later using 2 FMACs simultaneously.
> > But there is scant little data on it.
>
> The 1st does not contain results for tan() at all and the second is much faster
> than your claim. And both 20 years old. Do you really believe that today's CPUs
> are not faster than those of 20 years ago? Especially in throughput?
<
When your question is latency {How many cycles do doing 1 unit of X take)
a throughput answer is avoiding answering the question.
<
The problem is finding scalar version of that kind of data (no SIMD instructions)
to make an apples to apples comparison to what I have to look at.
<
As to whether modern CPUs are faster, the latency of FMAC is now 5 and 6
rather than 4 and 5, and most polynomial evaluations are Horner style with
a dependence from iteration to iteration.
<
That is: if I want to compare 1 evaluation {sin(), cos(), tan(), ...}; I do not want
data saying that one can perform 8 calculations of {...} in 160 cycles and give
20 cycles as representative.

Re: The synergy of type tags on register file registers

<7e9d9ba5-2679-474d-b2b4-90f418fa7c6fn@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=32609&group=comp.arch#32609

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:620a:400a:b0:74e:324:d6f0 with SMTP id h10-20020a05620a400a00b0074e0324d6f0mr3579061qko.7.1685819734799;
Sat, 03 Jun 2023 12:15:34 -0700 (PDT)
X-Received: by 2002:a05:6870:7714:b0:1a2:c17e:a05e with SMTP id
dw20-20020a056870771400b001a2c17ea05emr733120oab.2.1685819734543; Sat, 03 Jun
2023 12:15:34 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Sat, 3 Jun 2023 12:15:34 -0700 (PDT)
In-Reply-To: <u5g1tv$3kr3b$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:2103:71:3a42:aff5;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:2103:71:3a42:aff5
References: <08f739ac-2200-408c-a578-79e93f9cb272n@googlegroups.com>
<Ds1eM.858712$PXw7.741546@fx45.iad> <c1e79245-bbc8-443c-aacd-0441d49ab84bn@googlegroups.com>
<f70924d3-49c8-4e0e-83d8-140a5c7ae4d2n@googlegroups.com> <QrneM.597255$mmyc.279072@fx37.iad>
<u5d4fa$37u8l$1@dont-email.me> <9speM.529570$0dpc.321120@fx33.iad>
<u5dbvr$38nbs$1@dont-email.me> <08reM.2343550$MVg8.1754411@fx12.iad>
<u5e9bl$3f0pv$1@dont-email.me> <2IyeM.438218$jiuc.158540@fx44.iad>
<u5ejpq$3g18m$1@dont-email.me> <2eIeM.2362599$Tcw8.731334@fx10.iad> <u5g1tv$3kr3b$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <7e9d9ba5-2679-474d-b2b4-90f418fa7c6fn@googlegroups.com>
Subject: Re: The synergy of type tags on register file registers
From: MitchAlsup@aol.com (MitchAlsup)
Injection-Date: Sat, 03 Jun 2023 19:15:34 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2311
 by: MitchAlsup - Sat, 3 Jun 2023 19:15 UTC

On Saturday, June 3, 2023 at 1:48:34 PM UTC-5, BGB wrote:
> On 6/3/2023 9:36 AM, Scott Lurndal wrote:
> > BGB <cr8...@gmail.com> writes:

> > A downside? How many programmers have "bit-twiddled" pointers to
> > encode type-tag bits?
> >
> Not sure how many, but it is (AFAIK) a pretty common way to implement
> languages like Scheme and similar. IIRC, some of the Ruby
> implementations also use this strategy, ...
<
I used the infamous XOR trick to keep doubly linked list in 1 container....
On a PDP-11 to fit an application into memory (64Kb PDP-11/20).
>

Re: The synergy of type tags on register file registers

<u5g590$3l54p$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=32610&group=comp.arch#32610

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: cr88192@gmail.com (BGB)
Newsgroups: comp.arch
Subject: Re: The synergy of type tags on register file registers
Date: Sat, 3 Jun 2023 14:45:36 -0500
Organization: A noiseless patient Spider
Lines: 170
Message-ID: <u5g590$3l54p$1@dont-email.me>
References: <Ds1eM.858712$PXw7.741546@fx45.iad>
<f70924d3-49c8-4e0e-83d8-140a5c7ae4d2n@googlegroups.com>
<QrneM.597255$mmyc.279072@fx37.iad> <u5d4fa$37u8l$1@dont-email.me>
<9speM.529570$0dpc.321120@fx33.iad> <u5dbvr$38nbs$1@dont-email.me>
<08reM.2343550$MVg8.1754411@fx12.iad> <u5e9bl$3f0pv$1@dont-email.me>
<2IyeM.438218$jiuc.158540@fx44.iad> <u5ejpq$3g18m$1@dont-email.me>
<2eIeM.2362599$Tcw8.731334@fx10.iad>
<j4pm7i5hefmvsv6mqrg942sa2g9sc4qa56@4ax.com>
<2023Jun3.194009@mips.complang.tuwien.ac.at>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 3 Jun 2023 19:45:36 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="ec2bbef6d9205169dcd520037c2a05a3";
logging-data="3839129"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/K/L4vHn6rJ5XQVox2kAeX"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.11.2
Cancel-Lock: sha1:vqROy3h++rnj1+4/T3pCdcJKFVM=
In-Reply-To: <2023Jun3.194009@mips.complang.tuwien.ac.at>
Content-Language: en-US
 by: BGB - Sat, 3 Jun 2023 19:45 UTC

On 6/3/2023 12:40 PM, Anton Ertl wrote:
> George Neuner <gneuner2@comcast.net> writes:
>> On Sat, 03 Jun 2023 14:36:46 GMT, scott@slp53.sl.home (Scott Lurndal)
>> wrote:
>>
>>> BGB <cr88192@gmail.com> writes:
>>>> One downsize though is that capabilities don't allow bit-twiddling the
>>>> pointers to encode type-tag bits; and presumably, don't allow falling
>>>> back to non-capability pointers (as this would defeat the point).
>>>
>>> A downside? How many programmers have "bit-twiddled" pointers to
>>> encode type-tag bits?
>>
>> I have. 8-)
>
> And here's another one. And a significant number of the students of
> my compiler course.
>

Yeah.

Also my case:
Parts of TestKern;
My prior "BGBScript VM" projects;
Basically a very similar layout in both cases.

It ends up being "rather tempting" when the OS's don't use the full
pointer, and allows common cases to be type-checked without needing to
access memory (nor the need to manage memory for things like "fixnum"
and similar).

Some early versions of the BGBScript VM had used pointer boxing, and
then moved over to allocating arrays and using the offset into the array
as the fixnum. But, later moved over to tagged pointers.

Say, on a 32-bit machine, one could allocate 16MB arrays for fixnum and
flonum, each 24 bit in this case (falling back to boxed values in the
general case).

Where, BGBScript was superficially similar to JavaScript (though, its
successor, BGBScript2, had went in a slightly more Java-like direction).

Ironically, would still fail according to a "strict" definition of the C
rules, as one needs to compare unrelated pointers to determine if the
pointer represented a location within one of these arrays.

>> But that is the wrong question ... the right question is "how many
>> programmers use language implementations that bit-twiddle pointers to
>> encode type tags".
>>
>> Of course, the answer still is "relatively few".
>
> Really? How do Python (TIOBE #1), JavaScript (#7), Scratch (#13),
> MATLAB (#15), R (#16) and Ruby (#18) implement their dynamic type
> informations?
>
> Also, the real issue is: How many users never use programs written in
> a language that encodes type information in pointers?
>

IIRC:
CPython:
Pointer to PyObject, which encodes types itself;
Dunno about other Python implementations.
JavaScript:
NaN Boxing for Spider Monkey;
Pointer tagging for V8.
Ruby:
IIRC, pointer tagging.
Others:
Dunno.

Usual tradeoff of pointer tagging:
Can be faster and lower overhead than an object-based approach;
However, does create more obvious portability concerns...

>> There are better
>> ways to handle type information than by embedding tags into the
>> pointers.
>
> I don't think there are better ways for Prolog, and probably a number
> of other dynamically-typed programming languages. There is a reason
> why this technique is used. And ARM, AMD, and Intel have added
> architectural features to better support this usage
> <https://lwn.net/Articles/888914/>. I think there are many more CPUs
> from ARM, AMD, and Intel around than CHERI CPUs.
>

Yeah.

This is part of why I ended up leaving the top 16 bits of the pointer
for type-tags as default. The need for type-tags seemed to outweigh the
need for more than 256TB of virtual address space in the default case.

For 64-bit pointers, the default behavior is to ignore the tag bits
(unless requested to acknowledge them).

But, 128-bit pointers assume that one follows the ABI tag rules.

When I later ended up using these bits for saving/encoding the CPU mode
(for Link-Register, etc), or encoding some other state bits (for some of
the other registers). This effectively ended up "fixing" the virtual
address space size at 48 bits.

LR (63:48): ISA Mode and Flags;
GBR(63:48): FPU Control/Status Flags;
TTB(63:48): ASID (low bits of TTB encode page-table format)
....

But, so happens, I could also use these bits for bounds-checking, since
C doesn't use them much anyways (in these case, the bounds-checked
pointers exist within the ABI defined dynamic type-system).

But, I was trying to keep is so that programs are not required to follow
the ABI rules (and may instead use their own type-tagging schemes).
Though, some of the helper ops do in-fact assume that the type-tagging
follows the ABI defined rules.

Some other instructions, such as LDTEX operate within the tag bits
(using the tag bits to encode the texture size and format, but reusing
some tags for different purposes; but is special in that one is unlikely
to be passing texture objects through the dynamically typed runtime).

BGBCC can also sort of compile a JavaScript variant as well, and will
follow these rules.

There is also a partial BASIC implementation using this system.
The assumption is that if I later add other script interpreters, they
will also use this system (most likely, say, would use a JS variant as
the canonical script language; "less bad" IMHO than the language Bash
uses, though Bash's language can implicitly execute shell commands, but
I had considered a possible shorthand notation for this).

Say:
var x=3; //normal JS-like command
// comment
/ ls -alt //shell command

But only valid in code blocks within shell scripts.

Well, with shell command possibly interpreting $ as an escape for
variables or expressions.

var dir="/var/tmp";
/ ls -alt $(dir)

Though, possibly, some would object to the (non use) of the normal Bash
scripting language.

>> I read about CHERI quite some time ago, and I expect things have
>> changed since - but I can't recall anything in particular that would
>> prevent, e.g., a BiBOP implementation in which types were segregated
>> and identified by (some bits of the) object address.
>
> I don't think BiBOP would work with the way we implemented
> backtracking in our Prolog implementation.
>
> - anton

Re: The synergy of type tags on register file registers

<u5g5tj$3l7sa$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=32611&group=comp.arch#32611

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: cr88192@gmail.com (BGB)
Newsgroups: comp.arch
Subject: Re: The synergy of type tags on register file registers
Date: Sat, 3 Jun 2023 14:56:33 -0500
Organization: A noiseless patient Spider
Lines: 32
Message-ID: <u5g5tj$3l7sa$1@dont-email.me>
References: <08f739ac-2200-408c-a578-79e93f9cb272n@googlegroups.com>
<Ds1eM.858712$PXw7.741546@fx45.iad>
<c1e79245-bbc8-443c-aacd-0441d49ab84bn@googlegroups.com>
<f70924d3-49c8-4e0e-83d8-140a5c7ae4d2n@googlegroups.com>
<QrneM.597255$mmyc.279072@fx37.iad> <u5d4fa$37u8l$1@dont-email.me>
<9speM.529570$0dpc.321120@fx33.iad> <u5dbvr$38nbs$1@dont-email.me>
<08reM.2343550$MVg8.1754411@fx12.iad> <u5e9bl$3f0pv$1@dont-email.me>
<2IyeM.438218$jiuc.158540@fx44.iad> <u5ejpq$3g18m$1@dont-email.me>
<2eIeM.2362599$Tcw8.731334@fx10.iad> <u5g1tv$3kr3b$1@dont-email.me>
<7e9d9ba5-2679-474d-b2b4-90f418fa7c6fn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 3 Jun 2023 19:56:36 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="ec2bbef6d9205169dcd520037c2a05a3";
logging-data="3841930"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18FcgS5vY9yfYs3e8tiQF77"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.11.2
Cancel-Lock: sha1:2aVS0pnpMjdhwJBLYS6yLnrVQ2s=
Content-Language: en-US
In-Reply-To: <7e9d9ba5-2679-474d-b2b4-90f418fa7c6fn@googlegroups.com>
 by: BGB - Sat, 3 Jun 2023 19:56 UTC

On 6/3/2023 2:15 PM, MitchAlsup wrote:
> On Saturday, June 3, 2023 at 1:48:34 PM UTC-5, BGB wrote:
>> On 6/3/2023 9:36 AM, Scott Lurndal wrote:
>>> BGB <cr8...@gmail.com> writes:
>
>>> A downside? How many programmers have "bit-twiddled" pointers to
>>> encode type-tag bits?
>>>
>> Not sure how many, but it is (AFAIK) a pretty common way to implement
>> languages like Scheme and similar. IIRC, some of the Ruby
>> implementations also use this strategy, ...
> <
> I used the infamous XOR trick to keep doubly linked list in 1 container....
> On a PDP-11 to fit an application into memory (64Kb PDP-11/20).

Yeah.

Technically still valid in my case, but not well advised.

I guess the obvious drawback is that if a conservative garbage collector
were ever added, things like XOR'ing the pointers would not be
supportable. But, OTOH, a conservative GC could use the tag bits to
exclude most non-pointers from consideration.

Big obvious drawbacks of having a conservative mark/sweep collector or
similar being already noted...

>>
>

Re: The synergy of type tags on register file registers

<memo.20230603210116.5208G@jgd.cix.co.uk>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=32612&group=comp.arch#32612

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jgd@cix.co.uk (John Dallman)
Newsgroups: comp.arch
Subject: Re: The synergy of type tags on register file registers
Date: Sat, 3 Jun 2023 21:01 +0100 (BST)
Organization: A noiseless patient Spider
Lines: 39
Message-ID: <memo.20230603210116.5208G@jgd.cix.co.uk>
References: <u56frb$29tvu$1@dont-email.me>
Reply-To: jgd@cix.co.uk
Injection-Info: dont-email.me; posting-host="4fd655d1678f02d0788a2891748392a7";
logging-data="3843158"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18M1z55RZQhqu1iosmwdyA1hxzDBYzZEAc="
Cancel-Lock: sha1:rXK48j6p+UAXGLL6tydmSqA/NWE=
 by: John Dallman - Sat, 3 Jun 2023 20:01 UTC

In article <u56frb$29tvu$1@dont-email.me>, sfuld@alumni.cmu.edu.invalid
(Stephen Fuld) wrote:
> On 5/30/2023 12:31 PM, MitchAlsup wrote:
> > It really depends on what your target(s) is(are).
> > a) do you want to perform 128-bits occasionally,
> > b) do you want to perform 128-bits rather often,
> > c) do you want to perform 128-bits all the time.
>
> I think that is true, but with some caveats.
>
> 1. I don't know what the market today wants. Perhaps John Dallman
> or Thomas Koenig, with their perspective can chime in.

The mathematical modeller I work on was carefully designed to exploit
64-bit floats to the safe limits of range and precision. In the last few
years we've started using a small amount of 128-bit software floats, for
things that require unusual precision.

If 128-bit floats were available in hardware, we'd obviously move the
soft float to hardware. The next step would require some thought and
careful design, but it should be possible to expand the size and
precision of the model space dramatically. This would expand the
customers' capabilities dramatically, well beyond what they're currently
asking for.

There would be significant problems with data exchange between modellers
using 64-bit floats and 128-bit floats, simply because the 128-bit
modeller could represent many things that the 64-bit one can't. If it
were up to me, I'd call 128-bit a new product, and have only forwards
compatibility of data. That would also allow us to redesign a bunch of
other things.

I've been hoping for 128-bit floats, to try this kind of thing, since the
early 2000s. I pitched them to AMD but they felt there weren't enough
requests for it to be worth considering. I think it's the kind of change
that needs to be experienced for its full possibilities to be appreciated.

John

Re: The synergy of type tags on register file registers

<u5g74e$3lct6$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=32613&group=comp.arch#32613

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: terje.mathisen@tmsw.no (Terje Mathisen)
Newsgroups: comp.arch
Subject: Re: The synergy of type tags on register file registers
Date: Sat, 3 Jun 2023 22:17:18 +0200
Organization: A noiseless patient Spider
Lines: 45
Message-ID: <u5g74e$3lct6$1@dont-email.me>
References: <08f739ac-2200-408c-a578-79e93f9cb272n@googlegroups.com>
<u51v6p$1cf9p$2@dont-email.me>
<806573a4-0ee6-4bc7-a99b-37957669b868n@googlegroups.com>
<d94b9337-52e2-4b05-a26b-ca4b011df7d5n@googlegroups.com>
<u53cfh$1mn06$1@dont-email.me> <2023May30.192304@mips.complang.tuwien.ac.at>
<u55f2q$22hh1$1@dont-email.me> <2023May31.075457@mips.complang.tuwien.ac.at>
<u57ond$2edvp$1@dont-email.me> <2023Jun1.081845@mips.complang.tuwien.ac.at>
<u5epbh$3ggrq$1@dont-email.me> <2023Jun3.124957@mips.complang.tuwien.ac.at>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 3 Jun 2023 20:17:18 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="04eaad23ec9764c39931ead89a4585ea";
logging-data="3847078"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Q9S7fC1EWYNhahNKbkvbQvPnSdxBWqCuAf9N8Vn0C4w=="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.16
Cancel-Lock: sha1:NJKcWscfPehRnyJmNvKiunvi5RY=
In-Reply-To: <2023Jun3.124957@mips.complang.tuwien.ac.at>
 by: Terje Mathisen - Sat, 3 Jun 2023 20:17 UTC

Anton Ertl wrote:
> Ivan Godard <ivan@millcomputing.com> writes:
>> On 5/31/2023 11:18 PM, Anton Ertl wrote:
>>> Stephen Fuld <sfuld@alumni.cmu.edu.invalid> writes:
>>>> If 128 bit arithmetic becomes popular, and it is only
>>>> implemented in the SIMD registers, you could end up with something like
>>>> the 68000 with separate data versus address registers. :-(
>>>
>>> Yes, or the CDC 6600 A/B and X registers. But I don't expect that
>>> 128-bit arithmetic will become popular enough that popular
>>> architectures add 128-bit instructions for them. As for 128-bit
>>> addresses, given the slowdown in semiconductor advances, we may never
>>> get there.
>>>
>>> - anton
>>
>> Arithmetic already is in the commercial world: 33-digit decimal requires
>> 128.
>
> A competent programmer gets 38 digits out of 128 bits. I guess you
> waste some bits on the decimal FP nonsense. Please show any evidence

Anton, I expect better from you!

Sure, since 2^128 =~ 3.403e38 you can fit signed 38-digit integers in
128 bits, but if you need a more significant dynamic range, then the DFP
standard is actually quite efficient.

> that there is significant usage of that. The fact that Intel's
> implementation has not been updated in years (and there is a lot of
> potential for improvement) speaks against significant usage.
>
>> Agreed probably not for a while for raw addresses, but caps need at
>> least that much.
>
> Which have even less usage than decimal FP.

Possibly to the detriment of current computer users?

Terje

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

Re: The synergy of type tags on register file registers

<u5g79s$3lct6$2@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=32614&group=comp.arch#32614

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: terje.mathisen@tmsw.no (Terje Mathisen)
Newsgroups: comp.arch
Subject: Re: The synergy of type tags on register file registers
Date: Sat, 3 Jun 2023 22:20:12 +0200
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <u5g79s$3lct6$2@dont-email.me>
References: <08f739ac-2200-408c-a578-79e93f9cb272n@googlegroups.com>
<u51v6p$1cf9p$2@dont-email.me>
<806573a4-0ee6-4bc7-a99b-37957669b868n@googlegroups.com>
<d94b9337-52e2-4b05-a26b-ca4b011df7d5n@googlegroups.com>
<u53cfh$1mn06$1@dont-email.me> <2023May30.192304@mips.complang.tuwien.ac.at>
<u55f2q$22hh1$1@dont-email.me> <2023May31.075457@mips.complang.tuwien.ac.at>
<u57ond$2edvp$1@dont-email.me> <2023Jun1.081845@mips.complang.tuwien.ac.at>
<u5epbh$3ggrq$1@dont-email.me> <CgIeM.2362601$Tcw8.1398203@fx10.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 3 Jun 2023 20:20:12 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="04eaad23ec9764c39931ead89a4585ea";
logging-data="3847078"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Bj4yR8s7J+Os/m1GxHpkQ7vKg00Zq8FkvLKDEi6EEhg=="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.16
Cancel-Lock: sha1:xBUbZ//QXgviIxKkUwQY4qjfIVk=
In-Reply-To: <CgIeM.2362601$Tcw8.1398203@fx10.iad>
 by: Terje Mathisen - Sat, 3 Jun 2023 20:20 UTC

Scott Lurndal wrote:
> Ivan Godard <ivan@millcomputing.com> writes:
>> On 5/31/2023 11:18 PM, Anton Ertl wrote:
>>> Stephen Fuld <sfuld@alumni.cmu.edu.invalid> writes:
>>>> If 128 bit arithmetic becomes popular, and it is only
>>>> implemented in the SIMD registers, you could end up with something like
>>>> the 68000 with separate data versus address registers. :-(
>>>
>>> Yes, or the CDC 6600 A/B and X registers. But I don't expect that
>>> 128-bit arithmetic will become popular enough that popular
>>> architectures add 128-bit instructions for them. As for 128-bit
>>> addresses, given the slowdown in semiconductor advances, we may never
>>> get there.
>>>
>>> - anton
>>
>> Arithmetic already is in the commercial world: 33-digit decimal requires
>> 128. Agreed probably not for a while for raw addresses, but caps need at
>> least that much.
>
> Burroughs had 100 digit decimal in the 1960s. Real decimal, not binary
> masquerading as decimal.
>
Today we have GMP which handles arbitrary precision with ease.

While python defaults to arbitrary precision integers, Perl just need a
'use bigint' near the top of the program.

Terje

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

Re: The synergy of type tags on register file registers

<u5g8uc$3ljfr$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=32615&group=comp.arch#32615

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: cr88192@gmail.com (BGB)
Newsgroups: comp.arch
Subject: Re: The synergy of type tags on register file registers
Date: Sat, 3 Jun 2023 15:48:10 -0500
Organization: A noiseless patient Spider
Lines: 65
Message-ID: <u5g8uc$3ljfr$1@dont-email.me>
References: <08f739ac-2200-408c-a578-79e93f9cb272n@googlegroups.com>
<u51v6p$1cf9p$2@dont-email.me>
<806573a4-0ee6-4bc7-a99b-37957669b868n@googlegroups.com>
<d94b9337-52e2-4b05-a26b-ca4b011df7d5n@googlegroups.com>
<u53cfh$1mn06$1@dont-email.me> <2023May30.192304@mips.complang.tuwien.ac.at>
<u55f2q$22hh1$1@dont-email.me> <2023May31.075457@mips.complang.tuwien.ac.at>
<u57ond$2edvp$1@dont-email.me> <2023Jun1.081845@mips.complang.tuwien.ac.at>
<u5epbh$3ggrq$1@dont-email.me> <2023Jun3.124957@mips.complang.tuwien.ac.at>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 3 Jun 2023 20:48:13 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="ec2bbef6d9205169dcd520037c2a05a3";
logging-data="3853819"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+TAAsQ+SM7DpQz6GTqJHuk"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.11.2
Cancel-Lock: sha1:B/y03CcZtm0IWpLWpCf2pLarD1g=
Content-Language: en-US
In-Reply-To: <2023Jun3.124957@mips.complang.tuwien.ac.at>
 by: BGB - Sat, 3 Jun 2023 20:48 UTC

On 6/3/2023 5:49 AM, Anton Ertl wrote:
> Ivan Godard <ivan@millcomputing.com> writes:
>> On 5/31/2023 11:18 PM, Anton Ertl wrote:
>>> Stephen Fuld <sfuld@alumni.cmu.edu.invalid> writes:
>>>> If 128 bit arithmetic becomes popular, and it is only
>>>> implemented in the SIMD registers, you could end up with something like
>>>> the 68000 with separate data versus address registers. :-(
>>>
>>> Yes, or the CDC 6600 A/B and X registers. But I don't expect that
>>> 128-bit arithmetic will become popular enough that popular
>>> architectures add 128-bit instructions for them. As for 128-bit
>>> addresses, given the slowdown in semiconductor advances, we may never
>>> get there.
>>>
>>> - anton
>>
>> Arithmetic already is in the commercial world: 33-digit decimal requires
>> 128.
>
> A competent programmer gets 38 digits out of 128 bits. I guess you
> waste some bits on the decimal FP nonsense. Please show any evidence
> that there is significant usage of that. The fact that Intel's
> implementation has not been updated in years (and there is a lot of
> potential for improvement) speaks against significant usage.
>

Depends on usage probably.

Packed BCD, 32 digits;
DPD: 38 digits (36 in naive case);
4x 9-digits in 32-bit linear integer, 36.

For a software implementation, the "9 digits per 32 bits as a linear
integer" strategy probably makes the most sense from a performance POV
as one can mostly leverage normal binary integer operations.

Well, closely by "19 digits per 64 bits as linear integer".

BCD and DPD make more sense for doing it in hardware.

Personally, I don't have a particularly strong use-case for BCD ops, and
the closest I had was "Well, if you have a BCD adder, a trick can be
used to use it for faster number printing".

Had added it as an experiment, but usage was limited as "slightly faster
printf()" isn't particularly notable (and bigger issue were things like
buffering a string of text and sending the whole thing at once, as doing
one syscall, *, per character causes text-printing to look like it is
coming over a serial link...).

*: Well, with in my case, each syscall involving two context switches...

>> Agreed probably not for a while for raw addresses, but caps need at
>> least that much.
>
> Which have even less usage than decimal FP.
>

Probably true...

> - anton

Re: The synergy of type tags on register file registers

<1e9fd632-9915-442b-ade5-fa2fba8c39bcn@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=32616&group=comp.arch#32616

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:620a:2807:b0:75c:c431:37d7 with SMTP id f7-20020a05620a280700b0075cc43137d7mr4931755qkp.11.1685826796133;
Sat, 03 Jun 2023 14:13:16 -0700 (PDT)
X-Received: by 2002:a05:6870:98ac:b0:19f:927:5f1a with SMTP id
eg44-20020a05687098ac00b0019f09275f1amr1943829oab.4.1685826795805; Sat, 03
Jun 2023 14:13:15 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Sat, 3 Jun 2023 14:13:15 -0700 (PDT)
In-Reply-To: <u5g74e$3lct6$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:2103:71:3a42:aff5;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:2103:71:3a42:aff5
References: <08f739ac-2200-408c-a578-79e93f9cb272n@googlegroups.com>
<u51v6p$1cf9p$2@dont-email.me> <806573a4-0ee6-4bc7-a99b-37957669b868n@googlegroups.com>
<d94b9337-52e2-4b05-a26b-ca4b011df7d5n@googlegroups.com> <u53cfh$1mn06$1@dont-email.me>
<2023May30.192304@mips.complang.tuwien.ac.at> <u55f2q$22hh1$1@dont-email.me>
<2023May31.075457@mips.complang.tuwien.ac.at> <u57ond$2edvp$1@dont-email.me>
<2023Jun1.081845@mips.complang.tuwien.ac.at> <u5epbh$3ggrq$1@dont-email.me>
<2023Jun3.124957@mips.complang.tuwien.ac.at> <u5g74e$3lct6$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1e9fd632-9915-442b-ade5-fa2fba8c39bcn@googlegroups.com>
Subject: Re: The synergy of type tags on register file registers
From: MitchAlsup@aol.com (MitchAlsup)
Injection-Date: Sat, 03 Jun 2023 21:13:16 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3842
 by: MitchAlsup - Sat, 3 Jun 2023 21:13 UTC

On Saturday, June 3, 2023 at 3:17:21 PM UTC-5, Terje Mathisen wrote:
> Anton Ertl wrote:
> > Ivan Godard <iv...@millcomputing.com> writes:
> >> On 5/31/2023 11:18 PM, Anton Ertl wrote:
> >>> Stephen Fuld <sf...@alumni.cmu.edu.invalid> writes:
> >>>> If 128 bit arithmetic becomes popular, and it is only
> >>>> implemented in the SIMD registers, you could end up with something like
> >>>> the 68000 with separate data versus address registers. :-(
> >>>
> >>> Yes, or the CDC 6600 A/B and X registers. But I don't expect that
> >>> 128-bit arithmetic will become popular enough that popular
> >>> architectures add 128-bit instructions for them. As for 128-bit
> >>> addresses, given the slowdown in semiconductor advances, we may never
> >>> get there.
> >>>
> >>> - anton
> >>
> >> Arithmetic already is in the commercial world: 33-digit decimal requires
> >> 128.
> >
> > A competent programmer gets 38 digits out of 128 bits. I guess you
> > waste some bits on the decimal FP nonsense. Please show any evidence
> Anton, I expect better from you!
>
> Sure, since 2^128 =~ 3.403e38 you can fit signed 38-digit integers in
> 128 bits, but if you need a more significant dynamic range, then the DFP
> standard is actually quite efficient.
<
You can represent the GDP of the world in the worlds least valuable currency
in 128-bit.
<
If you need more than that, it is no longer a money problem, but a bignum
problem.
<
> > that there is significant usage of that. The fact that Intel's
> > implementation has not been updated in years (and there is a lot of
> > potential for improvement) speaks against significant usage.
> >
> >> Agreed probably not for a while for raw addresses, but caps need at
> >> least that much.
> >
> > Which have even less usage than decimal FP.
> Possibly to the detriment of current computer users?
>
> Terje
>
>
> --
> - <Terje.Mathisen at tmsw.no>
> "almost all programming can be viewed as an exercise in caching"

Re: The synergy of type tags on register file registers

<2023Jun3.234917@mips.complang.tuwien.ac.at>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=32617&group=comp.arch#32617

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.arch
Subject: Re: The synergy of type tags on register file registers
Date: Sat, 03 Jun 2023 21:49:17 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 36
Message-ID: <2023Jun3.234917@mips.complang.tuwien.ac.at>
References: <08f739ac-2200-408c-a578-79e93f9cb272n@googlegroups.com> <d94b9337-52e2-4b05-a26b-ca4b011df7d5n@googlegroups.com> <u53cfh$1mn06$1@dont-email.me> <2023May30.192304@mips.complang.tuwien.ac.at> <u55f2q$22hh1$1@dont-email.me> <2023May31.075457@mips.complang.tuwien.ac.at> <u57ond$2edvp$1@dont-email.me> <2023Jun1.081845@mips.complang.tuwien.ac.at> <u5epbh$3ggrq$1@dont-email.me> <2023Jun3.124957@mips.complang.tuwien.ac.at> <u5g74e$3lct6$1@dont-email.me>
Injection-Info: dont-email.me; posting-host="48cceea1648e163db3d5948604c1101d";
logging-data="3866509"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+3d0jpFDYadQjKS7w8t6Tv"
Cancel-Lock: sha1:CbTvJ2fgrCLmso32/kT+00BFuV8=
X-newsreader: xrn 10.11
 by: Anton Ertl - Sat, 3 Jun 2023 21:49 UTC

Terje Mathisen <terje.mathisen@tmsw.no> writes:
>Anton Ertl wrote:
>> Ivan Godard <ivan@millcomputing.com> writes:
>>> Arithmetic already is in the commercial world: 33-digit decimal requires
>>> 128.
>>
>> A competent programmer gets 38 digits out of 128 bits. I guess you
>> waste some bits on the decimal FP nonsense. Please show any evidence
>
>Anton, I expect better from you!
>
>Sure, since 2^128 =~ 3.403e38 you can fit signed 38-digit integers in
>128 bits, but if you need a more significant dynamic range

You don't. The commercial rules are designed for fixed-point
computations. So the way to go is with fixed-point of the needed
length (but 38 digits should be good enough). For stuff that needs
dynamic range, you don't need decimal, and therefore use binary FP.

And I guess that's why DFP is not seeing the uptake that its advocates
expected.

>>> Agreed probably not for a while for raw addresses, but caps need at
>>> least that much.
>>
>> Which have even less usage than decimal FP.
>
>Possibly to the detriment of current computer users?

Maybe. Or maybe capabilities are an idee fixe of some people like DFP
is (for a different, but possibly overlapping group of people).

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


devel / comp.arch / The synergy of type tags on register file registers

Pages:12345678910
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor