Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

In 1869 the waffle iron was invented for people who had wrinkled waffles.


devel / comp.arch / Decoding Instructions in Parallel

SubjectAuthor
* Decoding Instructions in ParallelQuadibloc
+* Re: Decoding Instructions in ParallelMitchAlsup
|`* Re: Decoding Instructions in ParallelEricP
| `- Re: Decoding Instructions in ParallelMitchAlsup
`- Re: Decoding Instructions in ParallelBGB

1
Decoding Instructions in Parallel

<unbvif$lvrg$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: quadibloc@servername.invalid (Quadibloc)
Newsgroups: comp.arch
Subject: Decoding Instructions in Parallel
Date: Sat, 6 Jan 2024 16:36:31 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 46
Message-ID: <unbvif$lvrg$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 6 Jan 2024 16:36:31 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="6677fe8c65e2d1e6d507d3230381d1dd";
logging-data="720752"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/j93m+VjP1vfgxKCKe/F/wpamHgu1LyIU="
User-Agent: Pan/0.146 (Hic habitat felicitas; d7a48b4
gitlab.gnome.org/GNOME/pan.git)
Cancel-Lock: sha1:PLxkmIfQ9E+ZodAMkDTi7MZKzN0=
 by: Quadibloc - Sat, 6 Jan 2024 16:36 UTC

Given that I do not know a whole lot about how cache
coherency is done, and Mitch asked me what approach
I was planning to take...

I went on a web search to find more information on
the subject.

I learned that MSI went to MESI... and then there were
a bunch of "ownership" schemes, such as Berkeley,
Illinois, Firefly, and Dragon.

By 1999, AMD seems to have done something in that area
with MOESI, and later on Intel came up with MESIF instead,
where "F", for Forwarding, is _like_ owned data, but it
is also saved to RAM. Engineers at Intel recently also
wrote papers on "MOESI Prime", which has primed versions
of two of the MOESI states to avoid the cache coherency
mechanism causing RowHammer-like behavior.

Anyways... there was something else I found while looking
this stuff up.

I had noted that one of the reasons for offering the
programmer a choice of writing programs with 32-bit
long instructions and nothing but 32-bit long instructions,
or using block headers for blocks of 256 bits in code,
was to allow instructions to be decoded in parallel.

Mitch pointed out that one could just start decoding
in parallel at every possible instruction start location,
while also, in parallel, quickly resolving instruction
lengths so as to find which decodes result in executions.

I acknowledged that one could certainly do that, but
since it was somewhat wasteful of heat and electricity,
I didn't think of this as describing a _typical_
implementation of my ISA (and hence parallel decoding
was still an excuse for having a block structure rather
than conventional CISC-like variable-length instructions).

Well, one of my search results showed that this was how
they did it on the first 64-bit Opterons, from AMD, so
that explains why this technique came so readily to
Mitch's mind!

John Savard

Re: Decoding Instructions in Parallel

<222172c378456126d263889fd36af185@news.novabbs.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!.POSTED!not-for-mail
From: mitchalsup@aol.com (MitchAlsup)
Newsgroups: comp.arch
Subject: Re: Decoding Instructions in Parallel
Date: Sat, 6 Jan 2024 19:16:30 +0000
Organization: novaBBS
Message-ID: <222172c378456126d263889fd36af185@news.novabbs.com>
References: <unbvif$lvrg$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="2516676"; mail-complaints-to="usenet@i2pn2.org";
posting-account="t+lO0yBNO1zGxasPvGSZV1BRu71QKx+JE37DnW+83jQ";
User-Agent: Rocksolid Light
X-Spam-Checker-Version: SpamAssassin 4.0.0
X-Rslight-Posting-User: 7e9c45bcd6d4757c5904fbe9a694742e6f8aa949
X-Rslight-Site: $2y$10$lwuUoucAMj6b7pyQ00iv2OON8LzD.usjsTt5i7wL5RJgtXZAA9D8y
 by: MitchAlsup - Sat, 6 Jan 2024 19:16 UTC

Quadibloc wrote:

> Given that I do not know a whole lot about how cache
> coherency is done, and Mitch asked me what approach
> I was planning to take...

> I went on a web search to find more information on
> the subject.

> I learned that MSI went to MESI... and then there were
> a bunch of "ownership" schemes, such as Berkeley,
> Illinois, Firefly, and Dragon.

> By 1999, AMD seems to have done something in that area
> with MOESI, and later on Intel came up with MESIF instead,
> where "F", for Forwarding, is _like_ owned data, but it
> is also saved to RAM. Engineers at Intel recently also
> wrote papers on "MOESI Prime", which has primed versions
> of two of the MOESI states to avoid the cache coherency
> mechanism causing RowHammer-like behavior.

The OWNED state represents the concept that this copy is the
only valid copy, so you better not lose it. A request can
arrive back with OWNED data (in some protocols) and now the
recipient is in charge of not losing it.

> Anyways... there was something else I found while looking
> this stuff up.

> I had noted that one of the reasons for offering the
> programmer a choice of writing programs with 32-bit
> long instructions and nothing but 32-bit long instructions,
> or using block headers for blocks of 256 bits in code,
> was to allow instructions to be decoded in parallel.

> Mitch pointed out that one could just start decoding
> in parallel at every possible instruction start location,

Consider reading 4 words at a time out of ICache. Even
before one compares the tag and selects the data to be
decoded, one can apply a block of logic 40-gates in
size and 4-gates of delay and have unary pointers to
the {Next instruction, any displacement, any constant}
by the time the tags have been compared and the 4-words
are then gated out with these extra pointers (8-bits)
on top of the 128-bits of instructions.

Each Next instruction pointer selects its successor, and
a tree of these resolves 2->4->8->16 at 1 more gate of
delay each. {Higher exponents seem accessible if desired}

> while also, in parallel, quickly resolving instruction
> lengths so as to find which decodes result in executions.

Generally one associated DECODE with when logical registers
are applied to either the physical register rile or to the
register renamer. These be ports one must use efficiently
and if possible the stage before DECODE (I call PARSE)
routes instructions to suitable DECODERs {Especially
important in ISAs with multiple register files {GPR, FP,
SIMD}.

> I acknowledged that one could certainly do that, but
> since it was somewhat wasteful of heat and electricity,

Separating PARSE from DECODE minimizes the waste heat
as all we are doing is looking at enough bits to route
the instruction to somewhere it can be efficiently DECODEd.
DECODE accesses the register ports and all sorts of big
gate count decoding, PARSE uses tiny pattern decoders to
only route instruction.

> I didn't think of this as describing a _typical_
> implementation of my ISA (and hence parallel decoding
> was still an excuse for having a block structure rather
> than conventional CISC-like variable-length instructions).

> Well, one of my search results showed that this was how
> they did it on the first 64-bit Opterons, from AMD, so
> that explains why this technique came so readily to
> Mitch's mind!

Burned in solid. Opteron used a trailing marker bit so we
know if we were looking at the last byte in an instruction
(or not). My 66000 uses 4 Major OpCode patterns from 001xxx
to then use a 4-bit positions {15,14,13,11} to decode all
VLE size information.

> John Savard

Re: Decoding Instructions in Parallel

<unfspm$1dtmr$2@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: cr88192@gmail.com (BGB)
Newsgroups: comp.arch
Subject: Re: Decoding Instructions in Parallel
Date: Sun, 7 Jan 2024 22:13:38 -0600
Organization: A noiseless patient Spider
Lines: 111
Message-ID: <unfspm$1dtmr$2@dont-email.me>
References: <unbvif$lvrg$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 8 Jan 2024 04:13:42 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="06e71f09c68f58f98fdadfd6a2f37a91";
logging-data="1504987"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18FjDbYdzdXjO1o1om/4yH1"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:yqL8gy/1nOxOaWO29FiZZlyQlYU=
Content-Language: en-US
In-Reply-To: <unbvif$lvrg$1@dont-email.me>
 by: BGB - Mon, 8 Jan 2024 04:13 UTC

On 1/6/2024 10:36 AM, Quadibloc wrote:
> Given that I do not know a whole lot about how cache
> coherency is done, and Mitch asked me what approach
> I was planning to take...
>
> I went on a web search to find more information on
> the subject.
>
> I learned that MSI went to MESI... and then there were
> a bunch of "ownership" schemes, such as Berkeley,
> Illinois, Firefly, and Dragon.
>
> By 1999, AMD seems to have done something in that area
> with MOESI, and later on Intel came up with MESIF instead,
> where "F", for Forwarding, is _like_ owned data, but it
> is also saved to RAM. Engineers at Intel recently also
> wrote papers on "MOESI Prime", which has primed versions
> of two of the MOESI states to avoid the cache coherency
> mechanism causing RowHammer-like behavior.
>

I still haven't bothered with this...

Though, yeah, not having cache coherence between cores does make for an
ugly situation in that conventional threading doesn't work if one
schedules multiple threads for the same process on different CPU cores
(and cases where memory sharing is being used may require manual cache
flushing or eviction).

So, proper cache-coherence is still to-do. Need to come up with
something "hopefully cheap" though.

That, or maybe try to convince people to do multithreaded programming
without the assistance of conventional cache coherence (... yeah ...).

Though, at least with direct-mapped caches, it is possible to use dummy
buffers and pointer trickery to knock stuff out of the cache. So, say,
one can write algorithms in ways where shared memory access alternately
accesses the shared memory object, and an alternate dummy address (with
accesses being performed in such a way that cores will knock dirty lines
out to RAM, discard any stale values, and then retrieve the "up to date"
values from RAM).

Practice is questionable though, as it does not work with associative
caches (and would require multiple sets of accesses to various addresses
to deal with multi-level eviction, say, to get things out of the L2
cache and into DRAM, and/or convoluted access patterns to evict things
from a 2-way cache, ...).

Then again, maybe one can argue that by the time one is using
associative caches, one can probably justify having proper cache
coherence?...

Well, there is this, and accessing memory from a "no-cache" address
(which has an auto-evict mechanism), but then observe that this
mechanism is seemingly somehow slower than just going through MMIO (or
using sets of alternating memory addresses to knock things out of the
various cache levels).

> Anyways... there was something else I found while looking
> this stuff up.
>
> I had noted that one of the reasons for offering the
> programmer a choice of writing programs with 32-bit
> long instructions and nothing but 32-bit long instructions,
> or using block headers for blocks of 256 bits in code,
> was to allow instructions to be decoded in parallel.
>

Yeah, this is part of why only 32-bit encodings ended up allowed in
bundles...

Allowing variable length instructions in bundles would increase the
number of decoders required (and more complicated/expensive logic to MUX
the outputs of those decoders).

> Mitch pointed out that one could just start decoding
> in parallel at every possible instruction start location,
> while also, in parallel, quickly resolving instruction
> lengths so as to find which decodes result in executions.
>
> I acknowledged that one could certainly do that, but
> since it was somewhat wasteful of heat and electricity,
> I didn't think of this as describing a _typical_
> implementation of my ISA (and hence parallel decoding
> was still an excuse for having a block structure rather
> than conventional CISC-like variable-length instructions).
>

In my case, the same basic logic was overloaded for both bundles and
64/96 bit instructions. As far as decoding is concerned, the jumbo
prefixes are instructions (just with some horizontal decoding magic
glued on).

> Well, one of my search results showed that this was how
> they did it on the first 64-bit Opterons, from AMD, so
> that explains why this technique came so readily to
> Mitch's mind!
>

But, not necessarily cheap.

> John Savard

Re: Decoding Instructions in Parallel

<d9WmN.37859$GX69.27555@fx46.iad>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx46.iad.POSTED!not-for-mail
From: ThatWouldBeTelling@thevillage.com (EricP)
User-Agent: Thunderbird 2.0.0.24 (Windows/20100228)
MIME-Version: 1.0
Newsgroups: comp.arch
Subject: Re: Decoding Instructions in Parallel
References: <unbvif$lvrg$1@dont-email.me> <222172c378456126d263889fd36af185@news.novabbs.com>
In-Reply-To: <222172c378456126d263889fd36af185@news.novabbs.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 50
Message-ID: <d9WmN.37859$GX69.27555@fx46.iad>
X-Complaints-To: abuse@UsenetServer.com
NNTP-Posting-Date: Mon, 08 Jan 2024 17:20:09 UTC
Date: Mon, 08 Jan 2024 12:20:01 -0500
X-Received-Bytes: 2901
 by: EricP - Mon, 8 Jan 2024 17:20 UTC

MitchAlsup wrote:
> Quadibloc wrote:
>
>> Given that I do not know a whole lot about how cache
>> coherency is done, and Mitch asked me what approach
>> I was planning to take...
>
>> I went on a web search to find more information on
>> the subject.
>
>> I learned that MSI went to MESI... and then there were
>> a bunch of "ownership" schemes, such as Berkeley,
>> Illinois, Firefly, and Dragon.
>
>> By 1999, AMD seems to have done something in that area
>> with MOESI, and later on Intel came up with MESIF instead,
>> where "F", for Forwarding, is _like_ owned data, but it
>> is also saved to RAM. Engineers at Intel recently also
>> wrote papers on "MOESI Prime", which has primed versions
>> of two of the MOESI states to avoid the cache coherency
>> mechanism causing RowHammer-like behavior.

The Forward state is to address the issue of who should respond to a
request for a shared copy of a line when there are multiple sharers.
If multiple sharers respond it could flood a requester with redundant
messages.

The Directory Controller (DC) records which lines are held in each core
in what state. It remembers the most recent core to read-share a line
as the Forward state, on the assumption that copy is most likely still
resident, while the prior readers are tracked in a Shared state.

The cache with the line in a Forward state is told send a shared copy to
a read-shared requester, who becomes the line's new Forward state holder.
If no Forward copy is available the DC reads from DRAM.

> The OWNED state represents the concept that this copy is the
> only valid copy, so you better not lose it. A request can
> arrive back with OWNED data (in some protocols) and now the recipient is
> in charge of not losing it.

Also OWNED is the modified-shared state where the owner modifies a line
then shared read-only copies of it. The ownership can be passed to a
new cache without writing it back to DRAM or invalidating the shared copies.
To modify the line again the owner has to invalidate all the shared copies
first to return it to the Exclusive state.
When the owner eventually evicts the line, it is responsible for writing
it back to DRAM.

Re: Decoding Instructions in Parallel

<f13260f127a6187ca32374c9954f6b84@news.novabbs.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!.POSTED!not-for-mail
From: mitchalsup@aol.com (MitchAlsup)
Newsgroups: comp.arch
Subject: Re: Decoding Instructions in Parallel
Date: Mon, 8 Jan 2024 22:13:37 +0000
Organization: novaBBS
Message-ID: <f13260f127a6187ca32374c9954f6b84@news.novabbs.com>
References: <unbvif$lvrg$1@dont-email.me> <222172c378456126d263889fd36af185@news.novabbs.com> <d9WmN.37859$GX69.27555@fx46.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="2776237"; mail-complaints-to="usenet@i2pn2.org";
posting-account="t+lO0yBNO1zGxasPvGSZV1BRu71QKx+JE37DnW+83jQ";
User-Agent: Rocksolid Light
X-Rslight-Site: $2y$10$E7N6kXeZGackYBTXWPkaweLuIm32qMqyBQ1usTkK606ziDCUV5C0i
X-Spam-Checker-Version: SpamAssassin 4.0.0
X-Rslight-Posting-User: 7e9c45bcd6d4757c5904fbe9a694742e6f8aa949
 by: MitchAlsup - Mon, 8 Jan 2024 22:13 UTC

EricP wrote:

> MitchAlsup wrote:
>> Quadibloc wrote:
>>
>>> Given that I do not know a whole lot about how cache
>>> coherency is done, and Mitch asked me what approach
>>> I was planning to take...
>>
>>> I went on a web search to find more information on
>>> the subject.
>>
>>> I learned that MSI went to MESI... and then there were
>>> a bunch of "ownership" schemes, such as Berkeley,
>>> Illinois, Firefly, and Dragon.
>>
>>> By 1999, AMD seems to have done something in that area
>>> with MOESI, and later on Intel came up with MESIF instead,
>>> where "F", for Forwarding, is _like_ owned data, but it
>>> is also saved to RAM. Engineers at Intel recently also
>>> wrote papers on "MOESI Prime", which has primed versions
>>> of two of the MOESI states to avoid the cache coherency
>>> mechanism causing RowHammer-like behavior.

> The Forward state is to address the issue of who should respond to a
> request for a shared copy of a line when there are multiple sharers.
> If multiple sharers respond it could flood a requester with redundant
> messages.

> The Directory Controller (DC) records which lines are held in each core
> in what state. It remembers the most recent core to read-share a line
> as the Forward state, on the assumption that copy is most likely still
> resident, while the prior readers are tracked in a Shared state.

> The cache with the line in a Forward state is told send a shared copy to
> a read-shared requester, who becomes the line's new Forward state holder.
> If no Forward copy is available the DC reads from DRAM.

>> The OWNED state represents the concept that this copy is the
>> only valid copy, so you better not lose it. A request can
>> arrive back with OWNED data (in some protocols) and now the recipient is
>> in charge of not losing it.

> Also OWNED is the modified-shared state where the owner modifies a line
> then shared read-only copies of it. The ownership can be passed to a
> new cache without writing it back to DRAM or invalidating the shared copies.
> To modify the line again the owner has to invalidate all the shared copies
> first to return it to the Exclusive state.

Granted

> When the owner eventually evicts the line, it is responsible for writing
> it back to DRAM.

Or sending it to another cache that can take OWNERship over it.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor