Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"Jesus saves...but Gretzky gets the rebound!" -- Daniel Hinojosa (hinojosa@hp-sdd)


devel / comp.arch / Re: Exec

SubjectAuthor
* Sequencer vs microcodeMarcus
+* Re: Sequencer vs microcodewinden
|`* Re: Sequencer vs microcodeMitchAlsup
| `- Re: Sequencer vs microcodeMitchAlsup
`* Re: Sequencer vs microcodeMitchAlsup
 `* Re: Sequencer vs microcodeMarcus
  `* Re: Sequencer vs microcodeBGB
   `* Re: Sequencer vs microcodeMitchAlsup
    +* Re: Sequencer vs microcoderobf...@gmail.com
    |+* Re: Sequencer vs microcodeMarcus
    ||`* Re: Sequencer vs microcoderobf...@gmail.com
    || `* Re: Sequencer vs microcodeMitchAlsup
    ||  `* Re: Sequencer vs microcodeEricP
    ||   +- Re: Sequencer vs microcodeAnton Ertl
    ||   `* Re: Sequencer vs microcodeMitchAlsup
    ||    +* Re: Sequencer vs microcoderobf...@gmail.com
    ||    |+- Re: Sequencer vs microcodeStephen Fuld
    ||    |`* Re: Sequencer vs microcodeMitchAlsup
    ||    | `* Re: Sequencer vs microcoderobf...@gmail.com
    ||    |  `* Re: Sequencer vs microcodeStefan Monnier
    ||    |   +* Re: Sequencer vs microcodeThomas Koenig
    ||    |   |`* Re: Sequencer vs microcoderobf...@gmail.com
    ||    |   | `- Re: Sequencer vs microcodeAnton Ertl
    ||    |   +* Re: Sequencer vs microcodeIvan Godard
    ||    |   |`* Re: Sequencer vs microcodeStefan Monnier
    ||    |   | `* Re: Sequencer vs microcodeStephen Fuld
    ||    |   |  `* Re: Sequencer vs microcodeStefan Monnier
    ||    |   |   +* Re: Sequencer vs microcodeMitchAlsup
    ||    |   |   |+* Re: Sequencer vs microcoderobf...@gmail.com
    ||    |   |   ||+- Re: Sequencer vs microcoderobf...@gmail.com
    ||    |   |   ||+* Re: Sequencer vs microcodeStefan Monnier
    ||    |   |   |||`- Re: Sequencer vs microcodeEricP
    ||    |   |   ||+* Re: Sequencer vs microcodeEricP
    ||    |   |   |||`* Re: Sequencer vs microcodeStefan Monnier
    ||    |   |   ||| `* Re: Sequencer vs microcodeEricP
    ||    |   |   |||  `* Re: Sequencer vs microcodeStefan Monnier
    ||    |   |   |||   `- Re: Sequencer vs microcodeEricP
    ||    |   |   ||+- Exec (was: Sequencer vs microcode)Anton Ertl
    ||    |   |   ||`- Re: Sequencer vs microcodeMitchAlsup
    ||    |   |   |`* Re: Sequencer vs microcodeAnton Ertl
    ||    |   |   | `* Re: Sequencer vs microcoderobf...@gmail.com
    ||    |   |   |  `- Re: Sequencer vs microcodeMitchAlsup
    ||    |   |   +- Re: Sequencer vs microcodeThomas Koenig
    ||    |   |   `* Re: Sequencer vs microcodeMarcus
    ||    |   |    `* Re: Sequencer vs microcoderobf...@gmail.com
    ||    |   |     +* Exec (was: Sequencer vs microcode)Anton Ertl
    ||    |   |     |`* Re: ExecStefan Monnier
    ||    |   |     | `* Re: ExecAnton Ertl
    ||    |   |     |  `* Re: Execrobf...@gmail.com
    ||    |   |     |   `* Re: ExecMitchAlsup
    ||    |   |     |    `* Re: ExecStefan Monnier
    ||    |   |     |     +* Re: ExecMitchAlsup
    ||    |   |     |     |+* Re: Execrobf...@gmail.com
    ||    |   |     |     ||`- Re: ExecMitchAlsup
    ||    |   |     |     |`- Re: ExecStefan Monnier
    ||    |   |     |     `* Re: ExecAnton Ertl
    ||    |   |     |      `- Re: ExecStefan Monnier
    ||    |   |     `- Re: Sequencer vs microcodeStefan Monnier
    ||    |   `* Re: Sequencer vs microcodeQuadibloc
    ||    |    +* Re: Sequencer vs microcodeQuadibloc
    ||    |    |+- Re: Sequencer vs microcodeQuadibloc
    ||    |    |+* Re: Sequencer vs microcodeMitchAlsup
    ||    |    ||`- Re: EX instructon, Sequencer vs microcodeJohn Levine
    ||    |    |+* Re: Sequencer vs microcodeStephen Fuld
    ||    |    ||+- Re: Sequencer vs microcodeQuadibloc
    ||    |    ||`* Re: Execute, not Sequencer vs microcodeJohn Levine
    ||    |    || `* Re: Execute, not Sequencer vs microcodeMitchAlsup
    ||    |    ||  `* Re: Execute, not Sequencer vs microcodeQuadibloc
    ||    |    ||   `* Re: Execute, not Sequencer vs microcodeJohn Levine
    ||    |    ||    `* Re: Execute, not Sequencer vs microcodeMitchAlsup
    ||    |    ||     +* Re: Execute, not Sequencer vs microcodeStephen Fuld
    ||    |    ||     |`* Re: Execute, not Sequencer vs microcodeQuadibloc
    ||    |    ||     | `* Re: Execute, not Sequencer vs microcodeQuadibloc
    ||    |    ||     |  `* Re: Execute, not Sequencer vs microcodeJohn Levine
    ||    |    ||     |   +* Re: Execute, not Sequencer vs microcodeQuadibloc
    ||    |    ||     |   |`- Re: transistors, was Execute, not Sequencer vs microcodeJohn Levine
    ||    |    ||     |   +* Re: Execute, not Sequencer vs microcodeMitchAlsup
    ||    |    ||     |   |`* Re: Execute, not Sequencer vs microcodeJohn Levine
    ||    |    ||     |   | +* Re: Execute, not Sequencer vs microcodeThomas Koenig
    ||    |    ||     |   | |+* Re: Execute, not Sequencer vs microcodeJohn Levine
    ||    |    ||     |   | ||`- Re: Execute, not Sequencer vs microcodeQuadibloc
    ||    |    ||     |   | |`* Re: Execute, not Sequencer vs microcodeIvan Godard
    ||    |    ||     |   | | +* Re: Execute, not Sequencer vs microcodeStephen Fuld
    ||    |    ||     |   | | |`* Re: Execute, not Sequencer vs microcodeIvan Godard
    ||    |    ||     |   | | | `* Re: Execute, not Sequencer vs microcodeQuadibloc
    ||    |    ||     |   | | |  `- Re: Execute, not Sequencer vs microcodeThomas Koenig
    ||    |    ||     |   | | `* Re: 7094, was Execute, not Sequencer vs microcodeJohn Levine
    ||    |    ||     |   | |  `- Re: 7094, was Execute, not Sequencer vs microcodeBrian G. Lucas
    ||    |    ||     |   | `- Re: Execute, not Sequencer vs microcodeQuadibloc
    ||    |    ||     |   `* Re: Execute, not Sequencer vs microcodeStephen Fuld
    ||    |    ||     |    `* Re: Execute, not Sequencer vs microcodeJohn Levine
    ||    |    ||     |     +* Re: Execute, not Sequencer vs microcodeQuadibloc
    ||    |    ||     |     |+* Re: Execute, not Sequencer vs microcodeThomas Koenig
    ||    |    ||     |     ||+- Re: Execute, not Sequencer vs microcodeMitchAlsup
    ||    |    ||     |     ||`* Re: Execute, not Sequencer vs microcodeQuadibloc
    ||    |    ||     |     || `- Re: Execute, not Sequencer vs microcodeIvan Godard
    ||    |    ||     |     |`* Re: Execute and IBM history, not Sequencer vs microcodeJohn Levine
    ||    |    ||     |     | `* Re: Execute and IBM history, not Sequencer vs microcodeStephen Fuld
    ||    |    ||     |     |  +* Re: Execute and IBM history, not Sequencer vs microcodeAnne & Lynn Wheeler
    ||    |    ||     |     |  |+* Re: Execute and IBM history, not Sequencer vs microcodeStephen Fuld
    ||    |    ||     |     |  ||`- Re: Execute and IBM history, not Sequencer vs microcodeAnne & Lynn Wheeler
    ||    |    ||     |     |  |`* Re: Execute and IBM history, not Sequencer vs microcodeJohn Levine
    ||    |    ||     |     |  `* Re: Execute and IBM history, not Sequencer vs microcodeJohn Levine
    ||    |    ||     |     `* Re: Execute, not Sequencer vs microcodeStephen Fuld
    ||    |    ||     `- Re: Execute, not Sequencer vs microcodeIvan Godard
    ||    |    |`- Re: Sequencer vs microcodeantispam
    ||    |    `* Re: Sequencer vs microcodeStefan Monnier
    ||    `* Re: Sequencer vs microcodeKent Dickey
    |`- Re: Sequencer vs microcodeMitchAlsup
    `- Re: Sequencer vs microcodeBGB

Pages:1234567
Re: Exec

<5af46c01-8fb8-4526-a4af-52fa714c5e60n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:ae9:ed4c:: with SMTP id c73mr10260719qkg.37.1624998045628;
Tue, 29 Jun 2021 13:20:45 -0700 (PDT)
X-Received: by 2002:aca:b18a:: with SMTP id a132mr491313oif.30.1624998045380;
Tue, 29 Jun 2021 13:20:45 -0700 (PDT)
Path: i2pn2.org!i2pn.org!news.swapon.de!newsreader4.netcologne.de!news.netcologne.de!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Tue, 29 Jun 2021 13:20:45 -0700 (PDT)
In-Reply-To: <42430dc6-1410-440b-8009-b47e15b5541cn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:1a6:66b6:1520:df39;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:1a6:66b6:1520:df39
References: <sb1abl$ps8$1@dont-email.me> <e2d01fcb-2cb1-4fb4-bf0e-b08d23ead140n@googlegroups.com>
<jwvv95yhy1o.fsf-monnier+comp.arch@gnu.org> <sbcu9u$587$1@dont-email.me>
<jwvfsx2hquz.fsf-monnier+comp.arch@gnu.org> <sbd1tr$jfl$1@dont-email.me>
<jwvy2ath6c3.fsf-monnier+comp.arch@gnu.org> <sbeig1$o01$1@dont-email.me>
<18641964-95f3-426a-a318-470ef6cfcd47n@googlegroups.com> <2021Jun29.162615@mips.complang.tuwien.ac.at>
<jwv1r8khepo.fsf-monnier+comp.arch@gnu.org> <2021Jun29.192608@mips.complang.tuwien.ac.at>
<42430dc6-1410-440b-8009-b47e15b5541cn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5af46c01-8fb8-4526-a4af-52fa714c5e60n@googlegroups.com>
Subject: Re: Exec
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Tue, 29 Jun 2021 20:20:45 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 4264
 by: MitchAlsup - Tue, 29 Jun 2021 20:20 UTC

On Tuesday, June 29, 2021 at 1:10:36 PM UTC-5, robf...@gmail.com wrote:
> I do not seem to be able to follow the example.
<
If you did not snip so much we could follow your train of thought.
<
>Why cannot other instructions decode and execute during that time?
<
Those other instruction following the EXC are dependent on whatever the EXC instruction does.
And since you have not seen the bit pattern of the instruction to be EXCed you don't know what
those dependencies might be !!
<
>It is just a load operation taking place to load the instruction. Things would proceed as per a normal load. It may be many more cycles / instructions before the instruction EXEC is executed. Once EXEC is decoded / issued it is just a matter of waiting for register values.
<
No, it is also a mater of successive instructions not having "done the wrong thing" because
of assumptions you made following EXC.
<
> >What is the semantic if you wanted to EXEC a register and the instruction needed 96-bits,
> >128-bits, or 160-bits ??
> Instructions are limited to 36-bits in this case. I think using more registers to contain instruction modifiers will work.
>
> I think it is execute of the one particular instruction that must stall, not decode. On my machine other instructions can be decoded or execute.
<
What if those instructions are dependent on the (not yet seen) instruction which will be EXCed ?
<
>This is relied on to hide the decode time in many cases.
> If the registers are valid before the EXEC is processed, then it will be fast. Hmm, it just occurred to me that I put a four-cycle lockout in the execute scheduler to prevent it selecting the same queue slot until there was time to mark the instruction as out. So, EXEC would take five or more cycles to execute. Of course, it is mostly hidden time.
<
Our point is that it cannot (CAN NOT) be hidden due to various dependencies you cannot
resolve until the bit pattern of the instruction to be EXCed is seen.
>
> It is very few LOC to implement EXEC. The biggest piece is probably the mux on the IR. I am waiting to see how much it impacts design size, but synth keeps crashing on me.
> I think all that needs to be done is:
> if (robo.exec) begin
> rob[robo.rid].ir <= robo.res.val[35:0]; // comes from register arg A
> rob[robo.rid].dec <= FALSE;
> rob[robo.rid].out <= FALSE;
> rob[robo.rid].cmt <= FALSE;
> rob[robo.rid].cmt2 <= FALSE;
> rob[robo.rid].vcmt <= FALSE;
> end

Re: Sequencer vs microcode

<jwvlf6sfk1i.fsf-monnier+comp.arch@gnu.org>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: monn...@iro.umontreal.ca (Stefan Monnier)
Newsgroups: comp.arch
Subject: Re: Sequencer vs microcode
Date: Tue, 29 Jun 2021 17:20:20 -0400
Organization: A noiseless patient Spider
Lines: 10
Message-ID: <jwvlf6sfk1i.fsf-monnier+comp.arch@gnu.org>
References: <sb1abl$ps8$1@dont-email.me>
<42b654db-a022-42f3-a6aa-94cd5a88de98n@googlegroups.com>
<53e78bb8-5c9c-481e-8cec-50a3febcbe95n@googlegroups.com>
<sb75hs$7nq$1@dont-email.me>
<3050904a-eec2-4d47-ba5d-bfed1d774518n@googlegroups.com>
<3d37be3c-e4fd-41b3-93f7-7037a3c19aefn@googlegroups.com>
<e5IBI.683979$ST2.397427@fx47.iad>
<8b1baea3-a802-4341-8afd-d827e4eee948n@googlegroups.com>
<3b2b37a7-6168-42c0-a657-dcff23fa3e03n@googlegroups.com>
<7ce8fca5-3a58-4e9a-92b4-595d0a743c57n@googlegroups.com>
<e2d01fcb-2cb1-4fb4-bf0e-b08d23ead140n@googlegroups.com>
<jwvv95yhy1o.fsf-monnier+comp.arch@gnu.org>
<sbcu9u$587$1@dont-email.me>
<jwvfsx2hquz.fsf-monnier+comp.arch@gnu.org>
<sbd1tr$jfl$1@dont-email.me>
<jwvy2ath6c3.fsf-monnier+comp.arch@gnu.org>
<1ca49244-3cb6-4cfe-aee8-332145c67674n@googlegroups.com>
<35b24e3f-0b5d-42a1-a08a-cc4d8d77231fn@googlegroups.com>
<mZwCI.366532$jf1.289886@fx37.iad>
<jwvczs4heyw.fsf-monnier+comp.arch@gnu.org>
<weHCI.1947$SMMb.866@fx17.iad>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="d5b28953779022f435cfca735a21e3c7";
logging-data="4456"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+h5Y0oHkkoQpFj2jvbXwT2"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
Cancel-Lock: sha1:Ou/n7fVIlPSa3L2PjSmdtUlSzrw=
sha1:jPYExaYDMvkpOUm5Nje9cDZs/7s=
 by: Stefan Monnier - Tue, 29 Jun 2021 21:20 UTC

> The predictor MAY supply such a value, which MAY be correct.
> However the design must deal with the possibility that the predictor
> responds with "no hit", or "hit" but provides the wrong value.

AFAIK all BTBs always return a value. It may be complete garbage
(e.g. when you turn on the power), but it always predicts something.
IOW instead of stalling the pipeline they'll get a mispredict later on.

Stefan

Re: Exec

<jwvbl7ofih6.fsf-monnier+comp.arch@gnu.org>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: monn...@iro.umontreal.ca (Stefan Monnier)
Newsgroups: comp.arch
Subject: Re: Exec
Date: Tue, 29 Jun 2021 17:56:33 -0400
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <jwvbl7ofih6.fsf-monnier+comp.arch@gnu.org>
References: <sb1abl$ps8$1@dont-email.me>
<e2d01fcb-2cb1-4fb4-bf0e-b08d23ead140n@googlegroups.com>
<jwvv95yhy1o.fsf-monnier+comp.arch@gnu.org>
<sbcu9u$587$1@dont-email.me>
<jwvfsx2hquz.fsf-monnier+comp.arch@gnu.org>
<sbd1tr$jfl$1@dont-email.me>
<jwvy2ath6c3.fsf-monnier+comp.arch@gnu.org>
<sbeig1$o01$1@dont-email.me>
<18641964-95f3-426a-a318-470ef6cfcd47n@googlegroups.com>
<2021Jun29.162615@mips.complang.tuwien.ac.at>
<jwv1r8khepo.fsf-monnier+comp.arch@gnu.org>
<2021Jun29.192608@mips.complang.tuwien.ac.at>
<42430dc6-1410-440b-8009-b47e15b5541cn@googlegroups.com>
<5af46c01-8fb8-4526-a4af-52fa714c5e60n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="d5b28953779022f435cfca735a21e3c7";
logging-data="18542"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18wYxYUCdpYI7c/NX1coVii"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
Cancel-Lock: sha1:wGP5d19byt30Yc8/FmOu2BZs430=
sha1:Tsa5RlQWoOZlzUgf3exm1pvDYXY=
 by: Stefan Monnier - Tue, 29 Jun 2021 21:56 UTC

> Our point is that it cannot (CAN NOT) be hidden due to various
> dependencies you cannot resolve until the bit pattern of the
> instruction to be EXCed is seen.

I think it's not that bad: you'd just have an "exec predictor" alongside
the other branch predictors, which returns the instruction likely to be
executed by a given EXEC instruction.

Still, the benefit of such an instruction sounds quite dubious.

[ Note: the EXEC instruction in Forth has the same name but is a quite
different beast. Since it takes an instruction *name* as argument,
which corresponds conceptually to an address rather than an actual
machine-language instruction. It naturally maps to "JAL reg" rather
than an EXEC instruction when you generate machine-language code. ]

Stefan

Re: Exec

<9344d41d-74e2-48f2-b890-1902a85b7dbcn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a37:7c07:: with SMTP id x7mr33579912qkc.417.1625010368681;
Tue, 29 Jun 2021 16:46:08 -0700 (PDT)
X-Received: by 2002:aca:3d56:: with SMTP id k83mr1025216oia.110.1625010368431;
Tue, 29 Jun 2021 16:46:08 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Tue, 29 Jun 2021 16:46:08 -0700 (PDT)
In-Reply-To: <jwvbl7ofih6.fsf-monnier+comp.arch@gnu.org>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:1a6:66b6:1520:df39;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:1a6:66b6:1520:df39
References: <sb1abl$ps8$1@dont-email.me> <e2d01fcb-2cb1-4fb4-bf0e-b08d23ead140n@googlegroups.com>
<jwvv95yhy1o.fsf-monnier+comp.arch@gnu.org> <sbcu9u$587$1@dont-email.me>
<jwvfsx2hquz.fsf-monnier+comp.arch@gnu.org> <sbd1tr$jfl$1@dont-email.me>
<jwvy2ath6c3.fsf-monnier+comp.arch@gnu.org> <sbeig1$o01$1@dont-email.me>
<18641964-95f3-426a-a318-470ef6cfcd47n@googlegroups.com> <2021Jun29.162615@mips.complang.tuwien.ac.at>
<jwv1r8khepo.fsf-monnier+comp.arch@gnu.org> <2021Jun29.192608@mips.complang.tuwien.ac.at>
<42430dc6-1410-440b-8009-b47e15b5541cn@googlegroups.com> <5af46c01-8fb8-4526-a4af-52fa714c5e60n@googlegroups.com>
<jwvbl7ofih6.fsf-monnier+comp.arch@gnu.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9344d41d-74e2-48f2-b890-1902a85b7dbcn@googlegroups.com>
Subject: Re: Exec
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Tue, 29 Jun 2021 23:46:08 +0000
Content-Type: text/plain; charset="UTF-8"
 by: MitchAlsup - Tue, 29 Jun 2021 23:46 UTC

On Tuesday, June 29, 2021 at 4:56:38 PM UTC-5, Stefan Monnier wrote:
> > Our point is that it cannot (CAN NOT) be hidden due to various
> > dependencies you cannot resolve until the bit pattern of the
> > instruction to be EXCed is seen.
<
> I think it's not that bad: you'd just have an "exec predictor" alongside
> the other branch predictors, which returns the instruction likely to be
> executed by a given EXEC instruction.
<
You missed my point:: code is execution and modifying various registers;
now along comes an EXC instruction that will modify registers--but until
the bit pattern shows up you can't decide which subsequent instructions
can run and which must wait (until the data, memory, flow) dependency
the EXC instruction may create by executing.
<
>
> Still, the benefit of such an instruction sounds quite dubious.
>
> [ Note: the EXEC instruction in Forth has the same name but is a quite
> different beast. Since it takes an instruction *name* as argument,
> which corresponds conceptually to an address rather than an actual
> machine-language instruction. It naturally maps to "JAL reg" rather
> than an EXEC instruction when you generate machine-language code. ]
>
>
> Stefan

Re: Exec

<d70b5c48-279f-4395-8689-51504329331fn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:ae9:f704:: with SMTP id s4mr12144038qkg.249.1625015106501;
Tue, 29 Jun 2021 18:05:06 -0700 (PDT)
X-Received: by 2002:a05:6830:1d8:: with SMTP id r24mr143754ota.206.1625015106250;
Tue, 29 Jun 2021 18:05:06 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Tue, 29 Jun 2021 18:05:06 -0700 (PDT)
In-Reply-To: <9344d41d-74e2-48f2-b890-1902a85b7dbcn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2607:fea8:1de1:d400:30e5:6d26:4cbb:f0ba;
posting-account=QId4bgoAAABV4s50talpu-qMcPp519Eb
NNTP-Posting-Host: 2607:fea8:1de1:d400:30e5:6d26:4cbb:f0ba
References: <sb1abl$ps8$1@dont-email.me> <e2d01fcb-2cb1-4fb4-bf0e-b08d23ead140n@googlegroups.com>
<jwvv95yhy1o.fsf-monnier+comp.arch@gnu.org> <sbcu9u$587$1@dont-email.me>
<jwvfsx2hquz.fsf-monnier+comp.arch@gnu.org> <sbd1tr$jfl$1@dont-email.me>
<jwvy2ath6c3.fsf-monnier+comp.arch@gnu.org> <sbeig1$o01$1@dont-email.me>
<18641964-95f3-426a-a318-470ef6cfcd47n@googlegroups.com> <2021Jun29.162615@mips.complang.tuwien.ac.at>
<jwv1r8khepo.fsf-monnier+comp.arch@gnu.org> <2021Jun29.192608@mips.complang.tuwien.ac.at>
<42430dc6-1410-440b-8009-b47e15b5541cn@googlegroups.com> <5af46c01-8fb8-4526-a4af-52fa714c5e60n@googlegroups.com>
<jwvbl7ofih6.fsf-monnier+comp.arch@gnu.org> <9344d41d-74e2-48f2-b890-1902a85b7dbcn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d70b5c48-279f-4395-8689-51504329331fn@googlegroups.com>
Subject: Re: Exec
From: robfi...@gmail.com (robf...@gmail.com)
Injection-Date: Wed, 30 Jun 2021 01:05:06 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: robf...@gmail.com - Wed, 30 Jun 2021 01:05 UTC

>Our point is that it cannot (CAN NOT) be hidden due to various dependencies you cannot
>resolve until the bit pattern of the instruction to be EXCed is seen.

Thank-you for clarifying that. My skulls a little dense some days. Of course following instruction cannot work until the dependencies are resolved. What if the target register were specified in the instruction? The same target register as used in the instruction in the register. One could stipulate that the EXEC instruction must always use a particular register. In order for EXEC to be useful the registers would need to be known in advance. Registers feeding the EXEC need to be known too. One must know and plan how the EXEC instruction will fit into code.
I tried synth and it increased the size of the design by about 3% which is more than I expected.

Re: Exec

<64087832-7e13-41e7-ba2c-2666409c3eden@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a0c:fd85:: with SMTP id p5mr33632661qvr.22.1625015447052;
Tue, 29 Jun 2021 18:10:47 -0700 (PDT)
X-Received: by 2002:a4a:4084:: with SMTP id n126mr6366487ooa.74.1625015446778;
Tue, 29 Jun 2021 18:10:46 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Tue, 29 Jun 2021 18:10:46 -0700 (PDT)
In-Reply-To: <d70b5c48-279f-4395-8689-51504329331fn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:1a6:66b6:1520:df39;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:1a6:66b6:1520:df39
References: <sb1abl$ps8$1@dont-email.me> <e2d01fcb-2cb1-4fb4-bf0e-b08d23ead140n@googlegroups.com>
<jwvv95yhy1o.fsf-monnier+comp.arch@gnu.org> <sbcu9u$587$1@dont-email.me>
<jwvfsx2hquz.fsf-monnier+comp.arch@gnu.org> <sbd1tr$jfl$1@dont-email.me>
<jwvy2ath6c3.fsf-monnier+comp.arch@gnu.org> <sbeig1$o01$1@dont-email.me>
<18641964-95f3-426a-a318-470ef6cfcd47n@googlegroups.com> <2021Jun29.162615@mips.complang.tuwien.ac.at>
<jwv1r8khepo.fsf-monnier+comp.arch@gnu.org> <2021Jun29.192608@mips.complang.tuwien.ac.at>
<42430dc6-1410-440b-8009-b47e15b5541cn@googlegroups.com> <5af46c01-8fb8-4526-a4af-52fa714c5e60n@googlegroups.com>
<jwvbl7ofih6.fsf-monnier+comp.arch@gnu.org> <9344d41d-74e2-48f2-b890-1902a85b7dbcn@googlegroups.com>
<d70b5c48-279f-4395-8689-51504329331fn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <64087832-7e13-41e7-ba2c-2666409c3eden@googlegroups.com>
Subject: Re: Exec
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Wed, 30 Jun 2021 01:10:47 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: MitchAlsup - Wed, 30 Jun 2021 01:10 UTC

On Tuesday, June 29, 2021 at 8:05:07 PM UTC-5, robf...@gmail.com wrote:
> >Our point is that it cannot (CAN NOT) be hidden due to various dependencies you cannot
> >resolve until the bit pattern of the instruction to be EXCed is seen.
> Thank-you for clarifying that.
<
It seems to be a job that falls upon my shoulders.......
<
>My skulls a little dense some days. Of course following instruction cannot work until the dependencies are resolved. What if the target register were specified in the instruction?
<
This helps, but subsequent instructions still cannot damage any of the source registers, either.
And if EXC is EXCing a LD instruction no subsequent ST can modify memory to the (as yet unknown) cache line.
<
>The same target register as used in the instruction in the register. One could stipulate that the EXEC instruction must always use a particular register. In order for EXEC to be useful the registers would need to be known in advance. Registers feeding the EXEC need to be known too.
<
What might be workable is to have the EXC instruction specify all of the operand and result
registers and the EXCed instruction only supplies the OpCode. Other than that and you can't
trace the dependencies 'cause you haven't seen the bit patterns in the instruction to be EXCed.
<
> One must know and plan how the EXEC instruction will fit into code.
> I tried synth and it increased the size of the design by about 3% which is more than I expected.

Re: Exec

<jwvv95wcchj.fsf-monnier+comp.arch@gnu.org>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: monn...@iro.umontreal.ca (Stefan Monnier)
Newsgroups: comp.arch
Subject: Re: Exec
Date: Tue, 29 Jun 2021 22:35:56 -0400
Organization: A noiseless patient Spider
Lines: 23
Message-ID: <jwvv95wcchj.fsf-monnier+comp.arch@gnu.org>
References: <sb1abl$ps8$1@dont-email.me>
<e2d01fcb-2cb1-4fb4-bf0e-b08d23ead140n@googlegroups.com>
<jwvv95yhy1o.fsf-monnier+comp.arch@gnu.org>
<sbcu9u$587$1@dont-email.me>
<jwvfsx2hquz.fsf-monnier+comp.arch@gnu.org>
<sbd1tr$jfl$1@dont-email.me>
<jwvy2ath6c3.fsf-monnier+comp.arch@gnu.org>
<sbeig1$o01$1@dont-email.me>
<18641964-95f3-426a-a318-470ef6cfcd47n@googlegroups.com>
<2021Jun29.162615@mips.complang.tuwien.ac.at>
<jwv1r8khepo.fsf-monnier+comp.arch@gnu.org>
<2021Jun29.192608@mips.complang.tuwien.ac.at>
<42430dc6-1410-440b-8009-b47e15b5541cn@googlegroups.com>
<5af46c01-8fb8-4526-a4af-52fa714c5e60n@googlegroups.com>
<jwvbl7ofih6.fsf-monnier+comp.arch@gnu.org>
<9344d41d-74e2-48f2-b890-1902a85b7dbcn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="48dc9934e6c6b6e6adbb2f03a0f875ee";
logging-data="5099"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+NrkhbjbU3oEwDz0tpcNat"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
Cancel-Lock: sha1:mG3qGO+mxK3jIkuj3Smxv+UjTDM=
sha1:YTevNBpQnpA6OjHA6tsPZfgo0KE=
 by: Stefan Monnier - Wed, 30 Jun 2021 02:35 UTC

>> I think it's not that bad: you'd just have an "exec predictor" alongside
>> the other branch predictors, which returns the instruction likely to be
>> executed by a given EXEC instruction.
> You missed my point:: code is execution and modifying various registers;
> now along comes an EXC instruction that will modify registers--but until

Hmm... I don't see the problem: the "exec predictor" will predict the
actual instruction that will be executed. It'd be a prediction
structure much like a BTB, except that it returns an instruction rather
than an address: you index it with (a hash of) the address of the EXEC
instruction and it returns the bits of the instruction that was last
EXEC'd at that (hash of) address. So you take that predicted
instruction and stuff it into your instruction sequence.

When you finally do execute the EXEC you just check that the instruction
is equal to the predicted one and if not you do the misprediction rollback.

A lot of work for a not very useful feature, but if you're really intent
on providing it efficiently it seems not terribly hard. The harder part
might be the "stuff it into your instruction sequence".

Stefan

Re: Sequencer vs microcode

<HfRCI.574$8b2.234@fx24.iad>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!paganini.bofh.team!news.dns-netz.com!news.freedyn.net!newsreader4.netcologne.de!news.netcologne.de!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx24.iad.POSTED!not-for-mail
From: ThatWoul...@thevillage.com (EricP)
User-Agent: Thunderbird 2.0.0.24 (Windows/20100228)
MIME-Version: 1.0
Newsgroups: comp.arch
Subject: Re: Sequencer vs microcode
References: <sb1abl$ps8$1@dont-email.me> <53e78bb8-5c9c-481e-8cec-50a3febcbe95n@googlegroups.com> <sb75hs$7nq$1@dont-email.me> <3050904a-eec2-4d47-ba5d-bfed1d774518n@googlegroups.com> <3d37be3c-e4fd-41b3-93f7-7037a3c19aefn@googlegroups.com> <e5IBI.683979$ST2.397427@fx47.iad> <8b1baea3-a802-4341-8afd-d827e4eee948n@googlegroups.com> <3b2b37a7-6168-42c0-a657-dcff23fa3e03n@googlegroups.com> <7ce8fca5-3a58-4e9a-92b4-595d0a743c57n@googlegroups.com> <e2d01fcb-2cb1-4fb4-bf0e-b08d23ead140n@googlegroups.com> <jwvv95yhy1o.fsf-monnier+comp.arch@gnu.org> <sbcu9u$587$1@dont-email.me> <jwvfsx2hquz.fsf-monnier+comp.arch@gnu.org> <sbd1tr$jfl$1@dont-email.me> <jwvy2ath6c3.fsf-monnier+comp.arch@gnu.org> <1ca49244-3cb6-4cfe-aee8-332145c67674n@googlegroups.com> <35b24e3f-0b5d-42a1-a08a-cc4d8d77231fn@googlegroups.com> <mZwCI.366532$jf1.289886@fx37.iad> <jwvczs4heyw.fsf-monnier+comp.arch@gnu.org> <weHCI.1947$SMMb.866@fx17.iad> <jwvlf6sfk1i.fsf-monnier+comp.arch@gnu.org>
In-Reply-To: <jwvlf6sfk1i.fsf-monnier+comp.arch@gnu.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 61
Message-ID: <HfRCI.574$8b2.234@fx24.iad>
X-Complaints-To: abuse@UsenetServer.com
NNTP-Posting-Date: Wed, 30 Jun 2021 03:09:27 UTC
Date: Tue, 29 Jun 2021 23:08:25 -0400
X-Received-Bytes: 4588
 by: EricP - Wed, 30 Jun 2021 03:08 UTC

Stefan Monnier wrote:
>> The predictor MAY supply such a value, which MAY be correct.
>> However the design must deal with the possibility that the predictor
>> responds with "no hit", or "hit" but provides the wrong value.
>
> AFAIK all BTBs always return a value. It may be complete garbage
> (e.g. when you turn on the power), but it always predicts something.
> IOW instead of stalling the pipeline they'll get a mispredict later on.
>
>
> Stefan

The ones I have seen had Valid flags on their entries.
But since aliasing can occur one can add tags to try to limit it,
and a tag compare can generate a miss.

The pipeline can stall for other reasons than mispredict.
e.g. ROB fills up, Rename runs out of physical registers.
There are two kinds of stage stall signals: generated and propagated.
Each stage must propagate stall signals from later ones to earlier.
Some also can internally generate stalls. So what we are discussing is
whether Decode also has a FF and a little logic that generates a stall.

There are a bunch of scenarios where Fetch-Parse make a decision
about which path to follow, that Decode can detect as erroneous.
If this happens, Fetch could go off on a wild goose chase so Decode
should halt it until the situation resolves.

In my design, Parse puts the instruction bytes into the parse buffer,
and it includes any prediction information it used to decide the
next IP address. Decode cross-checks the prediction path followed
against the decoded instruction, and if they don't match
- purges parse buffers
- if possible Decode redirects Fetch to the correct path
- if correction not possible, Decode stalls Fetch until
Branch Control Unit (in back end) can resolve.

E.g.1: Fetch looks up an IP in BTB and gets a miss so continues sequentially.
Parse includes this prediction in the instruction buffer.
Decode detects an unconditional branch that was not in the BTB.
Decode calculates the correct branch destination,
purges the parse buffers, and redirects fetch to the correct path.
Penalty: 1 clock * issue width instructions.

E.g.2: Fetch looks up IP in BTB, gets hit and instruction type is RET.
So it consults the Return Stack Predictor and return stack underflows
due to prior overflow and wrap around, so no return address.
Parse puts instruction in parse buffer and stalls Fetch
to prevent it running off into the wild.

E.g.3: Fetch looks up IP in BTB, gets hit and instruction type is RET.
It consults the Return Stack Predictor and gets a return address.
Parse puts instruction in parse buffer with prediction.
Decode checks the instruction and sees it is not a RET
(so this was a false hit due to BTB entry aliasing).
Decode purges the parse buffers, and redirects Fetch to the correct path.
(There is probably some fix ups to the Return Stack Predictor too
if Fetch adjusted its copy of that stack.)
Penalty: 1 clock * issue width instructions.

Re: Sequencer vs microcode

<cd8707b1-0d4a-4ffe-8717-dd74f246c876n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a0c:bf4b:: with SMTP id b11mr35817327qvj.11.1625029975691;
Tue, 29 Jun 2021 22:12:55 -0700 (PDT)
X-Received: by 2002:a9d:70c1:: with SMTP id w1mr7264257otj.82.1625029975375;
Tue, 29 Jun 2021 22:12:55 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Tue, 29 Jun 2021 22:12:55 -0700 (PDT)
In-Reply-To: <jwvv95yhy1o.fsf-monnier+comp.arch@gnu.org>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:56a:f8e3:d700:5cfe:92d6:24da:e8f8;
posting-account=1nOeKQkAAABD2jxp4Pzmx9Hx5g9miO8y
NNTP-Posting-Host: 2001:56a:f8e3:d700:5cfe:92d6:24da:e8f8
References: <sb1abl$ps8$1@dont-email.me> <cc7766bb-1433-45f4-9ba5-93c40bdab0f7n@googlegroups.com>
<sb553t$kta$1@dont-email.me> <sb5a40$o97$1@dont-email.me> <42b654db-a022-42f3-a6aa-94cd5a88de98n@googlegroups.com>
<53e78bb8-5c9c-481e-8cec-50a3febcbe95n@googlegroups.com> <sb75hs$7nq$1@dont-email.me>
<3050904a-eec2-4d47-ba5d-bfed1d774518n@googlegroups.com> <3d37be3c-e4fd-41b3-93f7-7037a3c19aefn@googlegroups.com>
<e5IBI.683979$ST2.397427@fx47.iad> <8b1baea3-a802-4341-8afd-d827e4eee948n@googlegroups.com>
<3b2b37a7-6168-42c0-a657-dcff23fa3e03n@googlegroups.com> <7ce8fca5-3a58-4e9a-92b4-595d0a743c57n@googlegroups.com>
<e2d01fcb-2cb1-4fb4-bf0e-b08d23ead140n@googlegroups.com> <jwvv95yhy1o.fsf-monnier+comp.arch@gnu.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <cd8707b1-0d4a-4ffe-8717-dd74f246c876n@googlegroups.com>
Subject: Re: Sequencer vs microcode
From: jsav...@ecn.ab.ca (Quadibloc)
Injection-Date: Wed, 30 Jun 2021 05:12:55 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Quadibloc - Wed, 30 Jun 2021 05:12 UTC

On Monday, June 28, 2021 at 8:21:44 AM UTC-6, Stefan Monnier wrote:

> As a compiler/proglang guy, the one thing that stumps me instead here is "why?".
> Why would you want, or when/where would you need something like an
> "exec" opcode? It seems to me like a "solution" in search of a problem.

Well, the "execute" instruction used to be provided on very old architectures.

They were usually advanced enough to include an index register, though, so that
wasn't the problem they solved.

Since they were old architectures, they didn't have the problem that memory
access was enormously slower than arithmetic.

One possible use for an execute instruction:

The architecture has "pseudo-ops". These have the form of a memory-reference
instruction (the machine is an accumulator to memory machine, so all the
arithmetic instructions have that form). Only the opcode is used.

So if you were, say, implementing floating-point in software, you could use
a pseudo-op as an "add floating" instruction in this way:

Have the "add floating" subroutine include two exec instructions, both of which
target the pseudo-op that invoked the subroutine. The floating-point number to be
added is the *operand* of the pseudo-op. The exec instructions modify the pseudo-op
to make it a load instruction, and one of them adds 1 to the address as well.

So this way you don't have to chop the instruction up into bits and write a subroutine
to decode it; you're using the computer's own built-in ability to decode instructions to
do that work for you.

John Savard

Re: Sequencer vs microcode

<8fcc1aac-10c9-4507-8b78-8e5f03184930n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:6214:b08:: with SMTP id u8mr35811626qvj.52.1625041589542;
Wed, 30 Jun 2021 01:26:29 -0700 (PDT)
X-Received: by 2002:aca:3d56:: with SMTP id k83mr2258909oia.110.1625041589323;
Wed, 30 Jun 2021 01:26:29 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.snarked.org!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Wed, 30 Jun 2021 01:26:29 -0700 (PDT)
In-Reply-To: <cd8707b1-0d4a-4ffe-8717-dd74f246c876n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:56a:f8e3:d700:5cfe:92d6:24da:e8f8;
posting-account=1nOeKQkAAABD2jxp4Pzmx9Hx5g9miO8y
NNTP-Posting-Host: 2001:56a:f8e3:d700:5cfe:92d6:24da:e8f8
References: <sb1abl$ps8$1@dont-email.me> <cc7766bb-1433-45f4-9ba5-93c40bdab0f7n@googlegroups.com>
<sb553t$kta$1@dont-email.me> <sb5a40$o97$1@dont-email.me> <42b654db-a022-42f3-a6aa-94cd5a88de98n@googlegroups.com>
<53e78bb8-5c9c-481e-8cec-50a3febcbe95n@googlegroups.com> <sb75hs$7nq$1@dont-email.me>
<3050904a-eec2-4d47-ba5d-bfed1d774518n@googlegroups.com> <3d37be3c-e4fd-41b3-93f7-7037a3c19aefn@googlegroups.com>
<e5IBI.683979$ST2.397427@fx47.iad> <8b1baea3-a802-4341-8afd-d827e4eee948n@googlegroups.com>
<3b2b37a7-6168-42c0-a657-dcff23fa3e03n@googlegroups.com> <7ce8fca5-3a58-4e9a-92b4-595d0a743c57n@googlegroups.com>
<e2d01fcb-2cb1-4fb4-bf0e-b08d23ead140n@googlegroups.com> <jwvv95yhy1o.fsf-monnier+comp.arch@gnu.org>
<cd8707b1-0d4a-4ffe-8717-dd74f246c876n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8fcc1aac-10c9-4507-8b78-8e5f03184930n@googlegroups.com>
Subject: Re: Sequencer vs microcode
From: jsav...@ecn.ab.ca (Quadibloc)
Injection-Date: Wed, 30 Jun 2021 08:26:29 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 56
 by: Quadibloc - Wed, 30 Jun 2021 08:26 UTC

On Tuesday, June 29, 2021 at 11:12:57 PM UTC-6, Quadibloc wrote:
> On Monday, June 28, 2021 at 8:21:44 AM UTC-6, Stefan Monnier wrote:
>
> > As a compiler/proglang guy, the one thing that stumps me instead here is "why?".
> > Why would you want, or when/where would you need something like an
> > "exec" opcode? It seems to me like a "solution" in search of a problem.
>
> Well, the "execute" instruction used to be provided on very old architectures.
>
> They were usually advanced enough to include an index register, though, so that
> wasn't the problem they solved.
>
> Since they were old architectures, they didn't have the problem that memory
> access was enormously slower than arithmetic.
>
> One possible use for an execute instruction:
>
> The architecture has "pseudo-ops". These have the form of a memory-reference
> instruction (the machine is an accumulator to memory machine, so all the
> arithmetic instructions have that form). Only the opcode is used.
>
> So if you were, say, implementing floating-point in software, you could use
> a pseudo-op as an "add floating" instruction in this way:
>
> Have the "add floating" subroutine include two exec instructions, both of which
> target the pseudo-op that invoked the subroutine. The floating-point number to be
> added is the *operand* of the pseudo-op. The exec instructions modify the pseudo-op
> to make it a load instruction, and one of them adds 1 to the address as well.
>
> So this way you don't have to chop the instruction up into bits and write a subroutine
> to decode it; you're using the computer's own built-in ability to decode instructions to
> do that work for you.

So this explains why the Execute instruction was not only very useful, but even almost
necessary, on computers like the SDS 930. (Having been in the same room as one at
times, I can attest that this is a computer that actually existed.)

Out of curiosity, I checked the Principles of Operation of the IBM System/360 to see
if _it_ had an Execute instruction. It did. But it had limitations which meant that it
could *not* be used the way the execute instruction on the SDS 930 could be used.

Only bits 8 through 15 of the executed instruction could be modified. This was done
through means of an OR operation. So the displacement in a memory-reference
instruction couldn't be changed, nor could the opcode be changed. And, indeed, I
doubt that the System/360's Execute instruction _was_ ever used much.

But what was it _intended_ to be used for? The things it _could_ modify were the source
and destination registers of register-to-register instructions, or the destination and index
registers of memory-to-register operations.

So the thinking behind it was this: the System/360 had sixteen general registers. It was
possible to write programs that looped to do something with successive locations in
memory. It might be desired to loop through registers too, given that there are so many
general registers provided. (To do so meant a memory access to get the executed
instruction, but that was not so much of a concern in those days.)

John Savard

Re: Sequencer vs microcode

<680ceaf2-a4c1-4068-96d7-5c4bb580ad42n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a37:6d07:: with SMTP id i7mr37040771qkc.472.1625053159986;
Wed, 30 Jun 2021 04:39:19 -0700 (PDT)
X-Received: by 2002:aca:de05:: with SMTP id v5mr2603347oig.157.1625053159730;
Wed, 30 Jun 2021 04:39:19 -0700 (PDT)
Path: i2pn2.org!i2pn.org!paganini.bofh.team!usenet.pasdenom.info!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Wed, 30 Jun 2021 04:39:19 -0700 (PDT)
In-Reply-To: <8fcc1aac-10c9-4507-8b78-8e5f03184930n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:56a:f8e3:d700:c5ea:ba51:41df:8fd0;
posting-account=1nOeKQkAAABD2jxp4Pzmx9Hx5g9miO8y
NNTP-Posting-Host: 2001:56a:f8e3:d700:c5ea:ba51:41df:8fd0
References: <sb1abl$ps8$1@dont-email.me> <cc7766bb-1433-45f4-9ba5-93c40bdab0f7n@googlegroups.com>
<sb553t$kta$1@dont-email.me> <sb5a40$o97$1@dont-email.me> <42b654db-a022-42f3-a6aa-94cd5a88de98n@googlegroups.com>
<53e78bb8-5c9c-481e-8cec-50a3febcbe95n@googlegroups.com> <sb75hs$7nq$1@dont-email.me>
<3050904a-eec2-4d47-ba5d-bfed1d774518n@googlegroups.com> <3d37be3c-e4fd-41b3-93f7-7037a3c19aefn@googlegroups.com>
<e5IBI.683979$ST2.397427@fx47.iad> <8b1baea3-a802-4341-8afd-d827e4eee948n@googlegroups.com>
<3b2b37a7-6168-42c0-a657-dcff23fa3e03n@googlegroups.com> <7ce8fca5-3a58-4e9a-92b4-595d0a743c57n@googlegroups.com>
<e2d01fcb-2cb1-4fb4-bf0e-b08d23ead140n@googlegroups.com> <jwvv95yhy1o.fsf-monnier+comp.arch@gnu.org>
<cd8707b1-0d4a-4ffe-8717-dd74f246c876n@googlegroups.com> <8fcc1aac-10c9-4507-8b78-8e5f03184930n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <680ceaf2-a4c1-4068-96d7-5c4bb580ad42n@googlegroups.com>
Subject: Re: Sequencer vs microcode
From: jsav...@ecn.ab.ca (Quadibloc)
Injection-Date: Wed, 30 Jun 2021 11:39:19 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Quadibloc - Wed, 30 Jun 2021 11:39 UTC

On Wednesday, June 30, 2021 at 2:26:30 AM UTC-6, Quadibloc wrote:

> Only bits 8 through 15 of the executed instruction could be modified. This was done
> through means of an OR operation. So the displacement in a memory-reference
> instruction couldn't be changed, nor could the opcode be changed.

On further reflection, that did not prevent the System/360's Execute instruction from
being used to assist in handling pseudo-instructions in a program. All that would have
been necessary would be to use it in reverse: that is, instead of executing the
pseudo-instruction itself, take the destination and index fields from it to modify an
instruction within the emulator that gets executed instead.

John Savard

Re: Sequencer vs microcode

<jwva6n7bg1h.fsf-monnier+comp.arch@gnu.org>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: monn...@iro.umontreal.ca (Stefan Monnier)
Newsgroups: comp.arch
Subject: Re: Sequencer vs microcode
Date: Wed, 30 Jun 2021 10:14:06 -0400
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <jwva6n7bg1h.fsf-monnier+comp.arch@gnu.org>
References: <sb1abl$ps8$1@dont-email.me>
<cc7766bb-1433-45f4-9ba5-93c40bdab0f7n@googlegroups.com>
<sb553t$kta$1@dont-email.me> <sb5a40$o97$1@dont-email.me>
<42b654db-a022-42f3-a6aa-94cd5a88de98n@googlegroups.com>
<53e78bb8-5c9c-481e-8cec-50a3febcbe95n@googlegroups.com>
<sb75hs$7nq$1@dont-email.me>
<3050904a-eec2-4d47-ba5d-bfed1d774518n@googlegroups.com>
<3d37be3c-e4fd-41b3-93f7-7037a3c19aefn@googlegroups.com>
<e5IBI.683979$ST2.397427@fx47.iad>
<8b1baea3-a802-4341-8afd-d827e4eee948n@googlegroups.com>
<3b2b37a7-6168-42c0-a657-dcff23fa3e03n@googlegroups.com>
<7ce8fca5-3a58-4e9a-92b4-595d0a743c57n@googlegroups.com>
<e2d01fcb-2cb1-4fb4-bf0e-b08d23ead140n@googlegroups.com>
<jwvv95yhy1o.fsf-monnier+comp.arch@gnu.org>
<cd8707b1-0d4a-4ffe-8717-dd74f246c876n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="48dc9934e6c6b6e6adbb2f03a0f875ee";
logging-data="21130"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+ZFvs82oHjwZDYza2pEsGh"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
Cancel-Lock: sha1:I8PO8voP4NcQbil/k/wvgF3jnIo=
sha1:oKGE2MDc1+6C/k03zkHMtXHDOFM=
 by: Stefan Monnier - Wed, 30 Jun 2021 14:14 UTC

Quadibloc [2021-06-29 22:12:55] wrote:
> On Monday, June 28, 2021 at 8:21:44 AM UTC-6, Stefan Monnier wrote:
>> As a compiler/proglang guy, the one thing that stumps me instead here is "why?".
>> Why would you want, or when/where would you need something like an
>> "exec" opcode? It seems to me like a "solution" in search of a problem.
> Well, the "execute" instruction used to be provided on very old architectures.
[...]
> So this way you don't have to chop the instruction up into bits and write a subroutine
> to decode it; you're using the computer's own built-in ability to decode instructions to
> do that work for you.

Thanks, that's a nice example. Clearly on modern CPUs, this kind of
twiddling is not very popular any more, but I can imagine it being still
done on minimalist embedded CPUs (tho even the cheapest of them seem to
be quickly moving to "mature" ISAs like ARM).

Stefan

Re: Sequencer vs microcode

<8129a2b5-59eb-4161-bad3-046737cfaea0n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:ad4:4666:: with SMTP id z6mr22101602qvv.60.1625064440873;
Wed, 30 Jun 2021 07:47:20 -0700 (PDT)
X-Received: by 2002:aca:57d3:: with SMTP id l202mr3305791oib.155.1625064440597;
Wed, 30 Jun 2021 07:47:20 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Wed, 30 Jun 2021 07:47:20 -0700 (PDT)
In-Reply-To: <jwva6n7bg1h.fsf-monnier+comp.arch@gnu.org>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:56a:f8e3:d700:a437:720c:452b:fa2b;
posting-account=1nOeKQkAAABD2jxp4Pzmx9Hx5g9miO8y
NNTP-Posting-Host: 2001:56a:f8e3:d700:a437:720c:452b:fa2b
References: <sb1abl$ps8$1@dont-email.me> <cc7766bb-1433-45f4-9ba5-93c40bdab0f7n@googlegroups.com>
<sb553t$kta$1@dont-email.me> <sb5a40$o97$1@dont-email.me> <42b654db-a022-42f3-a6aa-94cd5a88de98n@googlegroups.com>
<53e78bb8-5c9c-481e-8cec-50a3febcbe95n@googlegroups.com> <sb75hs$7nq$1@dont-email.me>
<3050904a-eec2-4d47-ba5d-bfed1d774518n@googlegroups.com> <3d37be3c-e4fd-41b3-93f7-7037a3c19aefn@googlegroups.com>
<e5IBI.683979$ST2.397427@fx47.iad> <8b1baea3-a802-4341-8afd-d827e4eee948n@googlegroups.com>
<3b2b37a7-6168-42c0-a657-dcff23fa3e03n@googlegroups.com> <7ce8fca5-3a58-4e9a-92b4-595d0a743c57n@googlegroups.com>
<e2d01fcb-2cb1-4fb4-bf0e-b08d23ead140n@googlegroups.com> <jwvv95yhy1o.fsf-monnier+comp.arch@gnu.org>
<cd8707b1-0d4a-4ffe-8717-dd74f246c876n@googlegroups.com> <jwva6n7bg1h.fsf-monnier+comp.arch@gnu.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8129a2b5-59eb-4161-bad3-046737cfaea0n@googlegroups.com>
Subject: Re: Sequencer vs microcode
From: jsav...@ecn.ab.ca (Quadibloc)
Injection-Date: Wed, 30 Jun 2021 14:47:20 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Quadibloc - Wed, 30 Jun 2021 14:47 UTC

On Wednesday, June 30, 2021 at 8:14:08 AM UTC-6, Stefan Monnier wrote:

> Thanks, that's a nice example. Clearly on modern CPUs, this kind of
> twiddling is not very popular any more, but I can imagine it being still
> done on minimalist embedded CPUs (tho even the cheapest of them seem to
> be quickly moving to "mature" ISAs like ARM).

Whenever a computer uses "millicode" - subroutines in a version of its own ISA - to
implement some instructions, some form of Execute instruction makes sense. As
that was true even on recent z Series mainframes from IBM, it's at least possible this
is a necessary thing to have on desktop-class processors.

After all, it's not enough for an ISA to just be Turing-complete. It's desired to be
efficient for the kind of tasks it will do. So another question that occurs to me is:
is it _ever_ going to be important to have the ability to address registers indirectly?
I suppose if one were implementing the load and store multiple instructions in
software or millicode.

It is obvious that a compiler wouldn't generate Execute instructions as a... consequence
of a combination of multiple operations within code to be compiled. That a single
operation within code might, however, be implemented by something including an
Execute instruction is a different issue.

So if a computer were "missing something" for a given language, that would be a
good case. Of course, though, a well-designed computer *won't* be missing something
needed to compile C or Fortran or COBOL, would it?

But what about LISP or SNOBOL?

I tended not to think that an Execute instruction is very relevant these days, but now that
I think of it, because of this discussion, it is possible that it does give a computer needed
flexibility - and in a cheap way. Or is that flexibility that's needed more by viruses than by
legitimate programs, making it a very good idea to drop the Execute instruction? Now I'm
wondering about this - in addition to thinking about it, though, I'll see if any research is out
there.

John Savard

Re: Sequencer vs microcode

<c4fd0b32-0e51-4e12-89c8-79e7b44e8697n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:622a:316:: with SMTP id q22mr31874440qtw.153.1625065266326;
Wed, 30 Jun 2021 08:01:06 -0700 (PDT)
X-Received: by 2002:a05:6808:14c8:: with SMTP id f8mr25800759oiw.7.1625065265962;
Wed, 30 Jun 2021 08:01:05 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Wed, 30 Jun 2021 08:01:05 -0700 (PDT)
In-Reply-To: <8fcc1aac-10c9-4507-8b78-8e5f03184930n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:f5f4:9dac:532a:1a43;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:f5f4:9dac:532a:1a43
References: <sb1abl$ps8$1@dont-email.me> <cc7766bb-1433-45f4-9ba5-93c40bdab0f7n@googlegroups.com>
<sb553t$kta$1@dont-email.me> <sb5a40$o97$1@dont-email.me> <42b654db-a022-42f3-a6aa-94cd5a88de98n@googlegroups.com>
<53e78bb8-5c9c-481e-8cec-50a3febcbe95n@googlegroups.com> <sb75hs$7nq$1@dont-email.me>
<3050904a-eec2-4d47-ba5d-bfed1d774518n@googlegroups.com> <3d37be3c-e4fd-41b3-93f7-7037a3c19aefn@googlegroups.com>
<e5IBI.683979$ST2.397427@fx47.iad> <8b1baea3-a802-4341-8afd-d827e4eee948n@googlegroups.com>
<3b2b37a7-6168-42c0-a657-dcff23fa3e03n@googlegroups.com> <7ce8fca5-3a58-4e9a-92b4-595d0a743c57n@googlegroups.com>
<e2d01fcb-2cb1-4fb4-bf0e-b08d23ead140n@googlegroups.com> <jwvv95yhy1o.fsf-monnier+comp.arch@gnu.org>
<cd8707b1-0d4a-4ffe-8717-dd74f246c876n@googlegroups.com> <8fcc1aac-10c9-4507-8b78-8e5f03184930n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c4fd0b32-0e51-4e12-89c8-79e7b44e8697n@googlegroups.com>
Subject: Re: Sequencer vs microcode
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Wed, 30 Jun 2021 15:01:06 +0000
Content-Type: text/plain; charset="UTF-8"
 by: MitchAlsup - Wed, 30 Jun 2021 15:01 UTC

On Wednesday, June 30, 2021 at 3:26:30 AM UTC-5, Quadibloc wrote:
> On Tuesday, June 29, 2021 at 11:12:57 PM UTC-6, Quadibloc wrote:
> > On Monday, June 28, 2021 at 8:21:44 AM UTC-6, Stefan Monnier wrote:
> >
> > > As a compiler/proglang guy, the one thing that stumps me instead here is "why?".
> > > Why would you want, or when/where would you need something like an
> > > "exec" opcode? It seems to me like a "solution" in search of a problem.
> >
> > Well, the "execute" instruction used to be provided on very old architectures.
> >
> > They were usually advanced enough to include an index register, though, so that
> > wasn't the problem they solved.
> >
> > Since they were old architectures, they didn't have the problem that memory
> > access was enormously slower than arithmetic.
> >
> > One possible use for an execute instruction:
> >
> > The architecture has "pseudo-ops". These have the form of a memory-reference
> > instruction (the machine is an accumulator to memory machine, so all the
> > arithmetic instructions have that form). Only the opcode is used.
> >
> > So if you were, say, implementing floating-point in software, you could use
> > a pseudo-op as an "add floating" instruction in this way:
> >
> > Have the "add floating" subroutine include two exec instructions, both of which
> > target the pseudo-op that invoked the subroutine. The floating-point number to be
> > added is the *operand* of the pseudo-op. The exec instructions modify the pseudo-op
> > to make it a load instruction, and one of them adds 1 to the address as well.
> >
> > So this way you don't have to chop the instruction up into bits and write a subroutine
> > to decode it; you're using the computer's own built-in ability to decode instructions to
> > do that work for you.
> So this explains why the Execute instruction was not only very useful, but even almost
> necessary, on computers like the SDS 930. (Having been in the same room as one at
> times, I can attest that this is a computer that actually existed.)
>
> Out of curiosity, I checked the Principles of Operation of the IBM System/360 to see
> if _it_ had an Execute instruction. It did. But it had limitations which meant that it
> could *not* be used the way the execute instruction on the SDS 930 could be used.
>
> Only bits 8 through 15 of the executed instruction could be modified. This was done
> through means of an OR operation. So the displacement in a memory-reference
> instruction couldn't be changed, nor could the opcode be changed. And, indeed, I
> doubt that the System/360's Execute instruction _was_ ever used much.
>
> But what was it _intended_ to be used for?
<
IBM 360 had the channel number as part of the I/O instructions.
But channel number was not known until execution begins.
Hense the EXC instruction.
But in this case the proper solution would have been to make a register contain
the channel identifier and dispense with the EXC.
<
> The things it _could_ modify were the source
> and destination registers of register-to-register instructions, or the destination and index
> registers of memory-to-register operations.
>
> So the thinking behind it was this: the System/360 had sixteen general registers. It was
> possible to write programs that looped to do something with successive locations in
> memory. It might be desired to loop through registers too, given that there are so many
> general registers provided. (To do so meant a memory access to get the executed
> instruction, but that was not so much of a concern in those days.)
>
> John Savard

Re: Sequencer vs microcode

<ae60a1f6-eaa0-499d-a464-305d3de41e14n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:622a:41:: with SMTP id y1mr605662qtw.360.1625065468205;
Wed, 30 Jun 2021 08:04:28 -0700 (PDT)
X-Received: by 2002:aca:af8d:: with SMTP id y135mr389029oie.110.1625065467727;
Wed, 30 Jun 2021 08:04:27 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Wed, 30 Jun 2021 08:04:27 -0700 (PDT)
In-Reply-To: <8129a2b5-59eb-4161-bad3-046737cfaea0n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:f5f4:9dac:532a:1a43;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:f5f4:9dac:532a:1a43
References: <sb1abl$ps8$1@dont-email.me> <cc7766bb-1433-45f4-9ba5-93c40bdab0f7n@googlegroups.com>
<sb553t$kta$1@dont-email.me> <sb5a40$o97$1@dont-email.me> <42b654db-a022-42f3-a6aa-94cd5a88de98n@googlegroups.com>
<53e78bb8-5c9c-481e-8cec-50a3febcbe95n@googlegroups.com> <sb75hs$7nq$1@dont-email.me>
<3050904a-eec2-4d47-ba5d-bfed1d774518n@googlegroups.com> <3d37be3c-e4fd-41b3-93f7-7037a3c19aefn@googlegroups.com>
<e5IBI.683979$ST2.397427@fx47.iad> <8b1baea3-a802-4341-8afd-d827e4eee948n@googlegroups.com>
<3b2b37a7-6168-42c0-a657-dcff23fa3e03n@googlegroups.com> <7ce8fca5-3a58-4e9a-92b4-595d0a743c57n@googlegroups.com>
<e2d01fcb-2cb1-4fb4-bf0e-b08d23ead140n@googlegroups.com> <jwvv95yhy1o.fsf-monnier+comp.arch@gnu.org>
<cd8707b1-0d4a-4ffe-8717-dd74f246c876n@googlegroups.com> <jwva6n7bg1h.fsf-monnier+comp.arch@gnu.org>
<8129a2b5-59eb-4161-bad3-046737cfaea0n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ae60a1f6-eaa0-499d-a464-305d3de41e14n@googlegroups.com>
Subject: Re: Sequencer vs microcode
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Wed, 30 Jun 2021 15:04:28 +0000
Content-Type: text/plain; charset="UTF-8"
 by: MitchAlsup - Wed, 30 Jun 2021 15:04 UTC

On Wednesday, June 30, 2021 at 9:47:21 AM UTC-5, Quadibloc wrote:
> On Wednesday, June 30, 2021 at 8:14:08 AM UTC-6, Stefan Monnier wrote:
>
> > Thanks, that's a nice example. Clearly on modern CPUs, this kind of
> > twiddling is not very popular any more, but I can imagine it being still
> > done on minimalist embedded CPUs (tho even the cheapest of them seem to
> > be quickly moving to "mature" ISAs like ARM).
> Whenever a computer uses "millicode" - subroutines in a version of its own ISA - to
> implement some instructions, some form of Execute instruction makes sense. As
> that was true even on recent z Series mainframes from IBM, it's at least possible this
> is a necessary thing to have on desktop-class processors.
>
> After all, it's not enough for an ISA to just be Turing-complete. It's desired to be
> efficient for the kind of tasks it will do. So another question that occurs to me is:
> is it _ever_ going to be important to have the ability to address registers indirectly?
<
This goes into the YECH category. You are making DECODE dependent on the forwarding
stage that occurs after DECODE.
<
> I suppose if one were implementing the load and store multiple instructions in
> software or millicode.
>
> It is obvious that a compiler wouldn't generate Execute instructions as a... consequence
> of a combination of multiple operations within code to be compiled. That a single
> operation within code might, however, be implemented by something including an
> Execute instruction is a different issue.
>
> So if a computer were "missing something" for a given language, that would be a
> good case. Of course, though, a well-designed computer *won't* be missing something
> needed to compile C or Fortran or COBOL, would it?
>
> But what about LISP or SNOBOL?
<
They represent 0.0001% of codes running today.
>
> I tended not to think that an Execute instruction is very relevant these days, but now that
> I think of it, because of this discussion, it is possible that it does give a computer needed
> flexibility - and in a cheap way. Or is that flexibility that's needed more by viruses than by
> legitimate programs, making it a very good idea to drop the Execute instruction? Now I'm
> wondering about this - in addition to thinking about it, though, I'll see if any research is out
> there.
>
> John Savard

Re: Sequencer vs microcode

<jwvh7hf9y35.fsf-monnier+comp.arch@gnu.org>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: monn...@iro.umontreal.ca (Stefan Monnier)
Newsgroups: comp.arch
Subject: Re: Sequencer vs microcode
Date: Wed, 30 Jun 2021 11:37:26 -0400
Organization: A noiseless patient Spider
Lines: 38
Message-ID: <jwvh7hf9y35.fsf-monnier+comp.arch@gnu.org>
References: <sb1abl$ps8$1@dont-email.me>
<cc7766bb-1433-45f4-9ba5-93c40bdab0f7n@googlegroups.com>
<sb553t$kta$1@dont-email.me> <sb5a40$o97$1@dont-email.me>
<42b654db-a022-42f3-a6aa-94cd5a88de98n@googlegroups.com>
<53e78bb8-5c9c-481e-8cec-50a3febcbe95n@googlegroups.com>
<sb75hs$7nq$1@dont-email.me>
<3050904a-eec2-4d47-ba5d-bfed1d774518n@googlegroups.com>
<3d37be3c-e4fd-41b3-93f7-7037a3c19aefn@googlegroups.com>
<e5IBI.683979$ST2.397427@fx47.iad>
<8b1baea3-a802-4341-8afd-d827e4eee948n@googlegroups.com>
<3b2b37a7-6168-42c0-a657-dcff23fa3e03n@googlegroups.com>
<7ce8fca5-3a58-4e9a-92b4-595d0a743c57n@googlegroups.com>
<e2d01fcb-2cb1-4fb4-bf0e-b08d23ead140n@googlegroups.com>
<jwvv95yhy1o.fsf-monnier+comp.arch@gnu.org>
<cd8707b1-0d4a-4ffe-8717-dd74f246c876n@googlegroups.com>
<jwva6n7bg1h.fsf-monnier+comp.arch@gnu.org>
<8129a2b5-59eb-4161-bad3-046737cfaea0n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="48dc9934e6c6b6e6adbb2f03a0f875ee";
logging-data="25944"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18tzGtJy/uLeFsyHkZOIeG/"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
Cancel-Lock: sha1:y/8pNQlnmY+Pg7+DenjKlfJNpCo=
sha1:vSmm/t4b8QUOZ+nRL3iuUWW4TiA=
 by: Stefan Monnier - Wed, 30 Jun 2021 15:37 UTC

> Whenever a computer uses "millicode" - subroutines in a version of its
> own ISA - to implement some instructions, some form of Execute
> instruction makes sense. As that was true even on recent z Series
> mainframes from IBM, it's at least possible this is a necessary thing
> to have on desktop-class processors.

There's been various forms of "millicode" in the last 30 years but
AFAICT none of them reached for EXEC, so I doubt this is true.

> After all, it's not enough for an ISA to just be Turing-complete. It's
> desired to be efficient for the kind of tasks it will do. So another
> question that occurs to me is: is it _ever_ going to be important to
> have the ability to address registers indirectly?

I think it's the kind of feature that would cost more than its benefit.
The whole reason why registers are faster is because you can't address
them indirectly.

This said, you actually can address them indirectly. For a 32-register
machine, the indirect access just costs a 32-way dense switch :-)

> But what about LISP or SNOBOL?

I doubt Snobol is taken into account when designing CPUs nowadays, but
I'd definitely expect that Lisp-like runtimes are among the things that
I'd expect a CPU designer to take into account, yes.
Those needs are still very much alive in more "current" languages like
Javascript, PHP, Haskell, ...

> I tended not to think that an Execute instruction is very relevant
> these days, but now that I think of it, because of this discussion, it
> is possible that it does give a computer needed flexibility - and in
> a cheap way.

AFAICT it's only cheap for non-pipelined CPUs.

Stefan

Re: Sequencer vs microcode

<sbi47c$dsc$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: sfu...@alumni.cmu.edu.invalid (Stephen Fuld)
Newsgroups: comp.arch
Subject: Re: Sequencer vs microcode
Date: Wed, 30 Jun 2021 08:56:26 -0700
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <sbi47c$dsc$1@dont-email.me>
References: <sb1abl$ps8$1@dont-email.me>
<cc7766bb-1433-45f4-9ba5-93c40bdab0f7n@googlegroups.com>
<sb553t$kta$1@dont-email.me> <sb5a40$o97$1@dont-email.me>
<42b654db-a022-42f3-a6aa-94cd5a88de98n@googlegroups.com>
<53e78bb8-5c9c-481e-8cec-50a3febcbe95n@googlegroups.com>
<sb75hs$7nq$1@dont-email.me>
<3050904a-eec2-4d47-ba5d-bfed1d774518n@googlegroups.com>
<3d37be3c-e4fd-41b3-93f7-7037a3c19aefn@googlegroups.com>
<e5IBI.683979$ST2.397427@fx47.iad>
<8b1baea3-a802-4341-8afd-d827e4eee948n@googlegroups.com>
<3b2b37a7-6168-42c0-a657-dcff23fa3e03n@googlegroups.com>
<7ce8fca5-3a58-4e9a-92b4-595d0a743c57n@googlegroups.com>
<e2d01fcb-2cb1-4fb4-bf0e-b08d23ead140n@googlegroups.com>
<jwvv95yhy1o.fsf-monnier+comp.arch@gnu.org>
<cd8707b1-0d4a-4ffe-8717-dd74f246c876n@googlegroups.com>
<8fcc1aac-10c9-4507-8b78-8e5f03184930n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 30 Jun 2021 15:56:28 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="a54fe97477290a2de04a7c9e7ac75e6a";
logging-data="14220"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+t0XawqUREHVy4b6SG7oTtpnEB0CGqSrg="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:OyjQnNwbRQj+ndjl4P4Ovlm9U4M=
In-Reply-To: <8fcc1aac-10c9-4507-8b78-8e5f03184930n@googlegroups.com>
Content-Language: en-US
 by: Stephen Fuld - Wed, 30 Jun 2021 15:56 UTC

On 6/30/2021 1:26 AM, Quadibloc wrote:

snip

> Out of curiosity, I checked the Principles of Operation of the IBM System/360 to see
> if _it_ had an Execute instruction. It did. But it had limitations which meant that it
> could *not* be used the way the execute instruction on the SDS 930 could be used.
>
> Only bits 8 through 15 of the executed instruction could be modified. This was done
> through means of an OR operation. So the displacement in a memory-reference
> instruction couldn't be changed, nor could the opcode be changed. And, indeed, I
> doubt that the System/360's Execute instruction _was_ ever used much.
>
> But what was it _intended_ to be used for?

See

http://faculty.cs.niu.edu/~byrnes/csci360/notes/360ex.htm

Scroll down for some usage examples.

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

Re: EX instructon, Sequencer vs microcode

<sbi9pk$e5j$1@gal.iecc.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!xmission!usenet.csail.mit.edu!news.iecc.com!.POSTED.news.iecc.com!not-for-mail
From: joh...@taugh.com (John Levine)
Newsgroups: comp.arch
Subject: Re: EX instructon, Sequencer vs microcode
Date: Wed, 30 Jun 2021 17:31:32 -0000 (UTC)
Organization: Taughannock Networks
Message-ID: <sbi9pk$e5j$1@gal.iecc.com>
References: <sb1abl$ps8$1@dont-email.me> <cd8707b1-0d4a-4ffe-8717-dd74f246c876n@googlegroups.com> <8fcc1aac-10c9-4507-8b78-8e5f03184930n@googlegroups.com> <c4fd0b32-0e51-4e12-89c8-79e7b44e8697n@googlegroups.com>
Injection-Date: Wed, 30 Jun 2021 17:31:32 -0000 (UTC)
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970";
logging-data="14515"; mail-complaints-to="abuse@iecc.com"
In-Reply-To: <sb1abl$ps8$1@dont-email.me> <cd8707b1-0d4a-4ffe-8717-dd74f246c876n@googlegroups.com> <8fcc1aac-10c9-4507-8b78-8e5f03184930n@googlegroups.com> <c4fd0b32-0e51-4e12-89c8-79e7b44e8697n@googlegroups.com>
Cleverness: some
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: johnl@iecc.com (John Levine)
 by: John Levine - Wed, 30 Jun 2021 17:31 UTC

According to MitchAlsup <MitchAlsup@aol.com>:
>> But what was it _intended_ to be used for?
><
>IBM 360 had the channel number as part of the I/O instructions.

No, the I/O instructions all had a base+displacement argument for the
I/O address. If you knew the device address you could put it in the
displacement and use a zero base register, otherwise you put the
address in the register. The second byte of the instruction was part
of the opcode and it's hard to imagine a reason to change it on the
fly. (Don't argue, I have an actual paper S/370 POO here.)

EX was often used to make variable length string instructions like MVC
and CLC. If you wanted to handle variable length data, that's how you
did it.

It might have been useful for SI instructions where the second byte was the
immediate operand, e.g., EX a CLI to compare the low byte of a register with
a byte in memory, but I never saw anyone do that.

>> The things it _could_ modify were the source
>> and destination registers of register-to-register instructions, or the destination and index
>> registers of memory-to-register operations.

It could, but I never saw a non-contrived use of that. It was alwys the length code in SS instructions.

>> So the thinking behind it was this: the System/360 had sixteen general registers. It was
>> possible to write programs that looped to do something with successive locations in
>> memory. It might be desired to loop through registers too, given that there are so many
>> general registers provided. (To do so meant a memory access to get the executed
>> instruction, but that was not so much of a concern in those days.)

In theory I suppose, but I never saw anyone do that.

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

Re: Exec

<2021Jun30.190231@mips.complang.tuwien.ac.at>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ant...@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.arch
Subject: Re: Exec
Date: Wed, 30 Jun 2021 17:02:31 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 82
Message-ID: <2021Jun30.190231@mips.complang.tuwien.ac.at>
References: <sb1abl$ps8$1@dont-email.me> <sbd1tr$jfl$1@dont-email.me> <jwvy2ath6c3.fsf-monnier+comp.arch@gnu.org> <sbeig1$o01$1@dont-email.me> <18641964-95f3-426a-a318-470ef6cfcd47n@googlegroups.com> <2021Jun29.162615@mips.complang.tuwien.ac.at> <jwv1r8khepo.fsf-monnier+comp.arch@gnu.org> <2021Jun29.192608@mips.complang.tuwien.ac.at> <42430dc6-1410-440b-8009-b47e15b5541cn@googlegroups.com> <5af46c01-8fb8-4526-a4af-52fa714c5e60n@googlegroups.com> <jwvbl7ofih6.fsf-monnier+comp.arch@gnu.org>
Injection-Info: reader02.eternal-september.org; posting-host="1b9e8b2bbbdc17f5066d3066d862c9ac";
logging-data="30195"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+y/wpXHNUKItOPJTnTXQh+"
Cancel-Lock: sha1:mpT57Iu2Urs8KBq1iXA7qU911vQ=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Wed, 30 Jun 2021 17:02 UTC

Stefan Monnier <monnier@iro.umontreal.ca> writes:
>[ Note: the EXEC instruction in Forth has the same name but is a quite
> different beast. Since it takes an instruction *name* as argument,
> which corresponds conceptually to an address rather than an actual
> machine-language instruction.

The EXECUTE word has a different name, but is very much the same thing
in a threaded-code Forth as an EXEC instruction is in machine (macro-)
code. You cannot just EXECUTE colon definitions (the Forth equivalent
of a function/procedure), but you can also EXECUTE a primitive, the
equivalent of an instruction.

In a classic indirect-threaded implementation, EXECUTE takes the
code-field address as argument, which, on the machine level is an
address, but it is not the address where some threaded code starts, so
that address would not work as argument for the CALL primitive in
Gforth.

> It naturally maps to "JAL reg" rather
> than an EXEC instruction when you generate machine-language code. ]

EXECUTE performs no JAL, CALL or anything like it in a
threaded-code system. Here's EXECUTE in gforth-fast (not quite
classical, but close enough for the discussion here) for Aarch64:

Code execute
555558265C: mov x3, x27 # code field address to execute
5555582660: mov x0, x25 # stack pointer
5555582664: add x25, x25, #8 # stack pointer update
5555582668: ld x1, [x3,#0] # load code address from code field
555558266C: ld x27, [x0,#8] # load new top-of-stack
5555582670: br x1 # branch to code address
end-code

So, no call (the Aarch64 equivalent of JALR) here.

And here's an ordinary primitive

Code 1+
5555582FD8: add x26, x26, #8 # update threaded-code instruction ptr
5555582FDC: add x27, x27, #1 # add 1 to top-of-stack
5555582FE0: ldur x1, [x26,#-8] # load code address of next word
5555582FE4: br x1 # branch to code address
end-code

So if you have a colon definition like

: bar
execute swap ;

It's threaded code (in gforth-fast) looks like this:

simple-see bar
$7FB740D280 execute
$7FB740D288 swap
$7FB740D290 ;s ok

When I invoke BAR with

1 2 ' 1+ bar cr . .
\ output: "1 3"

the execution token of 1+ is $7FB7397AE8; and at that address you find

7FB7397AE8: D8 2F 58 55 55 00 00 00 - ./XUU...

the entry address of 1+. When calling BAR, first a dispatch to the
code of EXECUTE happens. At that point, the threaded-code instruction
pointer is at $7FB740D288 when EXECUTE is started (it always points to
the next word), but this does not play a role while EXECUTE is
running. EXECUTE itself loads the code address of 1+ ($5555582FD8)
and jumps there. This executes 1+, and 1+ performs a regular dispatch
of the next primitive (SWAP): it increments the instruction pointer to
point to $7FB740D290, loads the code address of SWAP from the old
instruction pointer $7FB740D288, and jumps there. So, as you can see,
control passes from EXECUTE through 1+ to SWAP without any call (JAL)
involved, just like the EXEC instruction does not involve a call.

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

Re: Sequencer vs microcode

<337e688b-f7bf-4461-9b97-95d4c625aee6n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a37:9e46:: with SMTP id h67mr33762718qke.439.1625077523232; Wed, 30 Jun 2021 11:25:23 -0700 (PDT)
X-Received: by 2002:aca:af8d:: with SMTP id y135mr1110924oie.110.1625077523000; Wed, 30 Jun 2021 11:25:23 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!feeder1.feed.usenet.farm!feed.usenet.farm!tr1.eu1.usenetexpress.com!feeder.usenetexpress.com!tr1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Wed, 30 Jun 2021 11:25:22 -0700 (PDT)
In-Reply-To: <sbi47c$dsc$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:56a:f8e3:d700:e52f:529a:8ca3:a9ec; posting-account=1nOeKQkAAABD2jxp4Pzmx9Hx5g9miO8y
NNTP-Posting-Host: 2001:56a:f8e3:d700:e52f:529a:8ca3:a9ec
References: <sb1abl$ps8$1@dont-email.me> <cc7766bb-1433-45f4-9ba5-93c40bdab0f7n@googlegroups.com> <sb553t$kta$1@dont-email.me> <sb5a40$o97$1@dont-email.me> <42b654db-a022-42f3-a6aa-94cd5a88de98n@googlegroups.com> <53e78bb8-5c9c-481e-8cec-50a3febcbe95n@googlegroups.com> <sb75hs$7nq$1@dont-email.me> <3050904a-eec2-4d47-ba5d-bfed1d774518n@googlegroups.com> <3d37be3c-e4fd-41b3-93f7-7037a3c19aefn@googlegroups.com> <e5IBI.683979$ST2.397427@fx47.iad> <8b1baea3-a802-4341-8afd-d827e4eee948n@googlegroups.com> <3b2b37a7-6168-42c0-a657-dcff23fa3e03n@googlegroups.com> <7ce8fca5-3a58-4e9a-92b4-595d0a743c57n@googlegroups.com> <e2d01fcb-2cb1-4fb4-bf0e-b08d23ead140n@googlegroups.com> <jwvv95yhy1o.fsf-monnier+comp.arch@gnu.org> <cd8707b1-0d4a-4ffe-8717-dd74f246c876n@googlegroups.com> <8fcc1aac-10c9-4507-8b78-8e5f03184930n@googlegroups.com> <sbi47c$dsc$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <337e688b-f7bf-4461-9b97-95d4c625aee6n@googlegroups.com>
Subject: Re: Sequencer vs microcode
From: jsav...@ecn.ab.ca (Quadibloc)
Injection-Date: Wed, 30 Jun 2021 18:25:23 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 15
 by: Quadibloc - Wed, 30 Jun 2021 18:25 UTC

On Wednesday, June 30, 2021 at 9:56:30 AM UTC-6, Stephen Fuld wrote:

> See
>
> http://faculty.cs.niu.edu/~byrnes/csci360/notes/360ex.htm

I see that the description there of what the instruction does is not
quite correct. It says that eight bits of the instruction at the destination
are replaced, when in fact an OR operation is performed - according to
the PoO, which I happened to have been looking at to see if the 360
had one.

In any case, the example is for changing the length of a string, just
as someone noted.

John Savard

Re: Exec

<jwvk0mb8adx.fsf-monnier+comp.arch@gnu.org>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: monn...@iro.umontreal.ca (Stefan Monnier)
Newsgroups: comp.arch
Subject: Re: Exec
Date: Wed, 30 Jun 2021 14:52:03 -0400
Organization: A noiseless patient Spider
Lines: 40
Message-ID: <jwvk0mb8adx.fsf-monnier+comp.arch@gnu.org>
References: <sb1abl$ps8$1@dont-email.me> <sbd1tr$jfl$1@dont-email.me>
<jwvy2ath6c3.fsf-monnier+comp.arch@gnu.org>
<sbeig1$o01$1@dont-email.me>
<18641964-95f3-426a-a318-470ef6cfcd47n@googlegroups.com>
<2021Jun29.162615@mips.complang.tuwien.ac.at>
<jwv1r8khepo.fsf-monnier+comp.arch@gnu.org>
<2021Jun29.192608@mips.complang.tuwien.ac.at>
<42430dc6-1410-440b-8009-b47e15b5541cn@googlegroups.com>
<5af46c01-8fb8-4526-a4af-52fa714c5e60n@googlegroups.com>
<jwvbl7ofih6.fsf-monnier+comp.arch@gnu.org>
<2021Jun30.190231@mips.complang.tuwien.ac.at>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="48dc9934e6c6b6e6adbb2f03a0f875ee";
logging-data="14488"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18sybmE9pJzb3wMK9n2yvhi"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
Cancel-Lock: sha1:30o5x28jaIAbfcOyaVW2iM11DeY=
sha1:AwcZ51RaHtRkXmSbp18kP+y3DMQ=
 by: Stefan Monnier - Wed, 30 Jun 2021 18:52 UTC

Anton Ertl [2021-06-30 17:02:31] wrote:
> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>>[ Note: the EXEC instruction in Forth has the same name but is a quite
>> different beast. Since it takes an instruction *name* as argument,
>> which corresponds conceptually to an address rather than an actual
>> machine-language instruction.
> The EXECUTE word has a different name, but is very much the same thing
> in a threaded-code Forth as an EXEC instruction is in machine (macro-)
> code.

That might be true for Forth-style machine language, but "traditional"
machine language uses instructions with internal structure (things like
opcode + register numbers + disp), which makes it quite different from
just a "name of an instruction". To take a simple example, there are
2^32 different instructions in a typical RISC which makes it impractical
(or even impossible on 32bit systems) to implement something like EXEC
via a table lookup or by equating the instruction with a pointer,
whereas those are the two typical ways to handle EXECUTE in Forth.

>> It naturally maps to "JAL reg" rather
>> than an EXEC instruction when you generate machine-language code. ]
>
> EXECUTE performs no JAL, CALL or anything like it in a
> threaded-code system. Here's EXECUTE in gforth-fast (not quite
> classical, but close enough for the discussion here) for Aarch64:
>
> Code execute
> 555558265C: mov x3, x27 # code field address to execute
> 5555582660: mov x0, x25 # stack pointer
> 5555582664: add x25, x25, #8 # stack pointer update
> 5555582668: ld x1, [x3,#0] # load code address from code field
> 555558266C: ld x27, [x0,#8] # load new top-of-stack
> 5555582670: br x1 # branch to code address
> end-code

Indeed you don't need the "and link" part because the call is at the end
so it can be strength-reduced to `br` by tail-call optimization.

Stefan

Re: Execute, not Sequencer vs microcode

<sbj2k6$crm$1@gal.iecc.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!xmission!usenet.csail.mit.edu!news.iecc.com!.POSTED.news.iecc.com!not-for-mail
From: joh...@taugh.com (John Levine)
Newsgroups: comp.arch
Subject: Re: Execute, not Sequencer vs microcode
Date: Thu, 1 Jul 2021 00:35:18 -0000 (UTC)
Organization: Taughannock Networks
Message-ID: <sbj2k6$crm$1@gal.iecc.com>
References: <sb1abl$ps8$1@dont-email.me> <cd8707b1-0d4a-4ffe-8717-dd74f246c876n@googlegroups.com> <8fcc1aac-10c9-4507-8b78-8e5f03184930n@googlegroups.com> <sbi47c$dsc$1@dont-email.me>
Injection-Date: Thu, 1 Jul 2021 00:35:18 -0000 (UTC)
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970";
logging-data="13174"; mail-complaints-to="abuse@iecc.com"
In-Reply-To: <sb1abl$ps8$1@dont-email.me> <cd8707b1-0d4a-4ffe-8717-dd74f246c876n@googlegroups.com> <8fcc1aac-10c9-4507-8b78-8e5f03184930n@googlegroups.com> <sbi47c$dsc$1@dont-email.me>
Cleverness: some
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: johnl@iecc.com (John Levine)
 by: John Levine - Thu, 1 Jul 2021 00:35 UTC

According to Stephen Fuld <sfuld@alumni.cmu.edu.invalid>:
>> Only bits 8 through 15 of the executed instruction could be modified. This was done
>> through means of an OR operation. So the displacement in a memory-reference
>> instruction couldn't be changed, nor could the opcode be changed. And, indeed, I
>> doubt that the System/360's Execute instruction _was_ ever used much.
>>
>> But what was it _intended_ to be used for?
>
>See
>
>http://faculty.cs.niu.edu/~byrnes/csci360/notes/360ex.htm

See the IBM Principles of Opearation:

http://bitsavers.org/pdf/ibm/360/princOps/A22-6821-7_360PrincOpsDec67.pdf

There's a slightly contrived EX example on pages 128-129.

The 370/XA POO has a more realistic variable length move example on pages A-18 and -19.

http://bitsavers.org/pdf/ibm/370/princOps/SA22-7085-1_370-XA_Principles_of_Operation_Jan87.pdf

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

Re: Execute, not Sequencer vs microcode

<1cc26b60-c6c7-4631-95c6-04954efc7218n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:620a:a18:: with SMTP id i24mr4304014qka.151.1625104249526;
Wed, 30 Jun 2021 18:50:49 -0700 (PDT)
X-Received: by 2002:a9d:7cd1:: with SMTP id r17mr10946001otn.110.1625104249313;
Wed, 30 Jun 2021 18:50:49 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Wed, 30 Jun 2021 18:50:49 -0700 (PDT)
In-Reply-To: <sbj2k6$crm$1@gal.iecc.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:e858:57c1:8d44:a54;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:e858:57c1:8d44:a54
References: <sb1abl$ps8$1@dont-email.me> <cd8707b1-0d4a-4ffe-8717-dd74f246c876n@googlegroups.com>
<8fcc1aac-10c9-4507-8b78-8e5f03184930n@googlegroups.com> <sbi47c$dsc$1@dont-email.me>
<sbj2k6$crm$1@gal.iecc.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1cc26b60-c6c7-4631-95c6-04954efc7218n@googlegroups.com>
Subject: Re: Execute, not Sequencer vs microcode
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Thu, 01 Jul 2021 01:50:49 +0000
Content-Type: text/plain; charset="UTF-8"
 by: MitchAlsup - Thu, 1 Jul 2021 01:50 UTC

On Wednesday, June 30, 2021 at 7:35:21 PM UTC-5, John Levine wrote:
> According to Stephen Fuld <sf...@alumni.cmu.edu.invalid>:
> >> Only bits 8 through 15 of the executed instruction could be modified. This was done
> >> through means of an OR operation. So the displacement in a memory-reference
> >> instruction couldn't be changed, nor could the opcode be changed. And, indeed, I
> >> doubt that the System/360's Execute instruction _was_ ever used much.
> >>
> >> But what was it _intended_ to be used for?
> >
> >See
> >
> >http://faculty.cs.niu.edu/~byrnes/csci360/notes/360ex.htm
> See the IBM Principles of Opearation:
>
> http://bitsavers.org/pdf/ibm/360/princOps/A22-6821-7_360PrincOpsDec67.pdf
>
> There's a slightly contrived EX example on pages 128-129.
>
> The 370/XA POO has a more realistic variable length move example on pages A-18 and -19.
>
> http://bitsavers.org/pdf/ibm/370/princOps/SA22-7085-1_370-XA_Principles_of_Operation_Jan87.pdf
<
In any event, these show that the instruction set was misconceived (at least originally)
and that if properly conceived EXC would not have been necessary.
<

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

Re: Execute, not Sequencer vs microcode

<c8255b65-e838-4223-bbd9-e212742d63ben@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:ac8:7f87:: with SMTP id z7mr7942704qtj.238.1625107234185;
Wed, 30 Jun 2021 19:40:34 -0700 (PDT)
X-Received: by 2002:a05:6808:d54:: with SMTP id w20mr5638223oik.175.1625107233930;
Wed, 30 Jun 2021 19:40:33 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!news.mixmin.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Wed, 30 Jun 2021 19:40:33 -0700 (PDT)
In-Reply-To: <1cc26b60-c6c7-4631-95c6-04954efc7218n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:56a:f8e3:d700:9456:b17d:6d1d:843f;
posting-account=1nOeKQkAAABD2jxp4Pzmx9Hx5g9miO8y
NNTP-Posting-Host: 2001:56a:f8e3:d700:9456:b17d:6d1d:843f
References: <sb1abl$ps8$1@dont-email.me> <cd8707b1-0d4a-4ffe-8717-dd74f246c876n@googlegroups.com>
<8fcc1aac-10c9-4507-8b78-8e5f03184930n@googlegroups.com> <sbi47c$dsc$1@dont-email.me>
<sbj2k6$crm$1@gal.iecc.com> <1cc26b60-c6c7-4631-95c6-04954efc7218n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c8255b65-e838-4223-bbd9-e212742d63ben@googlegroups.com>
Subject: Re: Execute, not Sequencer vs microcode
From: jsav...@ecn.ab.ca (Quadibloc)
Injection-Date: Thu, 01 Jul 2021 02:40:34 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Quadibloc - Thu, 1 Jul 2021 02:40 UTC

On Wednesday, June 30, 2021 at 7:50:50 PM UTC-6, MitchAlsup wrote:

> In any event, these show that the instruction set was misconceived (at least originally)
> and that if properly conceived EXC would not have been necessary.

Although the most common use of the Execute instruction by ordinary programmers
was to change the length of string operations, I don't think that's what it was intended
for.
I think they did put it in to have a way of making it easier to write routines that serviced
an unimplemented opcode exception by causing the bad instruction to do something
useful, thus extending the instruction set... despite its limitations, which mean that
doing this isn't quite as straightforward as on other architectures.
Also, the fact that the instruction set left some possibilities out doesn't necessarily
mean it was misconcieved. The string instructions were expected to be used for
programs doing stuff like you would do in RPG - or on plugboard tab equipment.
So there would be no need for variable length strings... after all, did anybody use
a work-around to get variable length strings on the 1401?
Because an Execute instruction lets you mess with fields inside an instruction,
it potentially opens up a _vast_ new field of flexibility. Without having to be
naughty and use self-modifying code.
Although even I have my doubts as to whether the _kind_ of flexibility it provides
will really be useful very often.

John Savard

Re: Sequencer vs microcode

<sbjpng$b5l$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: m.del...@this.bitsnbites.eu (Marcus)
Newsgroups: comp.arch
Subject: Re: Sequencer vs microcode
Date: Thu, 1 Jul 2021 09:09:35 +0200
Organization: A noiseless patient Spider
Lines: 37
Message-ID: <sbjpng$b5l$1@dont-email.me>
References: <sb1abl$ps8$1@dont-email.me>
<cc7766bb-1433-45f4-9ba5-93c40bdab0f7n@googlegroups.com>
<sb553t$kta$1@dont-email.me> <sb5a40$o97$1@dont-email.me>
<42b654db-a022-42f3-a6aa-94cd5a88de98n@googlegroups.com>
<53e78bb8-5c9c-481e-8cec-50a3febcbe95n@googlegroups.com>
<sb75hs$7nq$1@dont-email.me>
<3050904a-eec2-4d47-ba5d-bfed1d774518n@googlegroups.com>
<3d37be3c-e4fd-41b3-93f7-7037a3c19aefn@googlegroups.com>
<e5IBI.683979$ST2.397427@fx47.iad>
<8b1baea3-a802-4341-8afd-d827e4eee948n@googlegroups.com>
<3b2b37a7-6168-42c0-a657-dcff23fa3e03n@googlegroups.com>
<7ce8fca5-3a58-4e9a-92b4-595d0a743c57n@googlegroups.com>
<e2d01fcb-2cb1-4fb4-bf0e-b08d23ead140n@googlegroups.com>
<jwvv95yhy1o.fsf-monnier+comp.arch@gnu.org>
<cd8707b1-0d4a-4ffe-8717-dd74f246c876n@googlegroups.com>
<jwva6n7bg1h.fsf-monnier+comp.arch@gnu.org>
<8129a2b5-59eb-4161-bad3-046737cfaea0n@googlegroups.com>
<ae60a1f6-eaa0-499d-a464-305d3de41e14n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 1 Jul 2021 07:09:36 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="2ddc155e91461d5454be722e81a0b8a7";
logging-data="11445"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/knBnZsPorY1JODv7d63jwOMZDnUFsV4g="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:C+DSI7dAjkMTaX/9XIPWTA5NxdU=
In-Reply-To: <ae60a1f6-eaa0-499d-a464-305d3de41e14n@googlegroups.com>
Content-Language: en-US
 by: Marcus - Thu, 1 Jul 2021 07:09 UTC

On 2021-06-30, MitchAlsup wrote:
> On Wednesday, June 30, 2021 at 9:47:21 AM UTC-5, Quadibloc wrote:
>> On Wednesday, June 30, 2021 at 8:14:08 AM UTC-6, Stefan Monnier wrote:
>>
>>> Thanks, that's a nice example. Clearly on modern CPUs, this kind of
>>> twiddling is not very popular any more, but I can imagine it being still
>>> done on minimalist embedded CPUs (tho even the cheapest of them seem to
>>> be quickly moving to "mature" ISAs like ARM).
>> Whenever a computer uses "millicode" - subroutines in a version of its own ISA - to
>> implement some instructions, some form of Execute instruction makes sense. As
>> that was true even on recent z Series mainframes from IBM, it's at least possible this
>> is a necessary thing to have on desktop-class processors.
>>
>> After all, it's not enough for an ISA to just be Turing-complete. It's desired to be
>> efficient for the kind of tasks it will do. So another question that occurs to me is:
>> is it _ever_ going to be important to have the ability to address registers indirectly?
> <
> This goes into the YECH category. You are making DECODE dependent on the forwarding
> stage that occurs after DECODE.
> <

That's my feeling exactly. I do not have much experience with CPU
design, but one of the things that I've learned from designing a
pipelined CPU is that different parts of the pipeline have access to
different pieces of information / state, and one clear separation is
instruction information (roughly up to and including DECODE) vs
data information (from REGISTER READ / OPERAND FORWARDING onward).

An EXEC instruction would require you to violate that separation, which
complicates the design. It's one of those things that /can/ be done, but
it's really hard to motivate the extra cost (hardware, testing, security
issues, etc) since the use cases would be very few - and even for the
cases where it could be a useful feature, the performance benefits over
just doing a regular register indirect call are probably only marginal
at best.

/Marcus

Pages:1234567
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor