Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

Life is NP-hard, and then you die. -- Dave Cock


devel / comp.arch / Re: Centrifuge instruction

SubjectAuthor
* Re: Centrifuge instructionThomas Koenig
+* Re: Centrifuge instructionQuadibloc
|+- Re: Centrifuge instructionThomas Koenig
|+* Re: Centrifuge instructionEricP
||+* Re: Centrifuge instructionScott Lurndal
|||`- Re: Centrifuge instructionEricP
||`* Re: Centrifuge instructionThomas Koenig
|| `* Re: Centrifuge instructionMitchAlsup
||  +- Re: Centrifuge instructionEricP
||  `* Re: Centrifuge instructionThomas Koenig
||   `- Re: Centrifuge instructionMitchAlsup
|`- Re: Centrifuge instructionStephen Fuld
+- Re: Centrifuge instructionQuadibloc
+- Re: Centrifuge instructionQuadibloc
+* Re: Centrifuge instructionMitchAlsup
|`- Re: Centrifuge instructionEricP
+- Re: Centrifuge instructionQuadibloc
`- Re: Centrifuge instructionThomas Koenig

1
Re: Centrifuge instruction

<u3vhen$1hkjj$1@newsreader4.netcologne.de>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2a0a-a540-2152-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoenig@netcologne.de (Thomas Koenig)
Newsgroups: comp.arch
Subject: Re: Centrifuge instruction
Date: Tue, 16 May 2023 09:12:55 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <u3vhen$1hkjj$1@newsreader4.netcologne.de>
References: <u2016l$9b5v$1@newsreader4.netcologne.de>
<u2gg61$2emt2$1@dont-email.me> <u2grh3$2gp8v$1@dont-email.me>
<zVS2M.506047$cKvc.496132@fx42.iad> <u2hjbj$2kg3l$1@dont-email.me>
<u2jdvn$30fef$1@dont-email.me> <u2mhfh$3mja7$1@dont-email.me>
<u2o3hc$44ri$1@dont-email.me> <2023May1.163832@mips.complang.tuwien.ac.at>
<M9S3M.582961$5CY7.211116@fx46.iad>
<2023May1.214819@mips.complang.tuwien.ac.at>
<985a755e-e984-4011-9f44-ae8e2061c347n@googlegroups.com>
<d0ec4e5b-6cc4-4d9d-9770-5d2f123e9f9dn@googlegroups.com>
<285c7b6d-2e8b-432a-8b91-3d8630d6695dn@googlegroups.com>
<2682dc68-f68a-4527-b3fa-363d06f6cf29n@googlegroups.com>
<604df68d-dbd9-4c53-bb7f-be2cf1e0fe45n@googlegroups.com>
<66e20780-90f0-4d99-b4ca-7158ae3e8676n@googlegroups.com>
<27537a42-d36c-4241-8856-a784b389e442n@googlegroups.com>
<2d8e2487-c184-4c4a-b729-5e9b43d9e5b7n@googlegroups.com>
<e31ef5c0-f384-4eb1-98c1-a4191cd893b8n@googlegroups.com>
<c25e98cb-eea9-42f9-8300-6e61067ae100n@googlegroups.com>
Injection-Date: Tue, 16 May 2023 09:12:55 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2a0a-a540-2152-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2a0a:a540:2152:0:7285:c2ff:fe6c:992d";
logging-data="1626739"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Tue, 16 May 2023 09:12 UTC

Quadibloc <jsavard@ecn.ab.ca> schrieb:

> So my memory reference instructions aren't
>
> opcode 6
> Rd 5
> Rs 5
> displacement 16
>
> they're
>
> opcode 5
> Rd 5
> Rx 3
> Rb 3
> displacement 16
>
> and so I have to make the 32 integer registers
> non-uniform; 1-7 are index registers, and 25-31
> are base registers.
>
> I'm fitting in index-base addressing into a single
> 32-bit word because the IBM 360 could do it, and
> I want to be almost as good!

You may not be aware of this, but one of the main insights that led
to the design of the 801 was that compilers for the /360 hardly ever
used the complex instructions, especially complex addressing modes.

I understand that you don't want to write, or port, your own
compiler. But do try to get some experience reading assembler
for other architectures, and see where yours could do better.

I would suggest configuring clang or gcc (clang by default, gcc with
a configure option) for a simple-minded RISC architecture. RISC-V
might be a good choice it does many operations as instructions,
which make it easier to follow.

For example, the RISC-V code for

void foo(int *p, unsigned long a, unsigned long b)
{ p[a+b+200]=1;
}

is

add a1, a1, a2
slli a1, a1, 2
add a0, a0, a1
li a1, 1
sw a1, 800(a0)
ret

which is a pattern you can surely recognize.

(Before Mitch chimes in: My 66000 could do this as

add r2,r2,r3
stw #1,[r1,r2<<2,800]
ret

although the compiler is not quite there yet).

If you're feeling very adventurous, you can write a little assembler
(using Perl, Python or another script language of your choice)
and do some dataflow analysis for basic blocks, which value ends up
where.

You could do so by having an associative array; at the start of a
basic block, you initialize the values to those of the register,
so (Perl syntax) $reg{'a1'} = 'a1';

On encountering each instruction, you do something like (if you
prefer a LISP-like syntax)

$value = "($instr $op2 $op3)";
$reg{$op1} = $value

so $reg{'a1'} is "(add a1 a2)" after the first instruction,
"(slli (add a1 a2) 2)" after the seconde, and so on.

You can then search for the combination of adds you want to replace
with a single instruction.

> This takes up 3/4 of the opcode space.

Isn't that rather a lot?

Re: Centrifuge instruction

<7ae7a55c-7dc4-4794-b503-2c6349688d72n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:622a:1898:b0:3f5:17dc:ba66 with SMTP id v24-20020a05622a189800b003f517dcba66mr3719133qtc.7.1684279190518;
Tue, 16 May 2023 16:19:50 -0700 (PDT)
X-Received: by 2002:a05:6870:e616:b0:196:74ca:432a with SMTP id
q22-20020a056870e61600b0019674ca432amr8490243oag.4.1684279190279; Tue, 16 May
2023 16:19:50 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!1.us.feeder.erje.net!3.us.feeder.erje.net!feeder.erje.net!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Tue, 16 May 2023 16:19:50 -0700 (PDT)
In-Reply-To: <u3vhen$1hkjj$1@newsreader4.netcologne.de>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:56a:fa34:c000:51d6:ab3:eefb:d7d9;
posting-account=1nOeKQkAAABD2jxp4Pzmx9Hx5g9miO8y
NNTP-Posting-Host: 2001:56a:fa34:c000:51d6:ab3:eefb:d7d9
References: <u2016l$9b5v$1@newsreader4.netcologne.de> <u2gg61$2emt2$1@dont-email.me>
<u2grh3$2gp8v$1@dont-email.me> <zVS2M.506047$cKvc.496132@fx42.iad>
<u2hjbj$2kg3l$1@dont-email.me> <u2jdvn$30fef$1@dont-email.me>
<u2mhfh$3mja7$1@dont-email.me> <u2o3hc$44ri$1@dont-email.me>
<2023May1.163832@mips.complang.tuwien.ac.at> <M9S3M.582961$5CY7.211116@fx46.iad>
<2023May1.214819@mips.complang.tuwien.ac.at> <985a755e-e984-4011-9f44-ae8e2061c347n@googlegroups.com>
<d0ec4e5b-6cc4-4d9d-9770-5d2f123e9f9dn@googlegroups.com> <285c7b6d-2e8b-432a-8b91-3d8630d6695dn@googlegroups.com>
<2682dc68-f68a-4527-b3fa-363d06f6cf29n@googlegroups.com> <604df68d-dbd9-4c53-bb7f-be2cf1e0fe45n@googlegroups.com>
<66e20780-90f0-4d99-b4ca-7158ae3e8676n@googlegroups.com> <27537a42-d36c-4241-8856-a784b389e442n@googlegroups.com>
<2d8e2487-c184-4c4a-b729-5e9b43d9e5b7n@googlegroups.com> <e31ef5c0-f384-4eb1-98c1-a4191cd893b8n@googlegroups.com>
<c25e98cb-eea9-42f9-8300-6e61067ae100n@googlegroups.com> <u3vhen$1hkjj$1@newsreader4.netcologne.de>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <7ae7a55c-7dc4-4794-b503-2c6349688d72n@googlegroups.com>
Subject: Re: Centrifuge instruction
From: jsavard@ecn.ab.ca (Quadibloc)
Injection-Date: Tue, 16 May 2023 23:19:50 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 19
 by: Quadibloc - Tue, 16 May 2023 23:19 UTC

On Tuesday, May 16, 2023 at 3:14:28 AM UTC-6, Thomas Koenig wrote:

> You may not be aware of this, but one of the main insights that led
> to the design of the 801 was that compilers for the /360 hardly ever
> used the complex instructions, especially complex addressing modes.

It's hard for me to believe that base-index addressing is all that "complex",
and, indeed, it would seem to me to be the obvious and natural way to
access register elements. If the compiler doesn't use it, the problem is
with the compiler.

That the string instructions, for example, were hardly used by compilers
is obvious enough - some of the string and packed decimal instructions,
though, would earn their keep if they were used in the assembly-coded
system subroutines to convert numbers to character form or the reverse
for printing and input. And I'd expect a COBOL compiler to have some
use for them, even if a FORTRAN compiler wouldn't.

John Savard

Re: Centrifuge instruction

<99c3be09-9d53-40ff-962f-ed20477ad0f5n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:622a:1a94:b0:3f4:e3b1:8d4f with SMTP id s20-20020a05622a1a9400b003f4e3b18d4fmr7488332qtc.1.1684279722477;
Tue, 16 May 2023 16:28:42 -0700 (PDT)
X-Received: by 2002:a4a:bb87:0:b0:547:689b:73c2 with SMTP id
h7-20020a4abb87000000b00547689b73c2mr7163180oop.0.1684279722206; Tue, 16 May
2023 16:28:42 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.quux.org!1.us.feeder.erje.net!feeder.erje.net!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Tue, 16 May 2023 16:28:41 -0700 (PDT)
In-Reply-To: <u3vhen$1hkjj$1@newsreader4.netcologne.de>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:56a:fa34:c000:51d6:ab3:eefb:d7d9;
posting-account=1nOeKQkAAABD2jxp4Pzmx9Hx5g9miO8y
NNTP-Posting-Host: 2001:56a:fa34:c000:51d6:ab3:eefb:d7d9
References: <u2016l$9b5v$1@newsreader4.netcologne.de> <u2gg61$2emt2$1@dont-email.me>
<u2grh3$2gp8v$1@dont-email.me> <zVS2M.506047$cKvc.496132@fx42.iad>
<u2hjbj$2kg3l$1@dont-email.me> <u2jdvn$30fef$1@dont-email.me>
<u2mhfh$3mja7$1@dont-email.me> <u2o3hc$44ri$1@dont-email.me>
<2023May1.163832@mips.complang.tuwien.ac.at> <M9S3M.582961$5CY7.211116@fx46.iad>
<2023May1.214819@mips.complang.tuwien.ac.at> <985a755e-e984-4011-9f44-ae8e2061c347n@googlegroups.com>
<d0ec4e5b-6cc4-4d9d-9770-5d2f123e9f9dn@googlegroups.com> <285c7b6d-2e8b-432a-8b91-3d8630d6695dn@googlegroups.com>
<2682dc68-f68a-4527-b3fa-363d06f6cf29n@googlegroups.com> <604df68d-dbd9-4c53-bb7f-be2cf1e0fe45n@googlegroups.com>
<66e20780-90f0-4d99-b4ca-7158ae3e8676n@googlegroups.com> <27537a42-d36c-4241-8856-a784b389e442n@googlegroups.com>
<2d8e2487-c184-4c4a-b729-5e9b43d9e5b7n@googlegroups.com> <e31ef5c0-f384-4eb1-98c1-a4191cd893b8n@googlegroups.com>
<c25e98cb-eea9-42f9-8300-6e61067ae100n@googlegroups.com> <u3vhen$1hkjj$1@newsreader4.netcologne.de>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <99c3be09-9d53-40ff-962f-ed20477ad0f5n@googlegroups.com>
Subject: Re: Centrifuge instruction
From: jsavard@ecn.ab.ca (Quadibloc)
Injection-Date: Tue, 16 May 2023 23:28:42 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 24
 by: Quadibloc - Tue, 16 May 2023 23:28 UTC

On Tuesday, May 16, 2023 at 3:14:28 AM UTC-6, Thomas Koenig wrote:

> > This takes up 3/4 of the opcode space.

> Isn't that rather a lot?

I end up cutting it down to 3/8 of the opcode space, so that I have
1/2 of the opcode space available for 16 bit instructions, by using only
three base registers, instead of seven, for 16-bit displacements.

This seemed to be a compromise that would cause the least damage to
the instruction set.

However, in Concertina II as it is, with the block structure, the 16-bit
instructions only use 1/4 of the opcode space, thanks to only occuring
in pairs. The 1/8 of the opcode space gained is used for operate
instructions.

I think I can manage the conversion to a variable length encoding.

That's because the opcode space allocated to operate instructions is
rather generous - unlike that used for memory-reference instructions,
which is tightly squeezed.

John Savard

Re: Centrifuge instruction

<d4896f30-76f9-4854-bd75-f9af18648386n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:ac8:5744:0:b0:3f3:64fd:c684 with SMTP id 4-20020ac85744000000b003f364fdc684mr14427720qtx.5.1684279768062;
Tue, 16 May 2023 16:29:28 -0700 (PDT)
X-Received: by 2002:aca:3286:0:b0:38e:30:121b with SMTP id y128-20020aca3286000000b0038e0030121bmr5455431oiy.5.1684279767842;
Tue, 16 May 2023 16:29:27 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Tue, 16 May 2023 16:29:27 -0700 (PDT)
In-Reply-To: <7ae7a55c-7dc4-4794-b503-2c6349688d72n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:56a:fa34:c000:51d6:ab3:eefb:d7d9;
posting-account=1nOeKQkAAABD2jxp4Pzmx9Hx5g9miO8y
NNTP-Posting-Host: 2001:56a:fa34:c000:51d6:ab3:eefb:d7d9
References: <u2016l$9b5v$1@newsreader4.netcologne.de> <u2gg61$2emt2$1@dont-email.me>
<u2grh3$2gp8v$1@dont-email.me> <zVS2M.506047$cKvc.496132@fx42.iad>
<u2hjbj$2kg3l$1@dont-email.me> <u2jdvn$30fef$1@dont-email.me>
<u2mhfh$3mja7$1@dont-email.me> <u2o3hc$44ri$1@dont-email.me>
<2023May1.163832@mips.complang.tuwien.ac.at> <M9S3M.582961$5CY7.211116@fx46.iad>
<2023May1.214819@mips.complang.tuwien.ac.at> <985a755e-e984-4011-9f44-ae8e2061c347n@googlegroups.com>
<d0ec4e5b-6cc4-4d9d-9770-5d2f123e9f9dn@googlegroups.com> <285c7b6d-2e8b-432a-8b91-3d8630d6695dn@googlegroups.com>
<2682dc68-f68a-4527-b3fa-363d06f6cf29n@googlegroups.com> <604df68d-dbd9-4c53-bb7f-be2cf1e0fe45n@googlegroups.com>
<66e20780-90f0-4d99-b4ca-7158ae3e8676n@googlegroups.com> <27537a42-d36c-4241-8856-a784b389e442n@googlegroups.com>
<2d8e2487-c184-4c4a-b729-5e9b43d9e5b7n@googlegroups.com> <e31ef5c0-f384-4eb1-98c1-a4191cd893b8n@googlegroups.com>
<c25e98cb-eea9-42f9-8300-6e61067ae100n@googlegroups.com> <u3vhen$1hkjj$1@newsreader4.netcologne.de>
<7ae7a55c-7dc4-4794-b503-2c6349688d72n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d4896f30-76f9-4854-bd75-f9af18648386n@googlegroups.com>
Subject: Re: Centrifuge instruction
From: jsavard@ecn.ab.ca (Quadibloc)
Injection-Date: Tue, 16 May 2023 23:29:28 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 7
 by: Quadibloc - Tue, 16 May 2023 23:29 UTC

On Tuesday, May 16, 2023 at 5:19:52 PM UTC-6, Quadibloc wrote:

> and, indeed, it would seem to me to be the obvious and natural way to
> access register elements.

Oops, array elements.

John Savard

Re: Centrifuge instruction

<a579f967-dba1-4468-9d3f-7577e72be816n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:620a:3715:b0:74e:2e3:8e24 with SMTP id de21-20020a05620a371500b0074e02e38e24mr13233620qkb.6.1684280099947;
Tue, 16 May 2023 16:34:59 -0700 (PDT)
X-Received: by 2002:aca:bd07:0:b0:390:84b8:ee4 with SMTP id
n7-20020acabd07000000b0039084b80ee4mr6638335oif.11.1684280099704; Tue, 16 May
2023 16:34:59 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Tue, 16 May 2023 16:34:59 -0700 (PDT)
In-Reply-To: <7ae7a55c-7dc4-4794-b503-2c6349688d72n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:7878:f2e8:43d6:8f47;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:7878:f2e8:43d6:8f47
References: <u2016l$9b5v$1@newsreader4.netcologne.de> <u2gg61$2emt2$1@dont-email.me>
<u2grh3$2gp8v$1@dont-email.me> <zVS2M.506047$cKvc.496132@fx42.iad>
<u2hjbj$2kg3l$1@dont-email.me> <u2jdvn$30fef$1@dont-email.me>
<u2mhfh$3mja7$1@dont-email.me> <u2o3hc$44ri$1@dont-email.me>
<2023May1.163832@mips.complang.tuwien.ac.at> <M9S3M.582961$5CY7.211116@fx46.iad>
<2023May1.214819@mips.complang.tuwien.ac.at> <985a755e-e984-4011-9f44-ae8e2061c347n@googlegroups.com>
<d0ec4e5b-6cc4-4d9d-9770-5d2f123e9f9dn@googlegroups.com> <285c7b6d-2e8b-432a-8b91-3d8630d6695dn@googlegroups.com>
<2682dc68-f68a-4527-b3fa-363d06f6cf29n@googlegroups.com> <604df68d-dbd9-4c53-bb7f-be2cf1e0fe45n@googlegroups.com>
<66e20780-90f0-4d99-b4ca-7158ae3e8676n@googlegroups.com> <27537a42-d36c-4241-8856-a784b389e442n@googlegroups.com>
<2d8e2487-c184-4c4a-b729-5e9b43d9e5b7n@googlegroups.com> <e31ef5c0-f384-4eb1-98c1-a4191cd893b8n@googlegroups.com>
<c25e98cb-eea9-42f9-8300-6e61067ae100n@googlegroups.com> <u3vhen$1hkjj$1@newsreader4.netcologne.de>
<7ae7a55c-7dc4-4794-b503-2c6349688d72n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a579f967-dba1-4468-9d3f-7577e72be816n@googlegroups.com>
Subject: Re: Centrifuge instruction
From: MitchAlsup@aol.com (MitchAlsup)
Injection-Date: Tue, 16 May 2023 23:34:59 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 4260
 by: MitchAlsup - Tue, 16 May 2023 23:34 UTC

On Tuesday, May 16, 2023 at 6:19:52 PM UTC-5, Quadibloc wrote:
> On Tuesday, May 16, 2023 at 3:14:28 AM UTC-6, Thomas Koenig wrote:
>
> > You may not be aware of this, but one of the main insights that led
> > to the design of the 801 was that compilers for the /360 hardly ever
> > used the complex instructions, especially complex addressing modes.
<
> It's hard for me to believe that base-index addressing is all that "complex",
> and, indeed, it would seem to me to be the obvious and natural way to
> access register elements. If the compiler doesn't use it, the problem is
> with the compiler.
<
There is a useful difference between base+index and base+scaled index.
The former requires linear induction, the later requires less.
<
But similar stories abound in that VAX doing indirect memory accesses
(and other exotic uses of the address modes) was almost always SLOWER
than simply using registers as a programmable cache. Then again, not
using the CALL and RET instruction (use JSR and JMP instead) provided
for very significant performance gains.
<
On the other hand, this was one of the things Brian's compiler had little
trouble utilizing.
>
> That the string instructions, for example, were hardly used by compilers
> is obvious enough - some of the string and packed decimal instructions,
> though, would earn their keep if they were used in the assembly-coded
> system subroutines to convert numbers to character form or the reverse
> for printing and input. And I'd expect a COBOL compiler to have some
> use for them, even if a FORTRAN compiler wouldn't.
<
In 1974, I figured out how to CON the PL/1 compiler to use the string
instructions to move checker boards (push and pop) so as to evaluate
multiple move sequences. The checker boards were a 4×8 matrix of
bytes {0 = unoccupied, 1 = pawn, 2 = queen}. The stack represented
the sequence the game took (backup), .....
>
> John Savard

Re: Centrifuge instruction

<f7ac5785-0940-400b-87b9-7f10c00dba0fn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:622a:1884:b0:3f5:a6d:451c with SMTP id v4-20020a05622a188400b003f50a6d451cmr4948853qtc.3.1684298115516;
Tue, 16 May 2023 21:35:15 -0700 (PDT)
X-Received: by 2002:a4a:b1c6:0:b0:54f:aec6:ec9a with SMTP id
j6-20020a4ab1c6000000b0054faec6ec9amr8344666ooo.1.1684298115247; Tue, 16 May
2023 21:35:15 -0700 (PDT)
Path: i2pn2.org!i2pn.org!news.neodome.net!feeder1.feed.usenet.farm!feed.usenet.farm!peer03.ams4!peer.am4.highwinds-media.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Tue, 16 May 2023 21:35:14 -0700 (PDT)
In-Reply-To: <a579f967-dba1-4468-9d3f-7577e72be816n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:56a:fa34:c000:51d6:ab3:eefb:d7d9;
posting-account=1nOeKQkAAABD2jxp4Pzmx9Hx5g9miO8y
NNTP-Posting-Host: 2001:56a:fa34:c000:51d6:ab3:eefb:d7d9
References: <u2016l$9b5v$1@newsreader4.netcologne.de> <u2gg61$2emt2$1@dont-email.me>
<u2grh3$2gp8v$1@dont-email.me> <zVS2M.506047$cKvc.496132@fx42.iad>
<u2hjbj$2kg3l$1@dont-email.me> <u2jdvn$30fef$1@dont-email.me>
<u2mhfh$3mja7$1@dont-email.me> <u2o3hc$44ri$1@dont-email.me>
<2023May1.163832@mips.complang.tuwien.ac.at> <M9S3M.582961$5CY7.211116@fx46.iad>
<2023May1.214819@mips.complang.tuwien.ac.at> <985a755e-e984-4011-9f44-ae8e2061c347n@googlegroups.com>
<d0ec4e5b-6cc4-4d9d-9770-5d2f123e9f9dn@googlegroups.com> <285c7b6d-2e8b-432a-8b91-3d8630d6695dn@googlegroups.com>
<2682dc68-f68a-4527-b3fa-363d06f6cf29n@googlegroups.com> <604df68d-dbd9-4c53-bb7f-be2cf1e0fe45n@googlegroups.com>
<66e20780-90f0-4d99-b4ca-7158ae3e8676n@googlegroups.com> <27537a42-d36c-4241-8856-a784b389e442n@googlegroups.com>
<2d8e2487-c184-4c4a-b729-5e9b43d9e5b7n@googlegroups.com> <e31ef5c0-f384-4eb1-98c1-a4191cd893b8n@googlegroups.com>
<c25e98cb-eea9-42f9-8300-6e61067ae100n@googlegroups.com> <u3vhen$1hkjj$1@newsreader4.netcologne.de>
<7ae7a55c-7dc4-4794-b503-2c6349688d72n@googlegroups.com> <a579f967-dba1-4468-9d3f-7577e72be816n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f7ac5785-0940-400b-87b9-7f10c00dba0fn@googlegroups.com>
Subject: Re: Centrifuge instruction
From: jsavard@ecn.ab.ca (Quadibloc)
Injection-Date: Wed, 17 May 2023 04:35:15 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3096
 by: Quadibloc - Wed, 17 May 2023 04:35 UTC

On Tuesday, May 16, 2023 at 5:35:01 PM UTC-6, MitchAlsup wrote:

> In 1974, I figured out how to CON the PL/1 compiler to use the string
> instructions to move checker boards (push and pop) so as to evaluate
> multiple move sequences. The checker boards were a 4×8 matrix of
> bytes {0 = unoccupied, 1 = pawn, 2 = queen}. The stack represented
> the sequence the game took (backup), .....

I'm supposing you equivalenced the byte arrays to character strings
to manage that.

If you are only using 32 squares, indeed you are playing checkers.
But then that should be 1=man, 2=king. One only finds queens in
Chess, and for that matter, the same is true of pawns.

John Savard

Re: Centrifuge instruction

<u41rav$1ita3$1@newsreader4.netcologne.de>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2a0a-a540-2152-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoenig@netcologne.de (Thomas Koenig)
Newsgroups: comp.arch
Subject: Re: Centrifuge instruction
Date: Wed, 17 May 2023 06:13:51 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <u41rav$1ita3$1@newsreader4.netcologne.de>
References: <u2016l$9b5v$1@newsreader4.netcologne.de>
<u2hjbj$2kg3l$1@dont-email.me> <u2jdvn$30fef$1@dont-email.me>
<u2mhfh$3mja7$1@dont-email.me> <u2o3hc$44ri$1@dont-email.me>
<2023May1.163832@mips.complang.tuwien.ac.at>
<M9S3M.582961$5CY7.211116@fx46.iad>
<2023May1.214819@mips.complang.tuwien.ac.at>
<985a755e-e984-4011-9f44-ae8e2061c347n@googlegroups.com>
<d0ec4e5b-6cc4-4d9d-9770-5d2f123e9f9dn@googlegroups.com>
<285c7b6d-2e8b-432a-8b91-3d8630d6695dn@googlegroups.com>
<2682dc68-f68a-4527-b3fa-363d06f6cf29n@googlegroups.com>
<604df68d-dbd9-4c53-bb7f-be2cf1e0fe45n@googlegroups.com>
<66e20780-90f0-4d99-b4ca-7158ae3e8676n@googlegroups.com>
<27537a42-d36c-4241-8856-a784b389e442n@googlegroups.com>
<2d8e2487-c184-4c4a-b729-5e9b43d9e5b7n@googlegroups.com>
<e31ef5c0-f384-4eb1-98c1-a4191cd893b8n@googlegroups.com>
<c25e98cb-eea9-42f9-8300-6e61067ae100n@googlegroups.com>
<u3vhen$1hkjj$1@newsreader4.netcologne.de>
<7ae7a55c-7dc4-4794-b503-2c6349688d72n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 17 May 2023 06:13:51 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2a0a-a540-2152-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2a0a:a540:2152:0:7285:c2ff:fe6c:992d";
logging-data="1668419"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Wed, 17 May 2023 06:13 UTC

Quadibloc <jsavard@ecn.ab.ca> schrieb:
> On Tuesday, May 16, 2023 at 3:14:28 AM UTC-6, Thomas Koenig wrote:
>
>> You may not be aware of this, but one of the main insights that led
>> to the design of the 801 was that compilers for the /360 hardly ever
>> used the complex instructions, especially complex addressing modes.
>
> It's hard for me to believe that base-index addressing is all that "complex",
> and, indeed, it would seem to me to be the obvious and natural way to
> access register elements.

We were talking about

# opcode 5
# Rd 5
# Rx 3
# Rb 3
# displacement 16

You typically have a pointer to the first element of the array.
You run through it in a loop, using indexed load/stores.

Where does the displacement come in, and why 16 bits?

> If the compiler doesn't use it, the problem is
> with the compiler.

You cannot look at an architecture independent of the compiler.

This is likely a non-problem, because it occurs so infrequently
that it does not matter.

Do you actually look at assembler output for real programs to see
how often this is needed?

And did you consider my suggestion upthread about how to gather
actual data?

Re: Centrifuge instruction

<Jq59M.606265$Ldj8.268135@fx47.iad>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder1.feed.usenet.farm!feed.usenet.farm!peer02.ams4!peer.am4.highwinds-media.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx47.iad.POSTED!not-for-mail
From: ThatWouldBeTelling@thevillage.com (EricP)
User-Agent: Thunderbird 2.0.0.24 (Windows/20100228)
MIME-Version: 1.0
Newsgroups: comp.arch
Subject: Re: Centrifuge instruction
References: <u2016l$9b5v$1@newsreader4.netcologne.de> <u2hjbj$2kg3l$1@dont-email.me> <u2jdvn$30fef$1@dont-email.me> <u2mhfh$3mja7$1@dont-email.me> <u2o3hc$44ri$1@dont-email.me> <2023May1.163832@mips.complang.tuwien.ac.at> <M9S3M.582961$5CY7.211116@fx46.iad> <2023May1.214819@mips.complang.tuwien.ac.at> <985a755e-e984-4011-9f44-ae8e2061c347n@googlegroups.com> <d0ec4e5b-6cc4-4d9d-9770-5d2f123e9f9dn@googlegroups.com> <285c7b6d-2e8b-432a-8b91-3d8630d6695dn@googlegroups.com> <2682dc68-f68a-4527-b3fa-363d06f6cf29n@googlegroups.com> <604df68d-dbd9-4c53-bb7f-be2cf1e0fe45n@googlegroups.com> <66e20780-90f0-4d99-b4ca-7158ae3e8676n@googlegroups.com> <27537a42-d36c-4241-8856-a784b389e442n@googlegroups.com> <2d8e2487-c184-4c4a-b729-5e9b43d9e5b7n@googlegroups.com> <e31ef5c0-f384-4eb1-98c1-a4191cd893b8n@googlegroups.com> <c25e98cb-eea9-42f9-8300-6e61067ae100n@googlegroups.com> <u3vhen$1hkjj$1@newsreader4.netcologne.de> <7ae7a55c-7dc4-4794-b503-2c6349688d72n@googlegroups.com>
In-Reply-To: <7ae7a55c-7dc4-4794-b503-2c6349688d72n@googlegroups.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Lines: 42
Message-ID: <Jq59M.606265$Ldj8.268135@fx47.iad>
X-Complaints-To: abuse@UsenetServer.com
NNTP-Posting-Date: Wed, 17 May 2023 14:22:33 UTC
Date: Wed, 17 May 2023 10:05:21 -0400
X-Received-Bytes: 3582
 by: EricP - Wed, 17 May 2023 14:05 UTC

Quadibloc wrote:
> On Tuesday, May 16, 2023 at 3:14:28 AM UTC-6, Thomas Koenig wrote:
>
>> You may not be aware of this, but one of the main insights that led
>> to the design of the 801 was that compilers for the /360 hardly ever
>> used the complex instructions, especially complex addressing modes.
>
> It's hard for me to believe that base-index addressing is all that "complex",
> and, indeed, it would seem to me to be the obvious and natural way to
> access register elements. If the compiler doesn't use it, the problem is
> with the compiler.
>
> That the string instructions, for example, were hardly used by compilers
> is obvious enough - some of the string and packed decimal instructions,
> though, would earn their keep if they were used in the assembly-coded
> system subroutines to convert numbers to character form or the reverse
> for printing and input. And I'd expect a COBOL compiler to have some
> use for them, even if a FORTRAN compiler wouldn't.
>
> John Savard

The Vax Fortran 77 compiler used the string instructions -
arrays are first class types in F77 and mapped well to
those high level instructions. Also for record/struct moves.

The MOVC5 instruction takes 5 operands:
src len, src addr, dst len, dst addr, pad char,
and appears designed for F77 string edits.
(F77 string moves were defined as truncating if the
dst was shorter than source, pad with blanks if dst longer.)

Note though that F77 was an important compiler for DEC's business
as much of their customer base was scientists and engineers.
So they put a lot of development into that compiler.

The scuttlebutt I heard at that time was IBM had multiple Fortran
compilers and while at one time one of them was supposedly considered
state-of-the-art, it had not been actively developed for a while.
We ported a lot of F77 from VAX to VM/CMS and the IBM compiler
was extremely simplistic.

Re: Centrifuge instruction

<Kq59M.606266$Ldj8.458009@fx47.iad>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder1.feed.usenet.farm!feed.usenet.farm!peer01.ams4!peer.am4.highwinds-media.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx47.iad.POSTED!not-for-mail
From: ThatWouldBeTelling@thevillage.com (EricP)
User-Agent: Thunderbird 2.0.0.24 (Windows/20100228)
MIME-Version: 1.0
Newsgroups: comp.arch
Subject: Re: Centrifuge instruction
References: <u2016l$9b5v$1@newsreader4.netcologne.de> <u2mhfh$3mja7$1@dont-email.me> <u2o3hc$44ri$1@dont-email.me> <2023May1.163832@mips.complang.tuwien.ac.at> <M9S3M.582961$5CY7.211116@fx46.iad> <2023May1.214819@mips.complang.tuwien.ac.at> <985a755e-e984-4011-9f44-ae8e2061c347n@googlegroups.com> <d0ec4e5b-6cc4-4d9d-9770-5d2f123e9f9dn@googlegroups.com> <285c7b6d-2e8b-432a-8b91-3d8630d6695dn@googlegroups.com> <2682dc68-f68a-4527-b3fa-363d06f6cf29n@googlegroups.com> <604df68d-dbd9-4c53-bb7f-be2cf1e0fe45n@googlegroups.com> <66e20780-90f0-4d99-b4ca-7158ae3e8676n@googlegroups.com> <27537a42-d36c-4241-8856-a784b389e442n@googlegroups.com> <2d8e2487-c184-4c4a-b729-5e9b43d9e5b7n@googlegroups.com> <e31ef5c0-f384-4eb1-98c1-a4191cd893b8n@googlegroups.com> <c25e98cb-eea9-42f9-8300-6e61067ae100n@googlegroups.com> <u3vhen$1hkjj$1@newsreader4.netcologne.de> <7ae7a55c-7dc4-4794-b503-2c6349688d72n@googlegroups.com> <a579f967-dba1-4468-9d3f-7577e72be816n@googlegroups.com>
In-Reply-To: <a579f967-dba1-4468-9d3f-7577e72be816n@googlegroups.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Lines: 33
Message-ID: <Kq59M.606266$Ldj8.458009@fx47.iad>
X-Complaints-To: abuse@UsenetServer.com
NNTP-Posting-Date: Wed, 17 May 2023 14:22:34 UTC
Date: Wed, 17 May 2023 10:22:11 -0400
X-Received-Bytes: 3276
 by: EricP - Wed, 17 May 2023 14:22 UTC

MitchAlsup wrote:
> On Tuesday, May 16, 2023 at 6:19:52 PM UTC-5, Quadibloc wrote:
>> On Tuesday, May 16, 2023 at 3:14:28 AM UTC-6, Thomas Koenig wrote:
>>
>>> You may not be aware of this, but one of the main insights that led
>>> to the design of the 801 was that compilers for the /360 hardly ever
>>> used the complex instructions, especially complex addressing modes.
> <
>> It's hard for me to believe that base-index addressing is all that "complex",
>> and, indeed, it would seem to me to be the obvious and natural way to
>> access register elements. If the compiler doesn't use it, the problem is
>> with the compiler.
> <
> There is a useful difference between base+index and base+scaled index.
> The former requires linear induction, the later requires less.
> <
> But similar stories abound in that VAX doing indirect memory accesses
> (and other exotic uses of the address modes) was almost always SLOWER
> than simply using registers as a programmable cache. Then again, not
> using the CALL and RET instruction (use JSR and JMP instead) provided
> for very significant performance gains.

There is the extra clocks VAX 780 took to decode the index operand
specifiers. Also the ALU was 74181's which have only 2 source operands
so a scaled index took an extra trip through the ALU.
And some VAX models didn't do back-to-back fordwarding between uOps
which scaled index addressing requires.

In the VAX Fortran 77 compiler, strength reduction of loop induction
variables and replacing indexed array accesses with autoincrement
memory accesses was an important optimization.

Re: Centrifuge instruction

<cI59M.257344$T%ac.160911@fx01.iad>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!news.neodome.net!feeder1.feed.usenet.farm!feed.usenet.farm!peer02.ams4!peer.am4.highwinds-media.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx01.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: scott@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: Centrifuge instruction
Newsgroups: comp.arch
References: <u2016l$9b5v$1@newsreader4.netcologne.de> <66e20780-90f0-4d99-b4ca-7158ae3e8676n@googlegroups.com> <27537a42-d36c-4241-8856-a784b389e442n@googlegroups.com> <2d8e2487-c184-4c4a-b729-5e9b43d9e5b7n@googlegroups.com> <e31ef5c0-f384-4eb1-98c1-a4191cd893b8n@googlegroups.com> <c25e98cb-eea9-42f9-8300-6e61067ae100n@googlegroups.com> <u3vhen$1hkjj$1@newsreader4.netcologne.de> <7ae7a55c-7dc4-4794-b503-2c6349688d72n@googlegroups.com> <Jq59M.606265$Ldj8.268135@fx47.iad>
Lines: 135
Message-ID: <cI59M.257344$T%ac.160911@fx01.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Wed, 17 May 2023 14:41:12 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Wed, 17 May 2023 14:41:12 GMT
X-Received-Bytes: 14269
 by: Scott Lurndal - Wed, 17 May 2023 14:41 UTC

EricP <ThatWouldBeTelling@thevillage.com> writes:
>Quadibloc wrote:
>> On Tuesday, May 16, 2023 at 3:14:28 AM UTC-6, Thomas Koenig wrote:
>>
>>> You may not be aware of this, but one of the main insights that led
>>> to the design of the 801 was that compilers for the /360 hardly ever
>>> used the complex instructions, especially complex addressing modes.
>>
>> It's hard for me to believe that base-index addressing is all that "complex",
>> and, indeed, it would seem to me to be the obvious and natural way to
>> access register elements. If the compiler doesn't use it, the problem is
>> with the compiler.
>>
>> That the string instructions, for example, were hardly used by compilers
>> is obvious enough - some of the string and packed decimal instructions,
>> though, would earn their keep if they were used in the assembly-coded
>> system subroutines to convert numbers to character form or the reverse
>> for printing and input. And I'd expect a COBOL compiler to have some
>> use for them, even if a FORTRAN compiler wouldn't.
>>
>> John Savard
>
>The Vax Fortran 77 compiler used the string instructions -

As did the Pascal compiler. A lot of VAX software was
written in Macro32 and the string instructions were commonly
used there as well.

In the Burroughs (medium systems - BCD machines), string
instructions were deriguour, as they were the only data
movement instructions (like MOVC5, they had the ability
to pad (leading with zeros or trailing with blanks as
required by the data type). Very heavily used by the
COBOL (68, 74) compilers.

There were also instructions to scan strings for a
set of delimiters (Scan Delimiter Equal (SDE) and Scan
Delimiter Unequal); useful for parsing etc.

Then there were the search instructions (two flavors of
search table instructions, and two flavors of search
linked list instructions).

And of course, there was the EDT (Edit) instruction to
support COBOL PIC clauses.

* 00772000
* Handle the case where the information is extracted 00773000
* from a LANGUAGE_TABLE entry 00774000
* 00775000
..Mls BOT (/FF) -Flag /Set request? 00776000
EQL +SetM /Yep, set it 00777000
* 00778000
LIX TBL-OF:+X4,IX1,DEFLAN /Fetch ptr to ptr 00779000
LNGH IX1 00780000
LIX BASE:+X1(SN),IX1 /Load real pointer 00781000
ADD LT-NAM(LL),IX1+RL,STRSBA:+X6 /String start 00782000
ADD LT-NAM(SZ),STRSBA:+X6,STRSEA:+X6 /String end 00783000
MVN IX1+DO,STRMA:+X6 /Set source M.A. 00784000
MVN IR-MGR:(EN),STRENV:+X6 /Set an env 00785000
MVS STRDSC:+X6,STRDSC:+X7(UA) /Move data, pad blanks 00786000
BUN +NEXT /Do next item 00787000
00788000
..SetM BRT (/FF) STRDSC:+X6 /Clear descriptor 00789000
ADD -LTnam(LL),IX3+RL,STRSBA:+X6 /String start 00790000
MVR (/03) STRSBA:+X6,STRSEA:+X6 /Set string & cont addr 00791000
INC -LTnam(SZ),STRCEA:+X6 /Set container end 00792000
MVS (/50) STRDSC:+X7,STRDSC:+X6(UA) /Move data, pad blanks 00793000
MVN =1,-CFlg /Change task attr 00794000
ADD -ErKey(LL),IX3,-Rptr /Return ptr 00795000
SIX -SavM,MOBILE /Save mobiles 00796000
MVW IX1/X2,-SavI /Save IX1/2 00797000
VEN -ChgP,MLSCHG /Change language 00798000
LIX -SavM,MOBILE /Restore mobiles 00799000
MVW -SavI,IX1/X2 /Restore IX1/X2 00800000
BUN +NEXT /Do next item 00801000
* 00802000
..JUST SUB RQ-BEG:+X2,RQ-END:+X2,-DELTA /Size of recieving fld 00803000
DEC -SSIZE,-DELTA /Find the bigger one 00804000
EQL +MOVE /Nobody, all ok. 00805000
GTR +DEST /Dest is bigger 0080600

StarTrek game in COBOL:

3000-COM-FUN. 605 CARD 1 67592
DISPLAY " ". 606 CARD 1 67592
01 067592 MVW 120003 204048 200336 CODE
01 067610 BCT 300254 CODE
01 067616 BUN 27 0C067636 CODE
^LCOBOL MARK 3.33 (DC 10/09/98) COMPILATION OF STREK 2022 JULY 25 07:01 PAGE 38

01 067626 ACON 000336 CODE
01 067632 CNST 1060 CODE
IF ENTRY1 NOT NUMERIC OR ENTRY1 < 1 OR ENTRY1 > 6 607 CARD 1 67636
01 067636 SDU 171001 004062 217014 CODE
01 067654 LEQ 23 0C067720 CODE
01 067664 CPN 46A101 100000 217014 CODE
01 067682 GTR 24 0C067720 CODE
01 067692 CPN 46A101 600000 217014 CODE
01 067710 GEQ 26 0C067800 CODE
DISPLAY "*COMPUTER ACTIVE AND AWAITING COMMAND* " 608 CARD 1 67720
01 067720 MVA 103939 204072 200336 CODE
01 067738 BCT 300254 CODE
01 067744 BUN 27 0C067764 CODE
01 067754 ACON 000336 CODE
01 067760 CNST 1390 CODE
ACCEPT COMP-COM 609 CARD 1 67764
01 067764 BCT 300254 CODE
01 067770 BUN 27 0C067790 CODE
01 067780 ACON 017536 CODE
01 067786 CNST 0010 CODE
01 067790 BUN 27 0C067818 CODE
ELSE 610 CARD
MOVE ENTRY1 TO COMP-COM. 611 CARD 1 67800
01 067800 MVN 110101 217014 217536 CODE
IF COMP-COM NOT NUMERIC OR COMP-COM < 1 OR COMP-COM > 6 612 CARD 1 67818
01 067818 SDU 171001 004062 217536 CODE
01 067836 LEQ 23 0C067902 CODE
01 067846 CPN 46A101 100000 217536 CODE
01 067864 GTR 24 0C067902 CODE
01 067874 CPN 46A101 600000 217536 CODE
01 067892 GEQ 26 0C068546 CODE
DISPLAY "INVALID COMPUTER COMMAND " 613 CARD 1 67902
01 067902 MVA 102525 204150 200336 CODE
01 067920 BCT 300254 CODE
01 067926 BUN 27 0C067946 CODE
01 067936 ACON 000336 CODE
01 067942 CNST 1250 CODE
DISPLAY "DO YOU WANT A LIST OF COMPUTER COMMANDS? " 614 CARD 1 67946
01 067946 MVW 120021 204200 200336 CODE
01 067964 BCT 300254 CODE
01 067970 BUN 27 0C067990 CODE
01 067980 ACON 000336 CODE
01 067986 CNST 1420


Click here to read the complete article
Re: Centrifuge instruction

<8Y69M.3092726$9sn9.2997450@fx17.iad>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder1.feed.usenet.farm!feed.usenet.farm!peer02.ams4!peer.am4.highwinds-media.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx17.iad.POSTED!not-for-mail
From: ThatWouldBeTelling@thevillage.com (EricP)
User-Agent: Thunderbird 2.0.0.24 (Windows/20100228)
MIME-Version: 1.0
Newsgroups: comp.arch
Subject: Re: Centrifuge instruction
References: <u2016l$9b5v$1@newsreader4.netcologne.de> <66e20780-90f0-4d99-b4ca-7158ae3e8676n@googlegroups.com> <27537a42-d36c-4241-8856-a784b389e442n@googlegroups.com> <2d8e2487-c184-4c4a-b729-5e9b43d9e5b7n@googlegroups.com> <e31ef5c0-f384-4eb1-98c1-a4191cd893b8n@googlegroups.com> <c25e98cb-eea9-42f9-8300-6e61067ae100n@googlegroups.com> <u3vhen$1hkjj$1@newsreader4.netcologne.de> <7ae7a55c-7dc4-4794-b503-2c6349688d72n@googlegroups.com> <Jq59M.606265$Ldj8.268135@fx47.iad> <cI59M.257344$T%ac.160911@fx01.iad>
In-Reply-To: <cI59M.257344$T%ac.160911@fx01.iad>
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 8bit
Lines: 58
Message-ID: <8Y69M.3092726$9sn9.2997450@fx17.iad>
X-Complaints-To: abuse@UsenetServer.com
NNTP-Posting-Date: Wed, 17 May 2023 16:06:28 UTC
Date: Wed, 17 May 2023 12:06:16 -0400
X-Received-Bytes: 3798
 by: EricP - Wed, 17 May 2023 16:06 UTC

Scott Lurndal wrote:
> EricP <ThatWouldBeTelling@thevillage.com> writes:
>> Quadibloc wrote:
>>> On Tuesday, May 16, 2023 at 3:14:28 AM UTC-6, Thomas Koenig wrote:
>>>
>>>> You may not be aware of this, but one of the main insights that led
>>>> to the design of the 801 was that compilers for the /360 hardly ever
>>>> used the complex instructions, especially complex addressing modes.
>>> It's hard for me to believe that base-index addressing is all that "complex",
>>> and, indeed, it would seem to me to be the obvious and natural way to
>>> access register elements. If the compiler doesn't use it, the problem is
>>> with the compiler.
>>>
>>> That the string instructions, for example, were hardly used by compilers
>>> is obvious enough - some of the string and packed decimal instructions,
>>> though, would earn their keep if they were used in the assembly-coded
>>> system subroutines to convert numbers to character form or the reverse
>>> for printing and input. And I'd expect a COBOL compiler to have some
>>> use for them, even if a FORTRAN compiler wouldn't.
>>>
>>> John Savard
>> The Vax Fortran 77 compiler used the string instructions -
>
> As did the Pascal compiler. A lot of VAX software was
> written in Macro32 and the string instructions were commonly
> used there as well.
>
> In the Burroughs (medium systems - BCD machines), string
> instructions were deriguour, as they were the only data
> movement instructions (like MOVC5, they had the ability
> to pad (leading with zeros or trailing with blanks as
> required by the data type). Very heavily used by the
> COBOL (68, 74) compilers.
>
> There were also instructions to scan strings for a
> set of delimiters (Scan Delimiter Equal (SDE) and Scan
> Delimiter Unequal); useful for parsing etc.
>
> Then there were the search instructions (two flavors of
> search table instructions, and two flavors of search
> linked list instructions).
>
> And of course, there was the EDT (Edit) instruction to
> support COBOL PIC clauses.

VAX Ada used the CASE instruction for case statements.
Ada has packed arrays of bit-wise variables and IIRC compiler
used the bit field EXTV extract bit vector and INSV insert bit
vector instructions for accessing memory bit field vector arrays.

I never used COBOL but I'm pretty sure VAX compiler used the
decimal string instructions. Later PDP-11 models also had
decimal string instructions so likely the compilers used them too.

That's not to say these instructions weren't slow as molasses,
just that the compilers could spit them out.

Re: Centrifuge instruction

<u42ve1$3u0ap$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: sfuld@alumni.cmu.edu.invalid (Stephen Fuld)
Newsgroups: comp.arch
Subject: Re: Centrifuge instruction
Date: Wed, 17 May 2023 09:29:53 -0700
Organization: A noiseless patient Spider
Lines: 36
Message-ID: <u42ve1$3u0ap$1@dont-email.me>
References: <u2016l$9b5v$1@newsreader4.netcologne.de>
<u2hjbj$2kg3l$1@dont-email.me> <u2jdvn$30fef$1@dont-email.me>
<u2mhfh$3mja7$1@dont-email.me> <u2o3hc$44ri$1@dont-email.me>
<2023May1.163832@mips.complang.tuwien.ac.at>
<M9S3M.582961$5CY7.211116@fx46.iad>
<2023May1.214819@mips.complang.tuwien.ac.at>
<985a755e-e984-4011-9f44-ae8e2061c347n@googlegroups.com>
<d0ec4e5b-6cc4-4d9d-9770-5d2f123e9f9dn@googlegroups.com>
<285c7b6d-2e8b-432a-8b91-3d8630d6695dn@googlegroups.com>
<2682dc68-f68a-4527-b3fa-363d06f6cf29n@googlegroups.com>
<604df68d-dbd9-4c53-bb7f-be2cf1e0fe45n@googlegroups.com>
<66e20780-90f0-4d99-b4ca-7158ae3e8676n@googlegroups.com>
<27537a42-d36c-4241-8856-a784b389e442n@googlegroups.com>
<2d8e2487-c184-4c4a-b729-5e9b43d9e5b7n@googlegroups.com>
<e31ef5c0-f384-4eb1-98c1-a4191cd893b8n@googlegroups.com>
<c25e98cb-eea9-42f9-8300-6e61067ae100n@googlegroups.com>
<u3vhen$1hkjj$1@newsreader4.netcologne.de>
<7ae7a55c-7dc4-4794-b503-2c6349688d72n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 17 May 2023 16:29:53 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="f1c34a3b49ae5ff3260f29dd64a4dd4b";
logging-data="4129113"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+oaUCrsCeZHqzlIdFcB9YWB/MDiS74nHk="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:3TJMUsMVZ3DZdbLYiHVzvUjCnzM=
Content-Language: en-US
In-Reply-To: <7ae7a55c-7dc4-4794-b503-2c6349688d72n@googlegroups.com>
 by: Stephen Fuld - Wed, 17 May 2023 16:29 UTC

On 5/16/2023 4:19 PM, Quadibloc wrote:
> On Tuesday, May 16, 2023 at 3:14:28 AM UTC-6, Thomas Koenig wrote:
>
>> You may not be aware of this, but one of the main insights that led
>> to the design of the 801 was that compilers for the /360 hardly ever
>> used the complex instructions, especially complex addressing modes.
>
> It's hard for me to believe that base-index addressing is all that "complex",
> and, indeed, it would seem to me to be the obvious and natural way to
> access register elements. If the compiler doesn't use it, the problem is
> with the compiler.
>
> That the string instructions, for example, were hardly used by compilers
> is obvious enough - some of the string and packed decimal instructions,
> though, would earn their keep if they were used in the assembly-coded
> system subroutines to convert numbers to character form or the reverse
> for printing and input. And I'd expect a COBOL compiler to have some
> use for them, even if a FORTRAN compiler wouldn't.

IBM's S/360 COBOL compiler used this type of instruction extensively.
Of course, if you defined a data item as COMP-3, all arithmetic was done
using using the decimal instructions. If you defined a data item as
display, arithmetic was done by generating a Pack instruction to convert
to packed decimal then doing the arithmetic, then unpacking the result.
Also, since the edit instruction took a packed decimal format, any COBOL
move to a display field that required editing generated a pack if
necessary, followed by the edit. In addition, most COBOL moves that
didn't require any modification were done by generating a move character
instruction (MVC). There were other "stringy" instructions that
implemented various COBOL verbs.

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

Re: Centrifuge instruction

<u4310d$1joc4$1@newsreader4.netcologne.de>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2a0a-a540-2152-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoenig@netcologne.de (Thomas Koenig)
Newsgroups: comp.arch
Subject: Re: Centrifuge instruction
Date: Wed, 17 May 2023 16:56:45 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <u4310d$1joc4$1@newsreader4.netcologne.de>
References: <u2016l$9b5v$1@newsreader4.netcologne.de>
<u2jdvn$30fef$1@dont-email.me> <u2mhfh$3mja7$1@dont-email.me>
<u2o3hc$44ri$1@dont-email.me> <2023May1.163832@mips.complang.tuwien.ac.at>
<M9S3M.582961$5CY7.211116@fx46.iad>
<2023May1.214819@mips.complang.tuwien.ac.at>
<985a755e-e984-4011-9f44-ae8e2061c347n@googlegroups.com>
<d0ec4e5b-6cc4-4d9d-9770-5d2f123e9f9dn@googlegroups.com>
<285c7b6d-2e8b-432a-8b91-3d8630d6695dn@googlegroups.com>
<2682dc68-f68a-4527-b3fa-363d06f6cf29n@googlegroups.com>
<604df68d-dbd9-4c53-bb7f-be2cf1e0fe45n@googlegroups.com>
<66e20780-90f0-4d99-b4ca-7158ae3e8676n@googlegroups.com>
<27537a42-d36c-4241-8856-a784b389e442n@googlegroups.com>
<2d8e2487-c184-4c4a-b729-5e9b43d9e5b7n@googlegroups.com>
<e31ef5c0-f384-4eb1-98c1-a4191cd893b8n@googlegroups.com>
<c25e98cb-eea9-42f9-8300-6e61067ae100n@googlegroups.com>
<u3vhen$1hkjj$1@newsreader4.netcologne.de>
<7ae7a55c-7dc4-4794-b503-2c6349688d72n@googlegroups.com>
<Jq59M.606265$Ldj8.268135@fx47.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 17 May 2023 16:56:45 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2a0a-a540-2152-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2a0a:a540:2152:0:7285:c2ff:fe6c:992d";
logging-data="1696132"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Wed, 17 May 2023 16:56 UTC

EricP <ThatWouldBeTelling@thevillage.com> schrieb:
> Quadibloc wrote:
>> On Tuesday, May 16, 2023 at 3:14:28 AM UTC-6, Thomas Koenig wrote:
>>
>>> You may not be aware of this, but one of the main insights that led
>>> to the design of the 801 was that compilers for the /360 hardly ever
>>> used the complex instructions, especially complex addressing modes.
>>
>> It's hard for me to believe that base-index addressing is all that "complex",
>> and, indeed, it would seem to me to be the obvious and natural way to
>> access register elements. If the compiler doesn't use it, the problem is
>> with the compiler.
>>
>> That the string instructions, for example, were hardly used by compilers
>> is obvious enough - some of the string and packed decimal instructions,
>> though, would earn their keep if they were used in the assembly-coded
>> system subroutines to convert numbers to character form or the reverse
>> for printing and input. And I'd expect a COBOL compiler to have some
>> use for them, even if a FORTRAN compiler wouldn't.
>>
>> John Savard
>
> The Vax Fortran 77 compiler used the string instructions -
> arrays are first class types in F77 and mapped well to
> those high level instructions. Also for record/struct moves.

If you have a complex construct in a high-level language, you
can emit a library call, or you can emit a CISCy instruction
if it does the job.

That is not the problem.

It is much more problematic reconstructing such a use case from
a language which does not have that particular construct, like C.

> The MOVC5 instruction takes 5 operands:
> src len, src addr, dst len, dst addr, pad char,
> and appears designed for F77 string edits.
> (F77 string moves were defined as truncating if the
> dst was shorter than source, pad with blanks if dst longer.)

Sounds like Fortran character assignment, yes.

> Note though that F77 was an important compiler for DEC's business
> as much of their customer base was scientists and engineers.
> So they put a lot of development into that compiler.

The lineage of that compiler still exists, in Intel Fortran. Intel
took over DEC's compiler group before DEC was bought by Compaq.

> The scuttlebutt I heard at that time was IBM had multiple Fortran
> compilers and while at one time one of them was supposedly considered
> state-of-the-art, it had not been actively developed for a while.

VS Fortran wasn't bad, at the time. There is no IBM-developed
post-Fortran 77 compiler for zOS, but gfortran is available for
Linux on zSystem.

> We ported a lot of F77 from VAX to VM/CMS and the IBM compiler
> was extremely simplistic.

DEC's Fortran had a _lot_ of extensions, many of which plague
Fortran compiler writers to this day. If IBM's Fortran compilers
didn't support them, I can imagine that you had problems porting.

Re: Centrifuge instruction

<13c9fe3f-0dc4-4215-a886-ec13f69ced6cn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:620a:1709:b0:759:1240:5848 with SMTP id az9-20020a05620a170900b0075912405848mr197589qkb.15.1684345026774;
Wed, 17 May 2023 10:37:06 -0700 (PDT)
X-Received: by 2002:a4a:d115:0:b0:54f:9f36:f14b with SMTP id
k21-20020a4ad115000000b0054f9f36f14bmr8330508oor.0.1684345026323; Wed, 17 May
2023 10:37:06 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!border-1.nntp.ord.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, 17 May 2023 10:37:06 -0700 (PDT)
In-Reply-To: <u4310d$1joc4$1@newsreader4.netcologne.de>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:4d1:eccb:1b07:4583;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:4d1:eccb:1b07:4583
References: <u2016l$9b5v$1@newsreader4.netcologne.de> <u2jdvn$30fef$1@dont-email.me>
<u2mhfh$3mja7$1@dont-email.me> <u2o3hc$44ri$1@dont-email.me>
<2023May1.163832@mips.complang.tuwien.ac.at> <M9S3M.582961$5CY7.211116@fx46.iad>
<2023May1.214819@mips.complang.tuwien.ac.at> <985a755e-e984-4011-9f44-ae8e2061c347n@googlegroups.com>
<d0ec4e5b-6cc4-4d9d-9770-5d2f123e9f9dn@googlegroups.com> <285c7b6d-2e8b-432a-8b91-3d8630d6695dn@googlegroups.com>
<2682dc68-f68a-4527-b3fa-363d06f6cf29n@googlegroups.com> <604df68d-dbd9-4c53-bb7f-be2cf1e0fe45n@googlegroups.com>
<66e20780-90f0-4d99-b4ca-7158ae3e8676n@googlegroups.com> <27537a42-d36c-4241-8856-a784b389e442n@googlegroups.com>
<2d8e2487-c184-4c4a-b729-5e9b43d9e5b7n@googlegroups.com> <e31ef5c0-f384-4eb1-98c1-a4191cd893b8n@googlegroups.com>
<c25e98cb-eea9-42f9-8300-6e61067ae100n@googlegroups.com> <u3vhen$1hkjj$1@newsreader4.netcologne.de>
<7ae7a55c-7dc4-4794-b503-2c6349688d72n@googlegroups.com> <Jq59M.606265$Ldj8.268135@fx47.iad>
<u4310d$1joc4$1@newsreader4.netcologne.de>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <13c9fe3f-0dc4-4215-a886-ec13f69ced6cn@googlegroups.com>
Subject: Re: Centrifuge instruction
From: MitchAlsup@aol.com (MitchAlsup)
Injection-Date: Wed, 17 May 2023 17:37:06 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 80
X-Received-Bytes: 5680
 by: MitchAlsup - Wed, 17 May 2023 17:37 UTC

On Wednesday, May 17, 2023 at 11:58:30 AM UTC-5, Thomas Koenig wrote:
> EricP <ThatWould...@thevillage.com> schrieb:
> > Quadibloc wrote:
> >> On Tuesday, May 16, 2023 at 3:14:28 AM UTC-6, Thomas Koenig wrote:
> >>
> >>> You may not be aware of this, but one of the main insights that led
> >>> to the design of the 801 was that compilers for the /360 hardly ever
> >>> used the complex instructions, especially complex addressing modes.
> >>
> >> It's hard for me to believe that base-index addressing is all that "complex",
> >> and, indeed, it would seem to me to be the obvious and natural way to
> >> access register elements. If the compiler doesn't use it, the problem is
> >> with the compiler.
> >>
> >> That the string instructions, for example, were hardly used by compilers
> >> is obvious enough - some of the string and packed decimal instructions,
> >> though, would earn their keep if they were used in the assembly-coded
> >> system subroutines to convert numbers to character form or the reverse
> >> for printing and input. And I'd expect a COBOL compiler to have some
> >> use for them, even if a FORTRAN compiler wouldn't.
> >>
> >> John Savard
> >
> > The Vax Fortran 77 compiler used the string instructions -
> > arrays are first class types in F77 and mapped well to
> > those high level instructions. Also for record/struct moves.
<
> If you have a complex construct in a high-level language, you
> can emit a library call, or you can emit a CISCy instruction
> if it does the job.
>
> That is not the problem.
>
> It is much more problematic reconstructing such a use case from
> a language which does not have that particular construct, like C.
<
struct2 = struct1;
<
memmove( to, from, length );
<
> > The MOVC5 instruction takes 5 operands:
> > src len, src addr, dst len, dst addr, pad char,
> > and appears designed for F77 string edits.
> > (F77 string moves were defined as truncating if the
> > dst was shorter than source, pad with blanks if dst longer.)
> Sounds like Fortran character assignment, yes.
> > Note though that F77 was an important compiler for DEC's business
> > as much of their customer base was scientists and engineers.
> > So they put a lot of development into that compiler.
> The lineage of that compiler still exists, in Intel Fortran. Intel
> took over DEC's compiler group before DEC was bought by Compaq.
> > The scuttlebutt I heard at that time was IBM had multiple Fortran
> > compilers and while at one time one of them was supposedly considered
> > state-of-the-art, it had not been actively developed for a while.
<
After CRAY 1, IBM was not really in the FORTRAN game..........
Keeping the then current compiler provides support, but little
incentive to advance.
<
> VS Fortran wasn't bad, at the time. There is no IBM-developed
> post-Fortran 77 compiler for zOS, but gfortran is available for
> Linux on zSystem.
> > We ported a lot of F77 from VAX to VM/CMS and the IBM compiler
> > was extremely simplistic.
> DEC's Fortran had a _lot_ of extensions, many of which plague
> Fortran compiler writers to this day. If IBM's Fortran compilers
> didn't support them, I can imagine that you had problems porting.

Re: Centrifuge instruction

<fY89M.3233164$vBI8.91763@fx15.iad>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!1.us.feeder.erje.net!feeder.erje.net!feeder1.feed.usenet.farm!feed.usenet.farm!peer03.ams4!peer.am4.highwinds-media.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx15.iad.POSTED!not-for-mail
From: ThatWouldBeTelling@thevillage.com (EricP)
User-Agent: Thunderbird 2.0.0.24 (Windows/20100228)
MIME-Version: 1.0
Newsgroups: comp.arch
Subject: Re: Centrifuge instruction
References: <u2016l$9b5v$1@newsreader4.netcologne.de> <2023May1.163832@mips.complang.tuwien.ac.at> <M9S3M.582961$5CY7.211116@fx46.iad> <2023May1.214819@mips.complang.tuwien.ac.at> <985a755e-e984-4011-9f44-ae8e2061c347n@googlegroups.com> <d0ec4e5b-6cc4-4d9d-9770-5d2f123e9f9dn@googlegroups.com> <285c7b6d-2e8b-432a-8b91-3d8630d6695dn@googlegroups.com> <2682dc68-f68a-4527-b3fa-363d06f6cf29n@googlegroups.com> <604df68d-dbd9-4c53-bb7f-be2cf1e0fe45n@googlegroups.com> <66e20780-90f0-4d99-b4ca-7158ae3e8676n@googlegroups.com> <27537a42-d36c-4241-8856-a784b389e442n@googlegroups.com> <2d8e2487-c184-4c4a-b729-5e9b43d9e5b7n@googlegroups.com> <e31ef5c0-f384-4eb1-98c1-a4191cd893b8n@googlegroups.com> <c25e98cb-eea9-42f9-8300-6e61067ae100n@googlegroups.com> <u3vhen$1hkjj$1@newsreader4.netcologne.de> <7ae7a55c-7dc4-4794-b503-2c6349688d72n@googlegroups.com> <Jq59M.606265$Ldj8.268135@fx47.iad> <u4310d$1joc4$1@newsreader4.netcologne.de> <13c9fe3f-0dc4-4215-a886-ec13f69ced6cn@googlegroups.com>
In-Reply-To: <13c9fe3f-0dc4-4215-a886-ec13f69ced6cn@googlegroups.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Lines: 49
Message-ID: <fY89M.3233164$vBI8.91763@fx15.iad>
X-Complaints-To: abuse@UsenetServer.com
NNTP-Posting-Date: Wed, 17 May 2023 18:23:07 UTC
Date: Wed, 17 May 2023 14:22:56 -0400
X-Received-Bytes: 3985
 by: EricP - Wed, 17 May 2023 18:22 UTC

MitchAlsup wrote:
> On Wednesday, May 17, 2023 at 11:58:30 AM UTC-5, Thomas Koenig wrote:
>> EricP <ThatWould...@thevillage.com> schrieb:
>>> Quadibloc wrote:
>>>> On Tuesday, May 16, 2023 at 3:14:28 AM UTC-6, Thomas Koenig wrote:
>>>>
>>>>> You may not be aware of this, but one of the main insights that led
>>>>> to the design of the 801 was that compilers for the /360 hardly ever
>>>>> used the complex instructions, especially complex addressing modes.
>>>> It's hard for me to believe that base-index addressing is all that "complex",
>>>> and, indeed, it would seem to me to be the obvious and natural way to
>>>> access register elements. If the compiler doesn't use it, the problem is
>>>> with the compiler.
>>>>
>>>> That the string instructions, for example, were hardly used by compilers
>>>> is obvious enough - some of the string and packed decimal instructions,
>>>> though, would earn their keep if they were used in the assembly-coded
>>>> system subroutines to convert numbers to character form or the reverse
>>>> for printing and input. And I'd expect a COBOL compiler to have some
>>>> use for them, even if a FORTRAN compiler wouldn't.
>>>>
>>>> John Savard
>>> The Vax Fortran 77 compiler used the string instructions -
>>> arrays are first class types in F77 and mapped well to
>>> those high level instructions. Also for record/struct moves.
> <
>> If you have a complex construct in a high-level language, you
>> can emit a library call, or you can emit a CISCy instruction
>> if it does the job.
>>
>> That is not the problem.
>>
>> It is much more problematic reconstructing such a use case from
>> a language which does not have that particular construct, like C.
>>
>>> The scuttlebutt I heard at that time was IBM had multiple Fortran
>>> compilers and while at one time one of them was supposedly considered
>>> state-of-the-art, it had not been actively developed for a while.
> <
> After CRAY 1, IBM was not really in the FORTRAN game..........
> Keeping the then current compiler provides support, but little
> incentive to advance.

All of which is why John probably should not use an IBM F77 compiler,
apparently in maintenance mode for a while,
as the basis for deciding what compilers can or cannot do.

Re: Centrifuge instruction

<u47inf$1mqbs$1@newsreader4.netcologne.de>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2a0a-a540-2152-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoenig@netcologne.de (Thomas Koenig)
Newsgroups: comp.arch
Subject: Re: Centrifuge instruction
Date: Fri, 19 May 2023 10:23:43 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <u47inf$1mqbs$1@newsreader4.netcologne.de>
References: <u2016l$9b5v$1@newsreader4.netcologne.de>
<u2grh3$2gp8v$1@dont-email.me> <zVS2M.506047$cKvc.496132@fx42.iad>
<u2hjbj$2kg3l$1@dont-email.me> <u2jdvn$30fef$1@dont-email.me>
<u2mhfh$3mja7$1@dont-email.me> <u2o3hc$44ri$1@dont-email.me>
<2023May1.163832@mips.complang.tuwien.ac.at>
<M9S3M.582961$5CY7.211116@fx46.iad>
<2023May1.214819@mips.complang.tuwien.ac.at>
<985a755e-e984-4011-9f44-ae8e2061c347n@googlegroups.com>
<d0ec4e5b-6cc4-4d9d-9770-5d2f123e9f9dn@googlegroups.com>
<285c7b6d-2e8b-432a-8b91-3d8630d6695dn@googlegroups.com>
<2682dc68-f68a-4527-b3fa-363d06f6cf29n@googlegroups.com>
<604df68d-dbd9-4c53-bb7f-be2cf1e0fe45n@googlegroups.com>
<66e20780-90f0-4d99-b4ca-7158ae3e8676n@googlegroups.com>
<27537a42-d36c-4241-8856-a784b389e442n@googlegroups.com>
<2d8e2487-c184-4c4a-b729-5e9b43d9e5b7n@googlegroups.com>
<e31ef5c0-f384-4eb1-98c1-a4191cd893b8n@googlegroups.com>
<c25e98cb-eea9-42f9-8300-6e61067ae100n@googlegroups.com>
<u3vhen$1hkjj$1@newsreader4.netcologne.de>
Injection-Date: Fri, 19 May 2023 10:23:43 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2a0a-a540-2152-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2a0a:a540:2152:0:7285:c2ff:fe6c:992d";
logging-data="1796476"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Fri, 19 May 2023 10:23 UTC

Thomas Koenig <tkoenig@netcologne.de> schrieb:

> For example, the RISC-V code for
>
> void foo(int *p, unsigned long a, unsigned long b)
> {
> p[a+b+200]=1;
> }
>
> is
>
> add a1, a1, a2
> slli a1, a1, 2
> add a0, a0, a1
> li a1, 1
> sw a1, 800(a0)
> ret
>
> which is a pattern you can surely recognize.
>
> (Before Mitch chimes in: My 66000 could do this as
>
> add r2,r2,r3
> stw #1,[r1,r2<<2,800]
> ret
>
> although the compiler is not quite there yet).
>
> If you're feeling very adventurous, you can write a little assembler
> (using Perl, Python or another script language of your choice)
> and do some dataflow analysis for basic blocks, which value ends up
> where.

I felt adventurous, and implemented something like that - this
writes out expanded load and store addresses for RISC-V. Script is
attached below, it is probably somewhat buggy and may eat your cat,
so beware :-) The script tracks assignments to registers and writes
out load and store addresses. Every time a label or a branch is
encountered, it resets the registers to default because it cannot
make assumptions then.

It does not use a robust parser, it uses the convention on tabs
in assembly used by both gcc and clang to parse the input.

Foe example, for the input

add a1, a1, a2
lui a2, 5
addiw a2, a2, -480
addw a1, a1, a2
slli a1, a1, 2
add a0, a0, a1
lw a0, 0(a0)
ret

it produces the output

(add a0 (slli (addw (add a1 a2) 20000)) 2))

So, here are some results. I used the concatenated assembly for
Perl because it is typical of one important class of applications,
interpreters, and because I had the source lying around in
a directory.

So:

$ perl parse.pl perl_all.s > perl.lst
$ wc -l perl.lst
230051 perl.lst

Around 230000 loads and stores... Perl is rather big.

$ grep sp perl.lst | wc -l
78885

Around 1/3 of them saving and restoring from the stack.

$ grep "add.*add" perl.lst | wc -l
5095

2.2% invoving more than one addition for address calculation.

$ grep 'addi' perl.lst | wc -l
161725

70% involve adding a constant to something, presumably a register.

$ grep 'add' perl.lst | grep sll | wc -l
6976

3% involve shifted values in addressing.

And so on... quite interesting what can be done with this.

@John S: If you play around with your own ISA, you could use this
kind of script to see how much of your proposed addressing modes
could actually be used.

And here is the script, free for anybody's use. But remember I warned
about this eating cats, so no guarantees of any kind :-)

#! /usr/bin/perl -w

@regname = qw(zero ra sp gp tp t0 t1 t2 s0 s1 a0 a1 a2 a3 a4 a5 a6 a7
s2 s3 s4 s5 s6 s7 s8 s9 s10 s11 t3 t4 t5 t6);

@unsaved = qw (a0 a1 a2 a3 a4 a5 a6 a7 t0 t1 t2 t3 t4 t5 t6);

@arith = qw (addw addi add addiw slli srli sub or ori and andi mul);
@load = qw (lw lwu lh lhu lbu ld);
@store = qw(sh sw sd sb);
@mv = qw(mv lui li);

for $i (@arith) { $arith{$i} ++; }

for $i(@load) { $load{$i} ++; }

for $i(@store) { $store{$i} ++; }

for $i(@mv) { $mv{$i} ++; }

$printit = 0;

&reset_reg;

@addr = ();

$line = 0;
while (<>)
{ $line ++;
&reset_reg if (/:/);
chomp;
$i = undef;
(undef,$i,$arglist) = split("\t");
&reset_call if (defined($i) and $i eq "call");
if (defined($i) && substr($i,0,1) ne "." ) {
if ($i =~ /^b/ || $i eq 'j') {
&reset_reg;
}
if (defined($arglist)) {
@args = split(/,\s*/,$arglist);
}
else {
@args = ();
}
print $_ if ($printit) ;
if ($#args >= 0) {
print "\t;\t",$i,"\t" if ($printit);
$is_store = exists($store{$i});
$is_load = exists($load{$i});
$is_mv = exists($mv{$i});
if ($is_load || $is_store) {
$args[1] =~ /([+-]?[0-9]+|%..\([^)]+\))\(([^(]+)\)/;
$offset = $1;
$reg = $2;
$addr = "";
print $args[0],", " if ($printit) ;
if ($offset =~ /^0/ ) {
$addr = $reg{$reg};
print "(", $addr, ")" if ($printit);
}
else {
$addr = "(addi $reg{$reg} $offset)";
}
$addr = &simplify($addr);

if ($printit)
{
push (@addr,$addr);
}
else {
print $addr,"\n";
}
$reg{$args[0]} = $args[0] if $is_load;

} elsif ($is_mv) {
if ($i eq "lui") {
if ($args[1] =~ /^[+-]?[0-9]+$/) {
$reg{$args[0]} = $args[1]*4096;
}
else {
$reg{$args[0]} = "(slli $args[1] 12)";
}
}
else {
$reg{$args[0]} = $args[1];
}
print $args[0], ", ", $args[1], "\n" if ($printit); }
else {
print $args[0] if ($printit);
for $n (1..$#args) {
if (exists($reg{$args[$n]})) {
print ", $reg{$args[$n]}" if ($printit);
} else {
print ", $args[$n]" if ($printit);
}
}
if (exists($arith{$i}) && $args[0] ne "sp" ) {
if ($i =~ /addi?/ && $args[1] eq "zero") {
$reg{$args[0]} = $args[2];
}
else {
my $new = "($i " . &is_reg($args[1]) . " "
. &is_reg($args[2]) . ")";

$new = &simplify($new);
if (length($new) < 500) {
$reg{$args[0]} = $new;
}
else
{
# Reset if too long, exponential explosion for long sequences otherwise.
$reg{$args[0]} = $args[0];
}
# print $new,"\n";
}
}
print "\n" if ($printit);
}
}
}
else {
print $_, "\n" if ($printit);
}
}

print join("\n",@addr),"\n" unless $printit;

sub is_reg
{ my($name) = shift;
return exists($reg{$name}) ? $reg{$name} : $name;
} sub reset_reg
{ my $r;
# print "reset_reg\n";
# for $r (@regname) {
# print "reset $r\n" if (defined($reg{$r}) && $reg{$r} ne $r);
# };

for $r(@regname) {
$reg{$r} = $r;
}
$reg{"zero"} = '0';
}

sub reset_call
{ my $r;
for $r(@unsaved) {
$reg{$r} = $r;
}
}

sub simplify
{ my $x = shift;
$x =~ s/\(addi?\s+\(slli?\s+%hi\(([^)]+)\)\s+12\)\s+%lo\(\g1\)\)/$1/;
while ($x =~ /\(addi?w?\s+([+-]?[0-9]+)\s+([+-][0-9]+)/)
{
if (defined($1) && defined($2)) {
my $sum = $1 + $2;
$x =~ s/\(addi?w?\s+[+-]?[0-9]+\s+[+-][0-9]+/$sum/;
}
}
$x;
}

Re: Centrifuge instruction

<u47j7l$1mqbs$2@newsreader4.netcologne.de>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2a0a-a540-2152-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoenig@netcologne.de (Thomas Koenig)
Newsgroups: comp.arch
Subject: Re: Centrifuge instruction
Date: Fri, 19 May 2023 10:32:21 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <u47j7l$1mqbs$2@newsreader4.netcologne.de>
References: <u2016l$9b5v$1@newsreader4.netcologne.de>
<2023May1.163832@mips.complang.tuwien.ac.at>
<M9S3M.582961$5CY7.211116@fx46.iad>
<2023May1.214819@mips.complang.tuwien.ac.at>
<985a755e-e984-4011-9f44-ae8e2061c347n@googlegroups.com>
<d0ec4e5b-6cc4-4d9d-9770-5d2f123e9f9dn@googlegroups.com>
<285c7b6d-2e8b-432a-8b91-3d8630d6695dn@googlegroups.com>
<2682dc68-f68a-4527-b3fa-363d06f6cf29n@googlegroups.com>
<604df68d-dbd9-4c53-bb7f-be2cf1e0fe45n@googlegroups.com>
<66e20780-90f0-4d99-b4ca-7158ae3e8676n@googlegroups.com>
<27537a42-d36c-4241-8856-a784b389e442n@googlegroups.com>
<2d8e2487-c184-4c4a-b729-5e9b43d9e5b7n@googlegroups.com>
<e31ef5c0-f384-4eb1-98c1-a4191cd893b8n@googlegroups.com>
<c25e98cb-eea9-42f9-8300-6e61067ae100n@googlegroups.com>
<u3vhen$1hkjj$1@newsreader4.netcologne.de>
<7ae7a55c-7dc4-4794-b503-2c6349688d72n@googlegroups.com>
<Jq59M.606265$Ldj8.268135@fx47.iad>
<u4310d$1joc4$1@newsreader4.netcologne.de>
<13c9fe3f-0dc4-4215-a886-ec13f69ced6cn@googlegroups.com>
Injection-Date: Fri, 19 May 2023 10:32:21 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2a0a-a540-2152-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2a0a:a540:2152:0:7285:c2ff:fe6c:992d";
logging-data="1796476"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Fri, 19 May 2023 10:32 UTC

MitchAlsup <MitchAlsup@aol.com> schrieb:

> After CRAY 1, IBM was not really in the FORTRAN game..........
> Keeping the then current compiler provides support, but little
> incentive to advance.

They tried to compete with the vector facility for their 3090,
but that flopped. The 3090 that was installed at the computer
center at Karlsruhe had 150 MFlops, compared to the a few tens
of Megaflops for each workstation - and they had whole clusters
of them. No contest regarding price/performance.

IBM still has a Fortran compiler (xlf), but for POWER.

Re: Centrifuge instruction

<6b0851e8-8a4d-4b12-bba7-c25fadfd3dd3n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:ac8:5909:0:b0:3ea:d1d7:7cfa with SMTP id 9-20020ac85909000000b003ead1d77cfamr810192qty.9.1684514413549;
Fri, 19 May 2023 09:40:13 -0700 (PDT)
X-Received: by 2002:aca:da03:0:b0:394:2b51:18ed with SMTP id
r3-20020acada03000000b003942b5118edmr739452oig.2.1684514413330; Fri, 19 May
2023 09:40:13 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Fri, 19 May 2023 09:40:13 -0700 (PDT)
In-Reply-To: <u47j7l$1mqbs$2@newsreader4.netcologne.de>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:d43e:ac10:4bbf:5521;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:d43e:ac10:4bbf:5521
References: <u2016l$9b5v$1@newsreader4.netcologne.de> <2023May1.163832@mips.complang.tuwien.ac.at>
<M9S3M.582961$5CY7.211116@fx46.iad> <2023May1.214819@mips.complang.tuwien.ac.at>
<985a755e-e984-4011-9f44-ae8e2061c347n@googlegroups.com> <d0ec4e5b-6cc4-4d9d-9770-5d2f123e9f9dn@googlegroups.com>
<285c7b6d-2e8b-432a-8b91-3d8630d6695dn@googlegroups.com> <2682dc68-f68a-4527-b3fa-363d06f6cf29n@googlegroups.com>
<604df68d-dbd9-4c53-bb7f-be2cf1e0fe45n@googlegroups.com> <66e20780-90f0-4d99-b4ca-7158ae3e8676n@googlegroups.com>
<27537a42-d36c-4241-8856-a784b389e442n@googlegroups.com> <2d8e2487-c184-4c4a-b729-5e9b43d9e5b7n@googlegroups.com>
<e31ef5c0-f384-4eb1-98c1-a4191cd893b8n@googlegroups.com> <c25e98cb-eea9-42f9-8300-6e61067ae100n@googlegroups.com>
<u3vhen$1hkjj$1@newsreader4.netcologne.de> <7ae7a55c-7dc4-4794-b503-2c6349688d72n@googlegroups.com>
<Jq59M.606265$Ldj8.268135@fx47.iad> <u4310d$1joc4$1@newsreader4.netcologne.de>
<13c9fe3f-0dc4-4215-a886-ec13f69ced6cn@googlegroups.com> <u47j7l$1mqbs$2@newsreader4.netcologne.de>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <6b0851e8-8a4d-4b12-bba7-c25fadfd3dd3n@googlegroups.com>
Subject: Re: Centrifuge instruction
From: MitchAlsup@aol.com (MitchAlsup)
Injection-Date: Fri, 19 May 2023 16:40:13 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2914
 by: MitchAlsup - Fri, 19 May 2023 16:40 UTC

On Friday, May 19, 2023 at 5:34:27 AM UTC-5, Thomas Koenig wrote:
> MitchAlsup <Mitch...@aol.com> schrieb:
> > After CRAY 1, IBM was not really in the FORTRAN game..........
> > Keeping the then current compiler provides support, but little
> > incentive to advance.
<
> They tried to compete with the vector facility for their 3090,
> but that flopped. The 3090 that was installed at the computer
> center at Karlsruhe had 150 MFlops, compared to the a few tens
> of Megaflops for each workstation - and they had whole clusters
> of them. No contest regarding price/performance.
>
> IBM still has a Fortran compiler (xlf), but for POWER.
<
Yes, I was referring only to the 360-line of computers wrt Fortran

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor