Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Mausoleum: The final and funniest folly of the rich. -- Ambrose Bierce


devel / comp.arch / Re: Around the bike shed: Instruction names and assembler syntax

SubjectAuthor
* Around the bike shed: Instruction names and assembler syntaxThomas Koenig
+- Re: Around the bike shed: Instruction names and assembler syntaxTerje Mathisen
+* Re: Around the bike shed: Instruction names and assembler syntaxIvan Godard
|+- Re: Around the bike shed: Instruction names and assembler syntaxStephen Fuld
|+* Re: Around the bike shed: Instruction names and assembler syntaxThomas Koenig
||`* Re: Around the bike shed: Instruction names and assembler syntaxIvan Godard
|| `* Re: Around the bike shed: Instruction names and assembler syntaxThomas Koenig
||  `* Re: Around the bike shed: Instruction names and assembler syntaxIvan Godard
||   +* Re: Around the bike shed: Instruction names and assembler syntaxTerje Mathisen
||   |`- Re: Around the bike shed: Instruction names and assembler syntaxThomas Koenig
||   `* Fortran for The Mill (was: Around the bike shed: Instruction namesThomas Koenig
||    `- Re: Fortran for The Mill (was: Around the bike shed: InstructionIvan Godard
|`* Re: Around the bike shed: Instruction names and assembler syntaxJohn Levine
| +- Re: Around the bike shed: Instruction names and assembler syntaxIvan Godard
| +* Re: Around the bike shed: Instruction names and assembler syntaxEricP
| |`* Re: Around the bike shed: Instruction names and assembler syntaxJohn Levine
| | `* Re: Around the bike shed: Instruction names and assembler syntaxEricP
| |  `- Re: high and higner level assemblers, was Around the bike shed: Instruction nameJohn Levine
| `* Re: Around the bike shed: Instruction names and assembler syntaxThomas Koenig
|  `* Re: Around the bike shed: Instruction names and assembler syntaxIvan Godard
|   `* Re: Around the bike shed: Instruction names and assembler syntaxNiklas Holsti
|    `* Re: Around the bike shed: Instruction names and assembler syntaxIvan Godard
|     `* Re: Around the bike shed: Instruction names and assembler syntaxAnton Ertl
|      +* Re: Around the bike shed: Instruction names and assembler syntaxIvan Godard
|      |`* Re: Around the bike shed: Instruction names and assembler syntaxAnton Ertl
|      | `* Re: Around the bike shed: Instruction names and assembler syntaxIvan Godard
|      |  `* Re: Around the bike shed: Instruction names and assembler syntaxAnton Ertl
|      |   +- Re: Around the bike shed: Instruction names and assembler syntaxTerje Mathisen
|      |   `* Re: Around the bike shed: Instruction names and assembler syntaxStefan Monnier
|      |    +- Re: Around the bike shed: Instruction names and assembler syntaxIvan Godard
|      |    `* Re: Around the bike shed: Instruction names and assembler syntaxAnton Ertl
|      |     `* Re: Around the bike shed: Instruction names and assembler syntaxIvan Godard
|      |      `* Re: Around the bike shed: Instruction names and assembler syntaxAnton Ertl
|      |       `* Re: Around the bike shed: Instruction names and assembler syntaxIvan Godard
|      |        `* Re: Around the bike shed: Instruction names and assembler syntaxAnton Ertl
|      |         +* Re: Around the bike shed: Instruction names and assembler syntaxIvan Godard
|      |         |+* Re: Around the bike shed: Instruction names and assembler syntaxMitchAlsup
|      |         ||+* Re: Around the bike shed: Instruction names and assembler syntaxTim Rentsch
|      |         |||`* Re: Around the bike shed: Instruction names and assembler syntaxJohn Levine
|      |         ||| +- Re: Around the bike shed: Instruction names and assembler syntaxDavid Brown
|      |         ||| `- Re: Around the bike shed: Instruction names and assembler syntaxTim Rentsch
|      |         ||`- Re: Around the bike shed: Instruction names and assembler syntaxIvan Godard
|      |         |`* Re: Around the bike shed: Instruction names and assembler syntaxAnton Ertl
|      |         | `- Re: Around the bike shed: Instruction names and assembler syntaxIvan Godard
|      |         `* Re: Around the bike shed: Instruction names and assembler syntaxTim Rentsch
|      |          +* Re: Around the bike shed: Instruction names and assembler syntaxStefan Monnier
|      |          |`- Re: Around the bike shed: Instruction names and assembler syntaxTim Rentsch
|      |          `* Re: Around the bike shed: Instruction names and assembler syntaxAnton Ertl
|      |           +- Re: Around the bike shed: Instruction names and assembler syntaxIvan Godard
|      |           `* Re: Around the bike shed: Instruction names and assembler syntaxTim Rentsch
|      |            `- Re: Around the bike shed: Instruction names and assembler syntaxStefan Monnier
|      +* Re: Around the bike shed: Instruction names and assembler syntaxThomas Koenig
|      |`* Re: Around the bike shed: Instruction names and assembler syntaxAnton Ertl
|      | +* Re: Around the bike shed: Instruction names and assembler syntaxIvan Godard
|      | |+* Re: Around the bike shed: Instruction names and assembler syntaxThomas Koenig
|      | ||`* Re: Around the bike shed: Instruction names and assembler syntaxIvan Godard
|      | || +- Re: Around the bike shed: Instruction names and assembler syntaxMitchAlsup
|      | || `* Re: Around the bike shed: Instruction names and assembler syntaxJohn Levine
|      | ||  `- Re: Around the bike shed: Instruction names and assembler syntaxNiklas Holsti
|      | |`* Re: Around the bike shed: Instruction names and assembler syntaxAnton Ertl
|      | | `* Re: Around the bike shed: Instruction names and assembler syntaxIvan Godard
|      | |  `* Re: Around the bike shed: Instruction names and assembler syntaxAnton Ertl
|      | |   `* Re: Around the bike shed: Instruction names and assembler syntaxIvan Godard
|      | |    `- Re: Around the bike shed: Instruction names and assembler syntaxTerje Mathisen
|      | +- Re: Around the bike shed: Instruction names and assembler syntaxMitchAlsup
|      | +* Re: Around the bike shed: Instruction names and assembler syntaxNiklas Holsti
|      | |`* Re: Around the bike shed: Instruction names and assembler syntaxAnton Ertl
|      | | `- Re: Around the bike shed: Instruction names and assembler syntaxIvan Godard
|      | `* Re: Around the bike shed: Instruction names and assembler syntaxTerje Mathisen
|      |  `- Re: Around the bike shed: Instruction names and assembler syntaxThomas Koenig
|      `* Re: Around the bike shed: Instruction names and assembler syntaxTim Rentsch
|       +* Re: Around the bike shed: Instruction names and assembler syntaxNiklas Holsti
|       |`* Re: Around the bike shed: Instruction names and assembler syntaxTim Rentsch
|       | `* Re: Around the bike shed: Instruction names and assembler syntaxMitchAlsup
|       |  +* Re: Around the bike shed: Instruction names and assembler syntaxDavid Brown
|       |  |+* Re: Around the bike shed: Instruction names and assembler syntaxIvan Godard
|       |  ||+* Re: Around the bike shed: Instruction names and assembler syntaxEricP
|       |  |||+- Re: Around the bike shed: Instruction names and assembler syntaxIvan Godard
|       |  |||`* Re: Around the bike shed: Instruction names and assembler syntaxMitchAlsup
|       |  ||| +* Re: Around the bike shed: Instruction names and assembler syntaxIvan Godard
|       |  ||| |+* Re: Around the bike shed: Instruction names and assembler syntaxNiklas Holsti
|       |  ||| ||+* Re: Around the bike shed: Instruction names and assembler syntaxIvan Godard
|       |  ||| |||`* Re: Around the bike shed: Instruction names and assembler syntaxTerje Mathisen
|       |  ||| ||| +- Re: Around the bike shed: Instruction names and assembler syntaxIvan Godard
|       |  ||| ||| `- Re: Around the bike shed: Instruction names and assembler syntaxStefan Monnier
|       |  ||| ||`* Re: Around the bike shed: Instruction names and assembler syntaxDavid Brown
|       |  ||| || `* Re: Around the bike shed: Instruction names and assembler syntaxNiklas Holsti
|       |  ||| ||  +* Re: Around the bike shed: Instruction names and assembler syntaxDavid Brown
|       |  ||| ||  |`* Re: Around the bike shed: Instruction names and assembler syntaxIvan Godard
|       |  ||| ||  | `* Re: Around the bike shed: Instruction names and assembler syntaxDavid Brown
|       |  ||| ||  |  `- Re: Around the bike shed: Instruction names and assembler syntaxIvan Godard
|       |  ||| ||  `- Re: Around the bike shed: Instruction names and assembler syntaxEricP
|       |  ||| |+- Re: Around the bike shed: Instruction names and assembler syntaxMitchAlsup
|       |  ||| |`- Re: Around the bike shed: Instruction names and assembler syntaxDavid Brown
|       |  ||| `- Re: Around the bike shed: Instruction names and assembler syntaxDavid Brown
|       |  ||+- Re: Around the bike shed: Instruction names and assembler syntaxStephen Fuld
|       |  ||+* Re: Around the bike shed: Instruction names and assembler syntaxDavid Brown
|       |  |||+* Re: Around the bike shed: Instruction names and assembler syntaxMitchAlsup
|       |  ||||`* Re: Around the bike shed: Instruction names and assembler syntaxDavid Brown
|       |  |||| +* Re: Around the bike shed: Instruction names and assembler syntaxTom Gardner
|       |  |||| |+* Re: Around the bike shed: Instruction names and assembler syntaxDavid Brown
|       |  |||| |`- Re: Around the bike shed: Instruction names and assembler syntaxStefan Monnier
|       |  |||| `* Re: Around the bike shed: Instruction names and assembler syntaxIvan Godard
|       |  |||`- Re: Around the bike shed: Instruction names and assembler syntaxTerje Mathisen
|       |  ||`* Re: Around the bike shed: Instruction names and assembler syntaxAnton Ertl
|       |  |`- Re: Around the bike shed: Instruction names and assembler syntaxThomas Koenig
|       |  `- Re: Around the bike shed: Instruction names and assembler syntaxTim Rentsch
|       +* Re: Around the bike shed: Instruction names and assembler syntaxThomas Koenig
|       `* Re: Around the bike shed: Instruction names and assembler syntaxMitchAlsup
+- Re: Around the bike shed: Instruction names and assembler syntaxStefan Monnier
+* Re: Around the bike shed: Instruction names and assembler syntaxMitchAlsup
+* Re: Around the bike shed: Instruction names and assembler syntaxJames Van Buskirk
+- Re: Around the bike shed: Instruction names and assembler syntaxBGB
`* Re: Around the bike shed: Instruction names and assembler syntaxThomas Koenig

Pages:12345678910
Re: Around the bike shed: Instruction names and assembler syntax

<svjavm$cr2$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: iva...@millcomputing.com (Ivan Godard)
Newsgroups: comp.arch
Subject: Re: Around the bike shed: Instruction names and assembler syntax
Date: Mon, 28 Feb 2022 12:23:17 -0800
Organization: A noiseless patient Spider
Lines: 92
Message-ID: <svjavm$cr2$1@dont-email.me>
References: <svcqrj$jj6$1@newsreader4.netcologne.de>
<svd280$fiv$1@dont-email.me> <svgn1j$9nm$1@newsreader4.netcologne.de>
<svh0ls$d6m$1@dont-email.me> <svj1lm$q0p$1@newsreader4.netcologne.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 28 Feb 2022 20:23:18 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="7ba5d4082cb3d231a79cb55212aa6519";
logging-data="13154"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19F2j8SC07QPz4LBiCMEmhQ"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.6.1
Cancel-Lock: sha1:d7FwLIrPC8ljwZrbMXAzstaGv1Q=
In-Reply-To: <svj1lm$q0p$1@newsreader4.netcologne.de>
Content-Language: en-US
 by: Ivan Godard - Mon, 28 Feb 2022 20:23 UTC

On 2/28/2022 9:44 AM, Thomas Koenig wrote:
> Ivan Godard <ivan@millcomputing.com> schrieb:
>
>> int a;
>> int foo(int b, int c) {
>> if ((b&14) == 0)
>> a = c - 1414;
>> else
>> b += c;
>> return b;
>> }
>
> Let me see if I can reasd this:
>
>> Compiled conAsm:
>> F("foo") %0 %1;
>> formals() %0 %1,
>
> Is this an actual instruction, or some sort of
> pseudo-instruction?

A pseudo. It gives the %N belt values of the arguments an identifier
definition, so that the assembler can sanity check that every identifier
has a definition.

>
>> rd(w(1414)) %7,
>
> I assume this loads a belt entry with the constant 1414.

Yes. The terminology is "drops the four-byte value 1414 to the belt"

>> sub(b2 %1, b0 %7) %4,
>
> Hm, if I understand you correctly this is
>
> %4 = sub (b2, b0), correct? Is the target always the
> last digit after the percent sign?

digits, not digit

>
>> eqlb() %3, andl(b2 %0, 14) %2,
>> storetr(b3 %4, dp, gl("a"), b2 %3),
>> add(b5 %1, b4 %0) %6,
>> retnfl(b2 %3, b0 %6),
>> retn(b5 %0);
>
> Without further explanation, this is rather hard to read, certainly
> not your average assembler syntax :-)

That's because you have to deal with temporal addressing in these
samples, whereas the topic was asm syntax. I completely agree that
temporal is hard going, even for those that are used to it; that's why
the compiler includes helpful comment that I elided to show just the
syntax.

You could use Mill asm syntax in a genreg machine that uses spatial
addressing - just replace every instance of "bM %N" with "rN". It would
look like:
rd(w(1414)) r7,
sub(r1, r7) r4
eqlb() r3, andl(r0, 14) r22,
storetr(r4, dp, gl("a"), r3),
add(r1, r0) r6,
retnfl(r3, r6),
retn(r0);

which is probably more readable for you.

Similarly, one could have a temporal assembler with conventional syntax:
"sub %4,b2 %1,b0 %7" etc. Or omit the value tracing "%N" to get "sub
b2,b0", though trust me, you don't want to do manual value tracing in
temporal addressing - it's hard enough to do in spatial, where you have
to remember what's in which register.

>>
>> Edited to remove compiler-generated documentary comment, such as source
>> line/column numbers, belt event activity description, etc. I have left
>> in the "%N" belt value identifiers, although these can be omitted in
>> manual asm (only the "bN" temporal indices are necessary).
>
>> Note that this function comprises one bundle and takes one cycle to
>> execute on a low-midrange Mill.
>
> That is rather impressive. It would also be interesting to know
> how your compiler fares with some normal Fortran code :-)

We don't have the resources to add Fortan to the development list on our
own. However, we'd welcome a Fortran expert to join the team part time
and try it out using flang and LLVM. Hint, hint...

Re: Around the bike shed: Instruction names and assembler syntax

<svjblm$idv$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: iva...@millcomputing.com (Ivan Godard)
Newsgroups: comp.arch
Subject: Re: Around the bike shed: Instruction names and assembler syntax
Date: Mon, 28 Feb 2022 12:35:01 -0800
Organization: A noiseless patient Spider
Lines: 45
Message-ID: <svjblm$idv$1@dont-email.me>
References: <svcqrj$jj6$1@newsreader4.netcologne.de>
<svd280$fiv$1@dont-email.me> <svh2tg$j53$1@gal.iecc.com>
<svj2ki$q0p$4@newsreader4.netcologne.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 28 Feb 2022 20:35:02 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="7ba5d4082cb3d231a79cb55212aa6519";
logging-data="18879"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/ZavK36whhnYl9D78P7TkB"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.6.1
Cancel-Lock: sha1:qXE0m8gwWrwOQBliMXvhtfTbBhE=
In-Reply-To: <svj2ki$q0p$4@newsreader4.netcologne.de>
Content-Language: en-US
 by: Ivan Godard - Mon, 28 Feb 2022 20:35 UTC

On 2/28/2022 10:00 AM, Thomas Koenig wrote:
> John Levine <johnl@taugh.com> schrieb:
>> It appears that Ivan Godard <ivan@millcomputing.com> said:
>>> Or you can make the asm be similar to the syntax of a HLL, arguably more
>>> familiar to most readers than a traditional asm syntax, even one with
>>> your suggestions.
>>
>> I liked PL360 which was a S/360 assembler with a syntax similar to Algol.
>> Wirth used it to write Algol W. I used it some around 1970 at Princeton
>> which let people run small PL360 and AlgolW programs without needing an account.
>> I don't think they realized that PL360 was an assembler so you could write some
>> rather naughty programs if you wanted to.
>>
>> http://bitsavers.org/pdf/stanford/cs_techReports/STAN-CS-71-215_PL360_Rev_May72.pdf
>
> That is an interesting piece of software.
>
> I see they deviated from the usual meaning of
>
> R1 := R2 + R1
>
> which would scare me - one of FORTRAN's great achievement
> was to be able to write formulas naturally. But it is
> certainly the highest-level assembler I have seen yet.

The PL360 syntax goes only part way to a direct translation to a
sequence of machine instruction: PL360 ":=" is right-to-left, whereas
everything else is left-to-right without precedence. APL goes all the
way - everything is right-to-left without precedence, and Mary reversed
that.

Mary did everything left-to-right no precedence:
r3 := a+b*c=:d+e=:f;
gets you:
<use r3 for expression>
load
add
mul
store
add
store

Parentheses worked normally in Mary, and the parenthesized expression
could set another working register; in PL360 (IIRC) you had to use a
separate statement.

Re: Around the bike shed: Instruction names and assembler syntax

<svkmmd$t8s$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!aioe.org!UXtAIYUgaw/fkqnS/V28xg.user.46.165.242.91.POSTED!not-for-mail
From: terje.ma...@tmsw.no (Terje Mathisen)
Newsgroups: comp.arch
Subject: Re: Around the bike shed: Instruction names and assembler syntax
Date: Tue, 1 Mar 2022 09:49:24 +0100
Organization: Aioe.org NNTP Server
Message-ID: <svkmmd$t8s$1@gioia.aioe.org>
References: <svcqrj$jj6$1@newsreader4.netcologne.de>
<svd280$fiv$1@dont-email.me> <svgn1j$9nm$1@newsreader4.netcologne.de>
<svh0ls$d6m$1@dont-email.me> <svj1lm$q0p$1@newsreader4.netcologne.de>
<svjavm$cr2$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="29980"; posting-host="UXtAIYUgaw/fkqnS/V28xg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101
Firefox/68.0 SeaMonkey/2.53.10.2
X-Notice: Filtered by postfilter v. 0.9.2
 by: Terje Mathisen - Tue, 1 Mar 2022 08:49 UTC

Ivan Godard wrote:
> That's because you have to deal with temporal addressing in these
> samples, whereas the topic was asm syntax. I completely agree that
> temporal is hard going, even for those that are used to it; that's why
> the compiler includes helpful comment that I elided to show just the
> syntax.
>
> You could use Mill asm syntax in a genreg machine that uses spatial
> addressing - just replace every instance of "bM %N" with "rN". It would
> look like:
>        rd(w(1414)) r7,
>        sub(r1, r7) r4
>        eqlb() r3, andl(r0, 14) r22,
>        storetr(r4, dp, gl("a"), r3),
>        add(r1, r0) r6,
>        retnfl(r3, r6),
>        retn(r0);
>
> which is probably more readable for you.
>
> Similarly, one could have a temporal assembler with conventional syntax:
> "sub %4,b2 %1,b0 %7" etc. Or omit the value tracing "%N" to get "sub
> b2,b0", though trust me, you don't want to do manual value tracing in
> temporal addressing - it's hard enough to do in spatial, where you have
> to remember what's in which register.

That's more or less what we did back in the 8087 days, writing a
Mandelbrot generator that tried to keep everything inside the 8-slot FP
register stack. It needed a written model with a stack pointer to index
off from. The belt never seemed that much harder to me until I got into
spill/fill traffic due to belt pressure. :-)

I suspect Anton would be quite comfortable with it as well.

Terje

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

Re: Around the bike shed: Instruction names and assembler syntax

<j8666pFh0klU1@mid.individual.net>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: niklas.h...@tidorum.invalid (Niklas Holsti)
Newsgroups: comp.arch
Subject: Re: Around the bike shed: Instruction names and assembler syntax
Date: Tue, 1 Mar 2022 11:09:44 +0200
Organization: Tidorum Ltd
Lines: 104
Message-ID: <j8666pFh0klU1@mid.individual.net>
References: <svcqrj$jj6$1@newsreader4.netcologne.de>
<svd280$fiv$1@dont-email.me> <svh2tg$j53$1@gal.iecc.com>
<svj2ki$q0p$4@newsreader4.netcologne.de> <svjblm$idv$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: individual.net LbWsm76TffIFhpxzlszv9AH7sTvmgmzISnvV0zszj/47AZDIYO
Cancel-Lock: sha1:gPBFHOnGxWn5EaxzdwJOAndFU0I=
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:91.0)
Gecko/20100101 Thunderbird/91.6.0
Content-Language: en-US
In-Reply-To: <svjblm$idv$1@dont-email.me>
 by: Niklas Holsti - Tue, 1 Mar 2022 09:09 UTC

On 2022-02-28 22:35, Ivan Godard wrote:
> On 2/28/2022 10:00 AM, Thomas Koenig wrote:
>> John Levine <johnl@taugh.com> schrieb:
>>> It appears that Ivan Godard  <ivan@millcomputing.com> said:
>>>> Or you can make the asm be similar to the syntax of a HLL, arguably
>>>> more
>>>> familiar to most readers than a traditional asm syntax, even one with
>>>> your suggestions.
>>>
>>> I liked PL360 which was a S/360 assembler with a syntax similar to
>>> Algol.
>>> Wirth used it to write Algol W.  I used it some around 1970 at Princeton
>>> which let people run small PL360 and AlgolW programs without needing
>>> an account.
>>> I don't think they realized that PL360 was an assembler so you could
>>> write some
>>> rather naughty programs if you wanted to.
>>>
>>> http://bitsavers.org/pdf/stanford/cs_techReports/STAN-CS-71-215_PL360_Rev_May72.pdf
>>>
>>
>> That is an interesting piece of software.
>>
>> I see they deviated from the usual meaning of
>>
>> R1 := R2 + R1
>>
>> which would scare me - one of FORTRAN's great achievement
>> was to be able to write formulas naturally.  But it is
>> certainly the highest-level assembler I have seen yet.

In the early 1980's I defined and implemented a similar kind of language
for the Zilog Z-80, for use in the TRS-80 microcomputers. It had some
syntax modelled on Algol 68, but only the data types and operations of
the Z-80. It also used left-to-right evaluation. Branches could only use
the condition flags, named with non-alphabetic characters such as "="
for the Z (zero, equal) flag, "#" for NZ (not zero, not equal), "<" for
the C (carry, less-than) flag, and so on.

Here is an example, a procedure that compares two non-null strings
pointed to by the HL and DE register pairs (each 16 bits), respectively,
for at most the number of bytes given in the 8-bit B register. The
procedure returns the result in the flags "=" or "#". If the strings
differ, HL and DE are left pointing at the first differing position. If
the strings are equal, HL and DE are both increased by B on return.

proc Compare
(do
if A=@DE ? @HL : # then ret fi;
HL+1; DE+1
until B-1 : = od)

The body of the do-loop loads (=) the character at DE (@DE) into the
accumulator A, then compares (?) A to the character at HL, and returns
if they differ, with the "#" (NZ) result. Otherwise HL and DE are both
incremented, B is decremented, and the loop repeats if B is still
non-zero. When B is decremented to zero, the loop ends and the procedure
returns with the "=" (Z) result.

The language was called RaKo, short for Rakenteellinen Konekieli, which
is Finnish for Structured Machine Language. The language was used for
one serious application (controlling a radio-astronomical instrument)
and of course for its own compiler/assembler, boot-strapped from a
compiler/asembler written in BASIC.

The compiler/assembler produced absolute binary directly, without any
relocatable form. Instead of a linker there was a "concatenator" that
could combine separately compiled/assembled binary files into one binary
executable file.

> The PL360 syntax goes only part way to a direct translation to a
> sequence of machine instruction: PL360 ":=" is right-to-left, whereas
> everything else is left-to-right without precedence. APL goes all the
> way - everything is right-to-left without precedence, and Mary reversed
> that.
>
> Mary did everything left-to-right no precedence:
>  r3 := a+b*c=:d+e=:f;
> gets you:
>  <use r3 for expression>
>  load
>  add
>  mul
>  store
>  add
>  store

RaKo was similar, but had no "=:" operator, so instead you had to use a
separate statement to move the result into another location. I don't
remember if I had already read about Mary when I made RaKo, but I'm sure
that I did not intend to follow the Mary model -- which is not meant as
a criticism of Mary.

> Parentheses worked normally in Mary, and the parenthesized expression
> could set another working register; in PL360 (IIRC) you had to use a
> separate statement.

RaKo had no parenthesized expressions, but they could have been added
easily.

Re: Around the bike shed: Instruction names and assembler syntax

<svl27r$r8m$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: iva...@millcomputing.com (Ivan Godard)
Newsgroups: comp.arch
Subject: Re: Around the bike shed: Instruction names and assembler syntax
Date: Tue, 1 Mar 2022 04:06:18 -0800
Organization: A noiseless patient Spider
Lines: 121
Message-ID: <svl27r$r8m$1@dont-email.me>
References: <svcqrj$jj6$1@newsreader4.netcologne.de>
<svd280$fiv$1@dont-email.me> <svh2tg$j53$1@gal.iecc.com>
<svj2ki$q0p$4@newsreader4.netcologne.de> <svjblm$idv$1@dont-email.me>
<j8666pFh0klU1@mid.individual.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 1 Mar 2022 12:06:19 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="4ad2b25809f114bb61ad75419106c4f0";
logging-data="27926"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX193BWQBLKq4QasZCmiVvvW1"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.6.1
Cancel-Lock: sha1:xeGxnF/4vzEluZVULrkhL2WWAQU=
In-Reply-To: <j8666pFh0klU1@mid.individual.net>
Content-Language: en-US
 by: Ivan Godard - Tue, 1 Mar 2022 12:06 UTC

On 3/1/2022 1:09 AM, Niklas Holsti wrote:
> On 2022-02-28 22:35, Ivan Godard wrote:
>> On 2/28/2022 10:00 AM, Thomas Koenig wrote:
>>> John Levine <johnl@taugh.com> schrieb:
>>>> It appears that Ivan Godard  <ivan@millcomputing.com> said:
>>>>> Or you can make the asm be similar to the syntax of a HLL, arguably
>>>>> more
>>>>> familiar to most readers than a traditional asm syntax, even one with
>>>>> your suggestions.
>>>>
>>>> I liked PL360 which was a S/360 assembler with a syntax similar to
>>>> Algol.
>>>> Wirth used it to write Algol W.  I used it some around 1970 at
>>>> Princeton
>>>> which let people run small PL360 and AlgolW programs without needing
>>>> an account.
>>>> I don't think they realized that PL360 was an assembler so you could
>>>> write some
>>>> rather naughty programs if you wanted to.
>>>>
>>>> http://bitsavers.org/pdf/stanford/cs_techReports/STAN-CS-71-215_PL360_Rev_May72.pdf
>>>>
>>>
>>> That is an interesting piece of software.
>>>
>>> I see they deviated from the usual meaning of
>>>
>>> R1 := R2 + R1
>>>
>>> which would scare me - one of FORTRAN's great achievement
>>> was to be able to write formulas naturally.  But it is
>>> certainly the highest-level assembler I have seen yet.
>
>
> In the early 1980's I defined and implemented a similar kind of language
> for the Zilog Z-80, for use in the TRS-80 microcomputers. It had some
> syntax modelled on Algol 68, but only the data types and operations of
> the Z-80. It also used left-to-right evaluation. Branches could only use
> the condition flags, named with non-alphabetic characters such as "="
> for the Z (zero, equal) flag, "#" for NZ (not zero, not equal), "<" for
> the C (carry, less-than) flag, and so on.
>
> Here is an example, a procedure that compares two non-null strings
> pointed to by the HL and DE register pairs (each 16 bits), respectively,
> for at most the number of bytes given in the 8-bit B register. The
> procedure returns the result in the flags "=" or "#". If the strings
> differ, HL and DE are left pointing at the first differing position. If
> the strings are equal, HL and DE are both increased by B on return.
>
>    proc Compare
>    (do
>       if A=@DE ? @HL : # then ret fi;
>       HL+1; DE+1
>    until B-1 : = od)
>
> The body of the do-loop loads (=) the character at DE (@DE) into the
> accumulator A, then compares (?) A to the character at HL, and returns
> if they differ, with the "#" (NZ) result. Otherwise HL and DE are both
> incremented, B is decremented, and the loop repeats if B is still
> non-zero. When B is decremented to zero, the loop ends and the procedure
> returns with the "=" (Z) result.
>
> The language was called RaKo, short for Rakenteellinen Konekieli, which
> is Finnish for Structured Machine Language. The language was used for
> one serious application (controlling a radio-astronomical instrument)
> and of course for its own compiler/assembler, boot-strapped from a
> compiler/asembler written in BASIC.
>
> The compiler/assembler produced absolute binary directly, without any
> relocatable form. Instead of a linker there was a "concatenator" that
> could combine separately compiled/assembled binary files into one binary
> executable file.
>
>
>> The PL360 syntax goes only part way to a direct translation to a
>> sequence of machine instruction: PL360 ":=" is right-to-left, whereas
>> everything else is left-to-right without precedence. APL goes all the
>> way - everything is right-to-left without precedence, and Mary
>> reversed that.
>>
>> Mary did everything left-to-right no precedence:
>>   r3 := a+b*c=:d+e=:f;
>> gets you:
>>   <use r3 for expression>
>>   load
>>   add
>>   mul
>>   store
>>   add
>>   store
>
>
> RaKo was similar, but had no "=:" operator, so instead you had to use a
> separate statement to move the result into another location. I don't
> remember if I had already read about Mary when I made RaKo, but I'm sure
> that I did not intend to follow the Mary model -- which is not meant as
> a criticism of Mary.

Great minds run in common :-) Declarable (!) precedence was a disaster
in A68 - what's the precedence of left circular shift? - and APL pointed
the way to abandoning precedence in a language for mathematics.

>> Parentheses worked normally in Mary, and the parenthesized expression
>> could set another working register; in PL360 (IIRC) you had to use a
>> separate statement.
>
>
> RaKo had no parenthesized expressions, but they could have been added
> easily.

Shame I never heard of RaKo at the time - would have invited you to join
IFIPS WG2.4 (Machine-Oriented Languages).

Interesting to see you using if-fi and do-od. "od" was probably my most
significant contribution to A68 - pre-Revision followed A60 syntax for
loops, and I claim credit for talking WG2.1 into do-od in the Revision.
Later in Mary I extended it to "do-in-out-od", with
again-while-until-yield as intra-loop statements, made loops be value
yielding in expressions, and supported parallel looping with multiple
control variables.

Re: Around the bike shed: Instruction names and assembler syntax

<2022Mar1.133629@mips.complang.tuwien.ac.at>

  copy mid

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

  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: Around the bike shed: Instruction names and assembler syntax
Date: Tue, 01 Mar 2022 12:36:29 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 37
Message-ID: <2022Mar1.133629@mips.complang.tuwien.ac.at>
References: <svcqrj$jj6$1@newsreader4.netcologne.de> <svd280$fiv$1@dont-email.me> <svh2tg$j53$1@gal.iecc.com> <svj2ki$q0p$4@newsreader4.netcologne.de> <svjblm$idv$1@dont-email.me> <j8666pFh0klU1@mid.individual.net> <svl27r$r8m$1@dont-email.me>
Injection-Info: reader02.eternal-september.org; posting-host="1b13e76e53be42b0a18a8b2bfc514b6e";
logging-data="16691"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1919yq5/+lA0NxPjR7bYMx0"
Cancel-Lock: sha1:Z6hAjbFehaejhDKvnQ0sDHhgSfA=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Tue, 1 Mar 2022 12:36 UTC

Ivan Godard <ivan@millcomputing.com> writes:
> Declarable (!) precedence was a disaster
>in A68 - what's the precedence of left circular shift?

IMO the general concept of precedence is a disaster. You can do
implicit parenthesizing between well-established pairs of operators
(e.g., a+b*c, but not "a or b and c"), or in a few cases it's
intuitive (a<b+c, a<b and c), but that does not establish a transitive
relation (don't accept a+b and c).

My take would be to always require parenthesis when dealing with a
pair of operators that are not among the few exceptions for which a
binding relation is defined (when in doubt, don't add an exception,
e.g., for the pair of "and" and "or").

>- and APL pointed
>the way to abandoning precedence in a language for mathematics.

Always binding right-to-left is simple, and one can learn it, but it
runs counter to established practice in some cases and against
intuition in others. So it's not surprising that it did not catch on.

What is surprising to me is that C's precedences have caught on.

>Interesting to see you using if-fi and do-od. "od" was probably my most
>significant contribution to A68

And who added "fi"? Over in comp.compilers we recently had a
discussion about parser generator conflicts and the dangling-else
problem in a number of languages (e.g., Pascal and C, but not Algol
60); apparently fi was too late for Pascal and C, but it made it into
Modula. Unfortunately it was never fixed in the C descendants.

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

Re: Around the bike shed: Instruction names and assembler syntax

<svl6qh$t5b$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: iva...@millcomputing.com (Ivan Godard)
Newsgroups: comp.arch
Subject: Re: Around the bike shed: Instruction names and assembler syntax
Date: Tue, 1 Mar 2022 05:24:32 -0800
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <svl6qh$t5b$1@dont-email.me>
References: <svcqrj$jj6$1@newsreader4.netcologne.de>
<svd280$fiv$1@dont-email.me> <svh2tg$j53$1@gal.iecc.com>
<svj2ki$q0p$4@newsreader4.netcologne.de> <svjblm$idv$1@dont-email.me>
<j8666pFh0klU1@mid.individual.net> <svl27r$r8m$1@dont-email.me>
<2022Mar1.133629@mips.complang.tuwien.ac.at>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 1 Mar 2022 13:24:33 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="4ad2b25809f114bb61ad75419106c4f0";
logging-data="29867"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+G+aZItN1L5hAjTU4ydU8r"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.6.1
Cancel-Lock: sha1:0Xr2yiyFbVQ6pzM5f15OzeLud2I=
In-Reply-To: <2022Mar1.133629@mips.complang.tuwien.ac.at>
Content-Language: en-US
 by: Ivan Godard - Tue, 1 Mar 2022 13:24 UTC

On 3/1/2022 4:36 AM, Anton Ertl wrote:
> Ivan Godard <ivan@millcomputing.com> writes:

>> Interesting to see you using if-fi and do-od. "od" was probably my most
>> significant contribution to A68
>
> And who added "fi"?

That was before my time in WG2.1 - I came in after the Great Schism and
during the Revision, not the initial Report. However IIRC Steve Bourne
was the major instigator, but he went with the schismatics.

> Over in comp.compilers we recently had a
> discussion about parser generator conflicts and the dangling-else
> problem in a number of languages (e.g., Pascal and C, but not Algol
> 60); apparently fi was too late for Pascal and C, but it made it into
> Modula. Unfortunately it was never fixed in the C descendants.

Wirth was a schismatic too, and never accepted VWG - "fi" was a little
easier to swallow? :-)

Fortran for The Mill (was: Around the bike shed: Instruction names and assembler syntax)

<svlm02$i3a$2@newsreader4.netcologne.de>

  copy mid

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

  copy link   Newsgroups: comp.arch comp.lang.fortran
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2a0a-a540-c7b-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoe...@netcologne.de (Thomas Koenig)
Newsgroups: comp.arch,comp.lang.fortran
Subject: Fortran for The Mill (was: Around the bike shed: Instruction names
and assembler syntax)
Date: Tue, 1 Mar 2022 17:43:30 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <svlm02$i3a$2@newsreader4.netcologne.de>
References: <svcqrj$jj6$1@newsreader4.netcologne.de>
<svd280$fiv$1@dont-email.me> <svgn1j$9nm$1@newsreader4.netcologne.de>
<svh0ls$d6m$1@dont-email.me> <svj1lm$q0p$1@newsreader4.netcologne.de>
<svjavm$cr2$1@dont-email.me>
Injection-Date: Tue, 1 Mar 2022 17:43:30 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2a0a-a540-c7b-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2a0a:a540:c7b:0:7285:c2ff:fe6c:992d";
logging-data="18538"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Tue, 1 Mar 2022 17:43 UTC

Ivan Godard <ivan@millcomputing.com> schrieb:

I have cross-posted this to comp.lang.fortran, maybe a volunteer will
step up there :-)

> We don't have the resources to add Fortan to the development list on our
> own. However, we'd welcome a Fortran expert to join the team part time
> and try it out using flang and LLVM. Hint, hint...

Thanks for the implied offer :-) but I think I will have to restrict
myself a bit there. I know gfortran fairly well, but getting into
flang (especially the old compiler, which is the only one that
produces workable code at the moment) is a bit more than I can do.

I can certainly provide you with *.ll files for the Polyhedron
benchmarks, for example, but the recipe for that is very simple:
Download the Polyhedron benchmarks (easy to google), unpack, cd to the
source directoy for Linux, run "flang -S -O2 -emit-llvm fatigue2.f90" (for
example), and you're set. Any of the *.f90 files are self-contained,
so you can inspect them and see what makes sense (which was enough
for me to submit a couple of github issues for My 66000).

As for running, this would require building the library, and I
have no experience at all setting up flang, which I believe is
separate from the mainline LLVM compiler.

However, if you get a gcc port running (you previously mentioned
that any compiler could, in principle, generate genAsm), I will
be happy to assist you in all matters gfortran. The same offer
also goes Mitch's My 66000, of course. I have a fondness for
unconventional architectures, which is why I hang out on comp.arch,
and which is also why I helped IBM in adapting gfortran on POWER to
IEEE 128-bit reals recently, which will be in the upcoming gcc 12.

Re: Around the bike shed: Instruction names and assembler syntax

<2022Mar1.184731@mips.complang.tuwien.ac.at>

  copy mid

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

  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: Around the bike shed: Instruction names and assembler syntax
Date: Tue, 01 Mar 2022 17:47:31 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 32
Message-ID: <2022Mar1.184731@mips.complang.tuwien.ac.at>
References: <svcqrj$jj6$1@newsreader4.netcologne.de> <svd280$fiv$1@dont-email.me> <svh2tg$j53$1@gal.iecc.com> <svj2ki$q0p$4@newsreader4.netcologne.de> <svjblm$idv$1@dont-email.me> <j8666pFh0klU1@mid.individual.net> <svl27r$r8m$1@dont-email.me> <2022Mar1.133629@mips.complang.tuwien.ac.at> <svl6qh$t5b$1@dont-email.me>
Injection-Info: reader02.eternal-september.org; posting-host="1b13e76e53be42b0a18a8b2bfc514b6e";
logging-data="12356"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18P1+3FCvzl/qnziEelRr+4"
Cancel-Lock: sha1:56z5OKKcOpSJf373MgDrBYGD86M=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Tue, 1 Mar 2022 17:47 UTC

Ivan Godard <ivan@millcomputing.com> writes:
>On 3/1/2022 4:36 AM, Anton Ertl wrote:
>> Over in comp.compilers we recently had a
>> discussion about parser generator conflicts and the dangling-else
>> problem in a number of languages (e.g., Pascal and C, but not Algol
>> 60); apparently fi was too late for Pascal and C, but it made it into
>> Modula. Unfortunately it was never fixed in the C descendants.
>
>Wirth was a schismatic too, and never accepted VWG

And nobody else has, either. From hindsight it seems that the later
languages were much more in line with the schismatics than with those
who stayed on Algol 68. But maybe I just don't know Algol 68 enough
to see all its features that eventually made it into mainstream
languages.

>- "fi" was a little
>easier to swallow? :-)

Sure, dangling else is an obvious blemish, the Algol 60 solution is
not so nice, either. Closing control structures rather than using
blocks for them is more practical in any case: You can simply add a
statement into a control structure without having to possiby add BEGIN
and END or { and }.

Actually Wirth uses END (not fi, od etc.) for everything that has a
statement sequence.

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

Re: Around the bike shed: Instruction names and assembler syntax

<svlsr2$ebn$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: iva...@millcomputing.com (Ivan Godard)
Newsgroups: comp.arch
Subject: Re: Around the bike shed: Instruction names and assembler syntax
Date: Tue, 1 Mar 2022 11:40:17 -0800
Organization: A noiseless patient Spider
Lines: 52
Message-ID: <svlsr2$ebn$1@dont-email.me>
References: <svcqrj$jj6$1@newsreader4.netcologne.de>
<svd280$fiv$1@dont-email.me> <svh2tg$j53$1@gal.iecc.com>
<svj2ki$q0p$4@newsreader4.netcologne.de> <svjblm$idv$1@dont-email.me>
<j8666pFh0klU1@mid.individual.net> <svl27r$r8m$1@dont-email.me>
<2022Mar1.133629@mips.complang.tuwien.ac.at> <svl6qh$t5b$1@dont-email.me>
<2022Mar1.184731@mips.complang.tuwien.ac.at>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 1 Mar 2022 19:40:18 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="4ad2b25809f114bb61ad75419106c4f0";
logging-data="14711"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Tt7USv2QBnFCfT+W29Ch1"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.6.1
Cancel-Lock: sha1:4zsTMSD8Q29Kmq4mIEmSpGuBQeY=
In-Reply-To: <2022Mar1.184731@mips.complang.tuwien.ac.at>
Content-Language: en-US
 by: Ivan Godard - Tue, 1 Mar 2022 19:40 UTC

On 3/1/2022 9:47 AM, Anton Ertl wrote:
> Ivan Godard <ivan@millcomputing.com> writes:
>> On 3/1/2022 4:36 AM, Anton Ertl wrote:
>>> Over in comp.compilers we recently had a
>>> discussion about parser generator conflicts and the dangling-else
>>> problem in a number of languages (e.g., Pascal and C, but not Algol
>>> 60); apparently fi was too late for Pascal and C, but it made it into
>>> Modula. Unfortunately it was never fixed in the C descendants.
>>
>> Wirth was a schismatic too, and never accepted VWG
>
> And nobody else has, either. From hindsight it seems that the later
> languages were much more in line with the schismatics than with those
> who stayed on Algol 68. But maybe I just don't know Algol 68 enough
> to see all its features that eventually made it into mainstream
> languages.

It turns out that *any* formal specification of language semantics is
beyond usual mortal ken; try reading Denotational Semantics someday :-)

When I was on the Green team (which became Ada), the subject of how we
would describe the semantics came up (BNF for syntax of course). I asked
"Maybe VWG?"
"Non, en Francaise!"
"But the reviewers don't speak French."
"So English."
"But it will be ambiguous, even with our greatest care."
(Ichbiah): " No matter - they will have paid us before they figure that
out, and then they can pay us again to fix it."

Of the various formalities I prefer VWG, and still consider it to have
been a massive advance in formal theory. Politically and marketly
however... :-(

>
>> - "fi" was a little
>> easier to swallow? :-)
>
> Sure, dangling else is an obvious blemish, the Algol 60 solution is
> not so nice, either. Closing control structures rather than using
> blocks for them is more practical in any case: You can simply add a
> statement into a control structure without having to possiby add BEGIN
> and END or { and }.

Agreed - that was Mary syntax too.

> Actually Wirth uses END (not fi, od etc.) for everything that has a
> statement sequence.
>
> - anton

Re: Fortran for The Mill (was: Around the bike shed: Instruction names and assembler syntax)

<svlsvf$ebn$2@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch comp.lang.fortran
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: iva...@millcomputing.com (Ivan Godard)
Newsgroups: comp.arch,comp.lang.fortran
Subject: Re: Fortran for The Mill (was: Around the bike shed: Instruction
names and assembler syntax)
Date: Tue, 1 Mar 2022 11:42:40 -0800
Organization: A noiseless patient Spider
Lines: 36
Message-ID: <svlsvf$ebn$2@dont-email.me>
References: <svcqrj$jj6$1@newsreader4.netcologne.de>
<svd280$fiv$1@dont-email.me> <svgn1j$9nm$1@newsreader4.netcologne.de>
<svh0ls$d6m$1@dont-email.me> <svj1lm$q0p$1@newsreader4.netcologne.de>
<svjavm$cr2$1@dont-email.me> <svlm02$i3a$2@newsreader4.netcologne.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 1 Mar 2022 19:42:39 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="4ad2b25809f114bb61ad75419106c4f0";
logging-data="14711"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX195Kyz1O0GoAxkAbi1Vs11j"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.6.1
Cancel-Lock: sha1:Pmvz6ZoPkgwCsdIOJb1y/H7y4tU=
In-Reply-To: <svlm02$i3a$2@newsreader4.netcologne.de>
Content-Language: en-US
 by: Ivan Godard - Tue, 1 Mar 2022 19:42 UTC

On 3/1/2022 9:43 AM, Thomas Koenig wrote:
> Ivan Godard <ivan@millcomputing.com> schrieb:
>
> I have cross-posted this to comp.lang.fortran, maybe a volunteer will
> step up there :-)
>
>> We don't have the resources to add Fortan to the development list on our
>> own. However, we'd welcome a Fortran expert to join the team part time
>> and try it out using flang and LLVM. Hint, hint...
>
> Thanks for the implied offer :-) but I think I will have to restrict
> myself a bit there. I know gfortran fairly well, but getting into
> flang (especially the old compiler, which is the only one that
> produces workable code at the moment) is a bit more than I can do.
>
> I can certainly provide you with *.ll files for the Polyhedron
> benchmarks, for example, but the recipe for that is very simple:
> Download the Polyhedron benchmarks (easy to google), unpack, cd to the
> source directoy for Linux, run "flang -S -O2 -emit-llvm fatigue2.f90" (for
> example), and you're set. Any of the *.f90 files are self-contained,
> so you can inspect them and see what makes sense (which was enough
> for me to submit a couple of github issues for My 66000).
>
> As for running, this would require building the library, and I
> have no experience at all setting up flang, which I believe is
> separate from the mainline LLVM compiler.
>
> However, if you get a gcc port running (you previously mentioned
> that any compiler could, in principle, generate genAsm), I will
> be happy to assist you in all matters gfortran. The same offer
> also goes Mitch's My 66000, of course. I have a fondness for
> unconventional architectures, which is why I hang out on comp.arch,
> and which is also why I helped IBM in adapting gfortran on POWER to
> IEEE 128-bit reals recently, which will be in the upcoming gcc 12.

Someday, but not until more talent or more money :-)

Re: Around the bike shed: Instruction names and assembler syntax

<svn3h8$hgu$2@newsreader4.netcologne.de>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!news.freedyn.de!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2a0a-a540-c7b-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoe...@netcologne.de (Thomas Koenig)
Newsgroups: comp.arch
Subject: Re: Around the bike shed: Instruction names and assembler syntax
Date: Wed, 2 Mar 2022 06:40:40 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <svn3h8$hgu$2@newsreader4.netcologne.de>
References: <svcqrj$jj6$1@newsreader4.netcologne.de>
<svd280$fiv$1@dont-email.me> <svgn1j$9nm$1@newsreader4.netcologne.de>
<svh0ls$d6m$1@dont-email.me> <svj1lm$q0p$1@newsreader4.netcologne.de>
<svjavm$cr2$1@dont-email.me> <svkmmd$t8s$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 2 Mar 2022 06:40:40 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2a0a-a540-c7b-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2a0a:a540:c7b:0:7285:c2ff:fe6c:992d";
logging-data="17950"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Wed, 2 Mar 2022 06:40 UTC

Terje Mathisen <terje.mathisen@tmsw.no> schrieb:
> Ivan Godard wrote:
>> That's because you have to deal with temporal addressing in these
>> samples, whereas the topic was asm syntax. I completely agree that
>> temporal is hard going, even for those that are used to it; that's why
>> the compiler includes helpful comment that I elided to show just the
>> syntax.
>>
>> You could use Mill asm syntax in a genreg machine that uses spatial
>> addressing - just replace every instance of "bM %N" with "rN". It would
>> look like:
>>        rd(w(1414)) r7,
>>        sub(r1, r7) r4
>>        eqlb() r3, andl(r0, 14) r22,
>>        storetr(r4, dp, gl("a"), r3),
>>        add(r1, r0) r6,
>>        retnfl(r3, r6),
>>        retn(r0);
>>
>> which is probably more readable for you.
>>
>> Similarly, one could have a temporal assembler with conventional syntax:
>> "sub %4,b2 %1,b0 %7" etc. Or omit the value tracing "%N" to get "sub
>> b2,b0", though trust me, you don't want to do manual value tracing in
>> temporal addressing - it's hard enough to do in spatial, where you have
>> to remember what's in which register.
>
> That's more or less what we did back in the 8087 days, writing a
> Mandelbrot generator that tried to keep everything inside the 8-slot FP
> register stack.

Ah, who didn't write Mandelbrot generators in those days...

One of the few assembler programs I wrote for the C64 was a
Mandelbrot generator which used the floating-point routines
built into the BASIC. Made about a factor of 10 difference
vs. the BASIC version. I gave that up after a friend's Amiga
was way faster in BASIC than my C64 version.

Later, for training and familiarization purposes (ahem) I wrote
a version for a vector computer, trying to find the right balance
between operations and gather/scatter (no sense in iterating over
something that had already converged). Output was on the 300 dpi
laser printer that the computer center had (what luxury!)

Re: Around the bike shed: Instruction names and assembler syntax

<nLf*r48Hy@news.chiark.greenend.org.uk>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!paganini.bofh.team!news.freedyn.de!nntp.terraraq.uk!nntp-feed.chiark.greenend.org.uk!ewrotcd!.POSTED!not-for-mail
From: theom+n...@chiark.greenend.org.uk (Theo Markettos)
Newsgroups: comp.arch
Subject: Re: Around the bike shed: Instruction names and assembler syntax
Date: 02 Mar 2022 09:26:29 +0000 (GMT)
Organization: University of Cambridge, England
Lines: 52
Distribution: world
Message-ID: <nLf*r48Hy@news.chiark.greenend.org.uk>
References: <svcqrj$jj6$1@newsreader4.netcologne.de> <memo.20220226104336.7708a@jgd.cix.co.uk> <svgqq7$cll$1@newsreader4.netcologne.de>
NNTP-Posting-Host: chiark.greenend.org.uk
X-Trace: chiark.greenend.org.uk 1646213192 18907 212.13.197.229 (2 Mar 2022 09:26:32 GMT)
X-Complaints-To: abuse@chiark.greenend.org.uk
NNTP-Posting-Date: Wed, 2 Mar 2022 09:26:32 +0000 (UTC)
User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (Linux/3.16.0-11-amd64 (x86_64))
Originator: theom@chiark.greenend.org.uk ([212.13.197.229])
 by: Theo Markettos - Wed, 2 Mar 2022 09:26 UTC

Thomas Koenig <tkoenig@netcologne.de> wrote:
> John Dallman <jgd@cix.co.uk> schrieb:
> > In article <svcqrj$jj6$1@newsreader4.netcologne.de>,
> > tkoenig@netcologne.de (Thomas Koenig) wrote:
> >
> >> If two instructions have a different encoding, they should have a
> >> different name. Apart from making an assembler marginally easier
> >> to write, this also makes clear what size an instruction is, if
> >> it has immediates.
> >
> > This hinges on what an assembly language is optimised for. Is it a
> > higher-level expression of a sequence of instructions, or a low-level
> > representation of a program? Those aren't quite the same thing, although
> > assembly languages do both duties.
>
> I would say the latter, except when using macros.

I think there's scope for doing both. Have a programmer friendly form that
elides some of the tedious details (eg it's fine to use ADD with an
immediate without calling it ADDI).

And then have a normalised form that has a 1:1 translation to the
instruction bit patterns. The normalised form is useful when you're for
example disassembling and reassembling a binary: it means that process will
produce exactly the same binary, without leaving any wiggle room for
different choices by the assembler.

You could maybe take that too far, eg on 32 bit ARM:

ADR r3, label

might disassemble to:

ADD r3, pc, #0x200

but the really anal normalised version might be:

ADDAL r3, r15, #0x2 LSL 8

Perhaps the middle form would be OK, as long as convention describes exactly
how eg intermediate constants are represented, so there is no ambiguity.
If the disassembler came across an instruction that represent it as:

ADD r3, pc, #0x20 LSL 4

that would need a different disassembly format (like the above, perhaps).

(32 bit ARM is interesting as it was designed to be nice to program in
assembly, a consideration not normally part of instruction set design these
days)

Theo

Re: Around the bike shed: Instruction names and assembler syntax

<svnjsl$qpu$1@newsreader4.netcologne.de>

  copy mid

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

  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-c7b-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoe...@netcologne.de (Thomas Koenig)
Newsgroups: comp.arch
Subject: Re: Around the bike shed: Instruction names and assembler syntax
Date: Wed, 2 Mar 2022 11:19:49 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <svnjsl$qpu$1@newsreader4.netcologne.de>
References: <svcqrj$jj6$1@newsreader4.netcologne.de>
<svd280$fiv$1@dont-email.me> <svh2tg$j53$1@gal.iecc.com>
<svj2ki$q0p$4@newsreader4.netcologne.de> <svjblm$idv$1@dont-email.me>
<j8666pFh0klU1@mid.individual.net> <svl27r$r8m$1@dont-email.me>
<2022Mar1.133629@mips.complang.tuwien.ac.at>
Injection-Date: Wed, 2 Mar 2022 11:19:49 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2a0a-a540-c7b-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2a0a:a540:c7b:0:7285:c2ff:fe6c:992d";
logging-data="27454"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Wed, 2 Mar 2022 11:19 UTC

Anton Ertl <anton@mips.complang.tuwien.ac.at> schrieb:
> Ivan Godard <ivan@millcomputing.com> writes:
>> Declarable (!) precedence was a disaster
>>in A68 - what's the precedence of left circular shift?
>
> IMO the general concept of precedence is a disaster. You can do
> implicit parenthesizing between well-established pairs of operators
> (e.g., a+b*c,

You should.

FORTRAN pretty much settled this question. Evaluating a formula
in any other way is a desaster. This was one of the biggest steps
that FORTRAN took. Earlier programming languages which did
not have that features invited programming errors.

> but not "a or b and c"),

and is multiplication, or is (saturating) addition, so the precedence
is intuitive (at least if the relationship above is intuitive).

> or in a few cases it's
> intuitive (a<b+c, a<b and c), but that does not establish a transitive
> relation (don't accept a+b and c).

Conflating of numeric anc logical types is a misfeature rather specific
to C and its decendants. Introduce a distinct logical type and most
problems of that kind go away.

Re: Around the bike shed: Instruction names and assembler syntax

<ANidnT3Kb-ZszoL_nZ2dnUU7-LHNnZ2d@supernews.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!buffer2.nntp.dca1.giganews.com!buffer1.nntp.dca1.giganews.com!nntp.supernews.com!news.supernews.com.POSTED!not-for-mail
NNTP-Posting-Date: Wed, 02 Mar 2022 05:24:33 -0600
Sender: Andrew Haley <aph@zarquon.pink>
From: aph...@littlepinkcloud.invalid
Subject: Re: Around the bike shed: Instruction names and assembler syntax
Newsgroups: comp.arch
References: <svcqrj$jj6$1@newsreader4.netcologne.de> <memo.20220226104336.7708a@jgd.cix.co.uk> <svgqq7$cll$1@newsreader4.netcologne.de> <nLf*r48Hy@news.chiark.greenend.org.uk>
Distribution: world
User-Agent: tin/1.9.2-20070201 ("Dalaruan") (UNIX) (Linux/4.18.0-305.25.1.el8_4.x86_64 (x86_64))
Message-ID: <ANidnT3Kb-ZszoL_nZ2dnUU7-LHNnZ2d@supernews.com>
Date: Wed, 02 Mar 2022 05:24:33 -0600
Lines: 16
X-Trace: sv3-KCC9LyXmL8UZtLI+buGSmdPnGhUn9vlMU/cWS0RS3V5zv0L3kZYj+d75npyUCl8m877Dj03Wt3hWKrT!jbBAqFXY4kSZYRmxwNyaLv1C7ojEPhi3gu37D1Jw3J6joVe4xW+u0EyXEKK4HW6XK8ZX+3Xu25pb!EM7o/QtH
X-Complaints-To: www.supernews.com/docs/abuse.html
X-DMCA-Complaints-To: www.supernews.com/docs/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 1870
 by: aph...@littlepinkcloud.invalid - Wed, 2 Mar 2022 11:24 UTC

Theo Markettos <theom+news@chiark.greenend.org.uk> wrote:
>
> (32 bit ARM is interesting as it was designed to be nice to program
> in assembly, a consideration not normally part of instruction set
> design these days)

That's an interesting point. In my experience 64-bit ARM is as nice to
program in assembly, at least as far as the set of base instructions
goes, even though there are more instructions.

I also believe that if an instruction set is nice to program in
assembly, it's also nice to write a code generator for. Tweako
special-case instructions are a pain to remember, but they're also a
pain to generate code for automatically.

Andrew.

Re: Around the bike shed: Instruction names and assembler syntax

<2022Mar2.182320@mips.complang.tuwien.ac.at>

  copy mid

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

  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: Around the bike shed: Instruction names and assembler syntax
Date: Wed, 02 Mar 2022 17:23:20 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 21
Message-ID: <2022Mar2.182320@mips.complang.tuwien.ac.at>
References: <svcqrj$jj6$1@newsreader4.netcologne.de> <svd280$fiv$1@dont-email.me> <svh2tg$j53$1@gal.iecc.com> <svj2ki$q0p$4@newsreader4.netcologne.de> <svjblm$idv$1@dont-email.me> <j8666pFh0klU1@mid.individual.net> <svl27r$r8m$1@dont-email.me> <2022Mar1.133629@mips.complang.tuwien.ac.at> <svl6qh$t5b$1@dont-email.me> <2022Mar1.184731@mips.complang.tuwien.ac.at> <svlsr2$ebn$1@dont-email.me>
Injection-Info: reader02.eternal-september.org; posting-host="58f5aa2b81cd968f124b82d9145f6dbd";
logging-data="13761"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/SbZUSqSjwNK1RUc7YTbBd"
Cancel-Lock: sha1:RsjtivMYmWFEaJSn3aob2H1gwbY=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Wed, 2 Mar 2022 17:23 UTC

Ivan Godard <ivan@millcomputing.com> writes:
>It turns out that *any* formal specification of language semantics is
>beyond usual mortal ken; try reading Denotational Semantics someday :-)

I have. Did not find it inspiring.

I think that formal stuff can be ok for certain aspects; (E)BNF is the
poster child for that, although the informal specification of the
resolution of the dangling else problem by Wirth demonstrates that
even EBNF is occasionally too complicated.

I have just looked at PSHUFB
<https://www.felixcloutier.com/x86/pshufb>, and I found the
operational semantics more enlightening than the prose. So there are
cases where formal stuff is competetive. But in most cases it's too
unwieldy.

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

Re: Around the bike shed: Instruction names and assembler syntax

<2022Mar2.184051@mips.complang.tuwien.ac.at>

  copy mid

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

  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: Around the bike shed: Instruction names and assembler syntax
Date: Wed, 02 Mar 2022 17:40:51 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 57
Distribution: world
Message-ID: <2022Mar2.184051@mips.complang.tuwien.ac.at>
References: <svcqrj$jj6$1@newsreader4.netcologne.de> <svd280$fiv$1@dont-email.me> <svh2tg$j53$1@gal.iecc.com> <svj2ki$q0p$4@newsreader4.netcologne.de> <svjblm$idv$1@dont-email.me> <j8666pFh0klU1@mid.individual.net> <svl27r$r8m$1@dont-email.me> <2022Mar1.133629@mips.complang.tuwien.ac.at> <svnjsl$qpu$1@newsreader4.netcologne.de>
Injection-Info: reader02.eternal-september.org; posting-host="58f5aa2b81cd968f124b82d9145f6dbd";
logging-data="11627"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX183Ps7t5ihGwQ/YSBRzSHoQ"
Cancel-Lock: sha1:/m6H16jeyK8xO3w8hMo0gHcTEe0=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Wed, 2 Mar 2022 17:40 UTC

Thomas Koenig <tkoenig@netcologne.de> writes:
>Anton Ertl <anton@mips.complang.tuwien.ac.at> schrieb:
>> Ivan Godard <ivan@millcomputing.com> writes:
>>> Declarable (!) precedence was a disaster
>>>in A68 - what's the precedence of left circular shift?
>>
>> IMO the general concept of precedence is a disaster. You can do
>> implicit parenthesizing between well-established pairs of operators
>> (e.g., a+b*c,
>
>You should.
>
>FORTRAN pretty much settled this question. Evaluating a formula
>in any other way is a desaster.

What disaster would ensue from not accepting a+b*c and instead
requiring a+(b*c)? However, it seems to me that the relative
precedences of + and * and widely-enough known that accepting a+b*c
instead does not cause problems.

>> but not "a or b and c"),
>
>and is multiplication, or is (saturating) addition, so the precedence
>is intuitive (at least if the relationship above is intuitive).

It's not at all intuitive, and I expect that

* newbies relatively frequently make mistakes when they rely on precedence.

* experienced programmers and more cautious newbies use parentheses to
make it clear whether they want "(a or b) and c" or "a or (b and c)".

>> or in a few cases it's
>> intuitive (a<b+c, a<b and c), but that does not establish a transitive
>> relation (don't accept a+b and c).
>
>Conflating of numeric anc logical types is a misfeature rather specific
>to C and its decendants.

I have made productive use of treating the results of comparisons as
numbers or masks, so I think it's a feature. The misfeature in C is a
syntax that accepts "a+b&c".

>Introduce a distinct logical type and most
>problems of that kind go away.

They don't, because the parser does not perform type checking. In
particular, Modula-2 has a separate type BOOLEAN, and its parser
accepts "a+b AND c"; yes, it does report a type error for it, but it
also reports a type error for "a<b and c" if a, b are INTEGER, and c
is BOOLEAN. Of course, the latter misfeature would be much worse if
BOOLEAN was compatible with INTEGER.

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

Re: Around the bike shed: Instruction names and assembler syntax

<2022Mar2.190044@mips.complang.tuwien.ac.at>

  copy mid

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

  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: Around the bike shed: Instruction names and assembler syntax
Date: Wed, 02 Mar 2022 18:00:44 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 18
Distribution: world
Message-ID: <2022Mar2.190044@mips.complang.tuwien.ac.at>
References: <svcqrj$jj6$1@newsreader4.netcologne.de> <memo.20220226104336.7708a@jgd.cix.co.uk> <svgqq7$cll$1@newsreader4.netcologne.de> <nLf*r48Hy@news.chiark.greenend.org.uk> <ANidnT3Kb-ZszoL_nZ2dnUU7-LHNnZ2d@supernews.com>
Injection-Info: reader02.eternal-september.org; posting-host="58f5aa2b81cd968f124b82d9145f6dbd";
logging-data="11627"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX189YCiEeiR0t1GkrTyon8qV"
Cancel-Lock: sha1:vnpMkUCeZDkqi4Hny3HzPycBQV8=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Wed, 2 Mar 2022 18:00 UTC

aph@littlepinkcloud.invalid writes:
>I also believe that if an instruction set is nice to program in
>assembly, it's also nice to write a code generator for. Tweako
>special-case instructions are a pain to remember, but they're also a
>pain to generate code for automatically.

I think it depends on what concept of niceness the programmer has in
mind. If a programmer finds a use for such an instruction, they may
pride themselves in their knowledge. You see a similar phenomenon in
the "undefined behaviour" debate (comp.arch law satisfied), where some
pride themselves in knowing (or believing they know) the undefined
behaviour and how to avoid it, and claim that it is very important for
performance in order to make this knowledge seem relevant.

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

Re: Around the bike shed: Instruction names and assembler syntax

<svodqv$rc$1@dont-email.me>

  copy mid

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

  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: Around the bike shed: Instruction names and assembler syntax
Date: Wed, 2 Mar 2022 10:42:39 -0800
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <svodqv$rc$1@dont-email.me>
References: <svcqrj$jj6$1@newsreader4.netcologne.de>
<memo.20220226104336.7708a@jgd.cix.co.uk>
<svgqq7$cll$1@newsreader4.netcologne.de>
<nLf*r48Hy@news.chiark.greenend.org.uk>
<ANidnT3Kb-ZszoL_nZ2dnUU7-LHNnZ2d@supernews.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 2 Mar 2022 18:42:39 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="618ac8c3c579c6d3ff5aca798a93b9ac";
logging-data="876"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/uAsqjZ5m4w/RiRJtV+aDQK1vNRa/4uT0="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.6.1
Cancel-Lock: sha1:Nq8lu7jLg4waAqM1y5/C7IHx7p0=
In-Reply-To: <ANidnT3Kb-ZszoL_nZ2dnUU7-LHNnZ2d@supernews.com>
Content-Language: en-US
 by: Stephen Fuld - Wed, 2 Mar 2022 18:42 UTC

On 3/2/2022 3:24 AM, aph@littlepinkcloud.invalid wrote:
> Theo Markettos <theom+news@chiark.greenend.org.uk> wrote:
>>
>> (32 bit ARM is interesting as it was designed to be nice to program
>> in assembly, a consideration not normally part of instruction set
>> design these days)
>
> That's an interesting point. In my experience 64-bit ARM is as nice to
> program in assembly, at least as far as the set of base instructions
> goes, even though there are more instructions.
>
> I also believe that if an instruction set is nice to program in
> assembly, it's also nice to write a code generator for.

Wasn't one of the results from the studies of generated code,that was
used to justify RISC, that "nice to write assembly in" features such as
complex and orthogonal addressing modes just weren't used in generated code?

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

Re: Around the bike shed: Instruction names and assembler syntax

<svoejm$89e$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: iva...@millcomputing.com (Ivan Godard)
Newsgroups: comp.arch
Subject: Re: Around the bike shed: Instruction names and assembler syntax
Date: Wed, 2 Mar 2022 10:55:46 -0800
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <svoejm$89e$1@dont-email.me>
References: <svcqrj$jj6$1@newsreader4.netcologne.de>
<svd280$fiv$1@dont-email.me> <svh2tg$j53$1@gal.iecc.com>
<svj2ki$q0p$4@newsreader4.netcologne.de> <svjblm$idv$1@dont-email.me>
<j8666pFh0klU1@mid.individual.net> <svl27r$r8m$1@dont-email.me>
<2022Mar1.133629@mips.complang.tuwien.ac.at>
<svnjsl$qpu$1@newsreader4.netcologne.de>
<2022Mar2.184051@mips.complang.tuwien.ac.at>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 2 Mar 2022 18:55:51 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="1f31fb0cbbe5a7a8917c2d335074ae12";
logging-data="8494"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX198ZEiGBty0VzKiftYKE3v2"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.6.1
Cancel-Lock: sha1:zl2En1y/yEjrvPqJEfX1RIWJrqU=
In-Reply-To: <2022Mar2.184051@mips.complang.tuwien.ac.at>
Content-Language: en-US
 by: Ivan Godard - Wed, 2 Mar 2022 18:55 UTC

On 3/2/2022 9:40 AM, Anton Ertl wrote:
> Thomas Koenig <tkoenig@netcologne.de> writes:
>> Anton Ertl <anton@mips.complang.tuwien.ac.at> schrieb:
>>> Ivan Godard <ivan@millcomputing.com> writes:
>>>> Declarable (!) precedence was a disaster
>>>> in A68 - what's the precedence of left circular shift?
>>>
>>> IMO the general concept of precedence is a disaster. You can do
>>> implicit parenthesizing between well-established pairs of operators
>>> (e.g., a+b*c,
>>
>> You should.
>>
>> FORTRAN pretty much settled this question. Evaluating a formula
>> in any other way is a desaster.
>
> What disaster would ensue from not accepting a+b*c and instead
> requiring a+(b*c)? However, it seems to me that the relative
> precedences of + and * and widely-enough known that accepting a+b*c
> instead does not cause problems.

Well, if we are going to match mathematic practice that should be
"a+bc"; there have been historical efforts toward that sort of thing.
However, claiming familiarity as justification suffices only so long as
+ and * mean addition and multiplication. In the presence of declarable
operator overloading however... There are well established mathematical
domains in which * is not associative and neither commute, yet those
symbols are used.

Once out of arithmetic and into mathematics there really is no "natural"
precedence. Still, your argument is sound because most computation is
arithmetic and for common usage there are few operators. You ever used
Iverson's APL?

Re: Around the bike shed: Instruction names and assembler syntax

<8fe67146-ed28-441a-907f-38290a92c6ecn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a37:f719:0:b0:648:cd93:3198 with SMTP id q25-20020a37f719000000b00648cd933198mr17284208qkj.179.1646249717728;
Wed, 02 Mar 2022 11:35:17 -0800 (PST)
X-Received: by 2002:a05:6830:33c9:b0:5af:7886:ef40 with SMTP id
q9-20020a05683033c900b005af7886ef40mr16528126ott.112.1646249717428; Wed, 02
Mar 2022 11:35:17 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!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, 2 Mar 2022 11:35:17 -0800 (PST)
In-Reply-To: <2022Mar2.184051@mips.complang.tuwien.ac.at>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:a5aa:81a4:56af:7c4a;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:a5aa:81a4:56af:7c4a
References: <svcqrj$jj6$1@newsreader4.netcologne.de> <svd280$fiv$1@dont-email.me>
<svh2tg$j53$1@gal.iecc.com> <svj2ki$q0p$4@newsreader4.netcologne.de>
<svjblm$idv$1@dont-email.me> <j8666pFh0klU1@mid.individual.net>
<svl27r$r8m$1@dont-email.me> <2022Mar1.133629@mips.complang.tuwien.ac.at>
<svnjsl$qpu$1@newsreader4.netcologne.de> <2022Mar2.184051@mips.complang.tuwien.ac.at>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8fe67146-ed28-441a-907f-38290a92c6ecn@googlegroups.com>
Subject: Re: Around the bike shed: Instruction names and assembler syntax
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Wed, 02 Mar 2022 19:35:17 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 67
 by: MitchAlsup - Wed, 2 Mar 2022 19:35 UTC

On Wednesday, March 2, 2022 at 12:00:41 PM UTC-6, Anton Ertl wrote:
> Thomas Koenig <tko...@netcologne.de> writes:
> >Anton Ertl <an...@mips.complang.tuwien.ac.at> schrieb:
> >> Ivan Godard <iv...@millcomputing.com> writes:
> >>> Declarable (!) precedence was a disaster
> >>>in A68 - what's the precedence of left circular shift?
> >>
> >> IMO the general concept of precedence is a disaster. You can do
> >> implicit parenthesizing between well-established pairs of operators
> >> (e.g., a+b*c,
> >
> >You should.
> >
> >FORTRAN pretty much settled this question. Evaluating a formula
> >in any other way is a desaster.
> What disaster would ensue from not accepting a+b*c and instead
> requiring a+(b*c)? However, it seems to me that the relative
> precedences of + and * and widely-enough known that accepting a+b*c
> instead does not cause problems.
<
Consider::
# define a (aproxy
# define b bproxy)
Now what does the above give you ?
<
(aproxy+bproxy)*c
<
Unlikely to be what you meant.
Whereas if you use parenthesis more or less as required in the face of
c-#defines, you at least get a compile time warning.
<
> >> but not "a or b and c"),
> >
> >and is multiplication, or is (saturating) addition, so the precedence
> >is intuitive (at least if the relationship above is intuitive).
> It's not at all intuitive, and I expect that
>
> * newbies relatively frequently make mistakes when they rely on precedence.
<
If C has taught me anything; it is that you have to parenthesize everything.
<
>
> * experienced programmers and more cautious newbies use parentheses to
> make it clear whether they want "(a or b) and c" or "a or (b and c)".
> >> or in a few cases it's
> >> intuitive (a<b+c, a<b and c), but that does not establish a transitive
> >> relation (don't accept a+b and c).
> >
> >Conflating of numeric anc logical types is a misfeature rather specific
> >to C and its decendants.
> I have made productive use of treating the results of comparisons as
> numbers or masks, so I think it's a feature. The misfeature in C is a
> syntax that accepts "a+b&c".
<
Reliably programming requires parens.
<
> >Introduce a distinct logical type and most
> >problems of that kind go away.
> They don't, because the parser does not perform type checking. In
> particular, Modula-2 has a separate type BOOLEAN, and its parser
> accepts "a+b AND c"; yes, it does report a type error for it, but it
> also reports a type error for "a<b and c" if a, b are INTEGER, and c
> is BOOLEAN. Of course, the latter misfeature would be much worse if
> BOOLEAN was compatible with INTEGER.
> - anton
> --
> 'Anyone trying for "industrial quality" ISA should avoid undefined behavior.'
> Mitch Alsup, <c17fcd89-f024-40e7...@googlegroups.com>

Re: Around the bike shed: Instruction names and assembler syntax

<j89v7lF8t6eU1@mid.individual.net>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: niklas.h...@tidorum.invalid (Niklas Holsti)
Newsgroups: comp.arch
Subject: Re: Around the bike shed: Instruction names and assembler syntax
Date: Wed, 2 Mar 2022 21:35:16 +0200
Organization: Tidorum Ltd
Lines: 53
Message-ID: <j89v7lF8t6eU1@mid.individual.net>
References: <svcqrj$jj6$1@newsreader4.netcologne.de>
<svd280$fiv$1@dont-email.me> <svh2tg$j53$1@gal.iecc.com>
<svj2ki$q0p$4@newsreader4.netcologne.de> <svjblm$idv$1@dont-email.me>
<j8666pFh0klU1@mid.individual.net> <svl27r$r8m$1@dont-email.me>
<2022Mar1.133629@mips.complang.tuwien.ac.at>
<svnjsl$qpu$1@newsreader4.netcologne.de>
<2022Mar2.184051@mips.complang.tuwien.ac.at>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net Je2o6WVk0QLBEwQ2Pn/5NAj/VDOYCOAn/o2gEJS1hxbC5NkuEb
Cancel-Lock: sha1:ARYW5XK0XNRptnKSsYKB+5Vx0nI=
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:91.0)
Gecko/20100101 Thunderbird/91.6.0
Content-Language: en-US
In-Reply-To: <2022Mar2.184051@mips.complang.tuwien.ac.at>
 by: Niklas Holsti - Wed, 2 Mar 2022 19:35 UTC

On 2022-03-02 19:40, Anton Ertl wrote:
> Thomas Koenig <tkoenig@netcologne.de> writes:
>> Anton Ertl <anton@mips.complang.tuwien.ac.at> schrieb:
>>> Ivan Godard <ivan@millcomputing.com> writes:
>>>> Declarable (!) precedence was a disaster
>>>> in A68 - what's the precedence of left circular shift?
>>>
>>> IMO the general concept of precedence is a disaster. You can do
>>> implicit parenthesizing between well-established pairs of operators
>>> (e.g., a+b*c,
>>
>> You should.
>>
>> FORTRAN pretty much settled this question. Evaluating a formula
>> in any other way is a desaster.
>
> What disaster would ensue from not accepting a+b*c and instead
> requiring a+(b*c)? However, it seems to me that the relative
> precedences of + and * and widely-enough known that accepting a+b*c
> instead does not cause problems.
>
>>> but not "a or b and c"),
>>
>> and is multiplication, or is (saturating) addition, so the precedence
>> is intuitive (at least if the relationship above is intuitive).
>
> It's not at all intuitive, and I expect that
>
> * newbies relatively frequently make mistakes when they rely on precedence.
>
> * experienced programmers and more cautious newbies use parentheses to
> make it clear whether they want "(a or b) and c" or "a or (b and c)".

FWIW, Ada makes "a or b and c" illegal and requires parentheses. But Ada
allows "not a and b", with "not" having higher precedence than "and". I
would recommend parentheses there, or writing it as "b and not a".

>>> or in a few cases it's
>>> intuitive (a<b+c, a<b and c), but that does not establish a transitive
>>> relation (don't accept a+b and c).
>>
>> Conflating of numeric anc logical types is a misfeature rather specific
>> to C and its decendants.

When Ada gained true unsigned integers as "modular integer types", the
logical operators (and, or, xor, not) were extended to apply bit-wise to
such operands. For variables a, b, c of a modular type, this means that
"a + b and c" is legal Ada, with "and" having higher precedence than
"+". While that is not a conflation of numeric and logical types, it
does mix arithmetic and logical operators.

Re: Around the bike shed: Instruction names and assembler syntax

<8c040ef0-1eb5-447c-a11f-e5658a5d5f42n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:620a:15d3:b0:54e:3386:1a09 with SMTP id o19-20020a05620a15d300b0054e33861a09mr16771423qkm.768.1646249972882;
Wed, 02 Mar 2022 11:39:32 -0800 (PST)
X-Received: by 2002:a9d:2f61:0:b0:5af:5d99:29ed with SMTP id
h88-20020a9d2f61000000b005af5d9929edmr17253744otb.142.1646249972632; Wed, 02
Mar 2022 11:39:32 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!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, 2 Mar 2022 11:39:32 -0800 (PST)
In-Reply-To: <svodqv$rc$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:a5aa:81a4:56af:7c4a;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:a5aa:81a4:56af:7c4a
References: <svcqrj$jj6$1@newsreader4.netcologne.de> <memo.20220226104336.7708a@jgd.cix.co.uk>
<svgqq7$cll$1@newsreader4.netcologne.de> <nLf*r48Hy@news.chiark.greenend.org.uk>
<ANidnT3Kb-ZszoL_nZ2dnUU7-LHNnZ2d@supernews.com> <svodqv$rc$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8c040ef0-1eb5-447c-a11f-e5658a5d5f42n@googlegroups.com>
Subject: Re: Around the bike shed: Instruction names and assembler syntax
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Wed, 02 Mar 2022 19:39:32 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 46
 by: MitchAlsup - Wed, 2 Mar 2022 19:39 UTC

On Wednesday, March 2, 2022 at 12:42:43 PM UTC-6, Stephen Fuld wrote:
> On 3/2/2022 3:24 AM, a...@littlepinkcloud.invalid wrote:
> > Theo Markettos <theom...@chiark.greenend.org.uk> wrote:
> >>
> >> (32 bit ARM is interesting as it was designed to be nice to program
> >> in assembly, a consideration not normally part of instruction set
> >> design these days)
> >
> > That's an interesting point. In my experience 64-bit ARM is as nice to
> > program in assembly, at least as far as the set of base instructions
> > goes, even though there are more instructions.
> >
> > I also believe that if an instruction set is nice to program in
> > assembly, it's also nice to write a code generator for.
<
> Wasn't one of the results from the studies of generated code,that was
> used to justify RISC, that "nice to write assembly in" features such as
> complex and orthogonal addressing modes just weren't used in generated code?
<
We started this thread with::
<----------------------------------------------------------------------------------------
> > Then you would be eating up a lot of namespace in the programmers head::
> ><
> > ADD R7,R4,R19
> > ADD R7,R4,-R19
> > ADD R7,-R4,-R19
> > ADD R7,R4,#256
> > ADD R7,R4,#-256
> > ADD R7,#256,R19
> > ADD R7,#-256,R19
> > ADD R7,R4,#0x12345678
> > ADD R7,R4,#0x1234567890123456
> > ADD R7,#0x12345678,R19
> > ADD R7,#0x1234567890123456,R19
<
> I agree that it would make less sense for your ISA than
> for a more conventional RISC.
<----------------------------------------------------------------------------------------
<
In practice, good name-space in ASM is more for reading
and figuring out what the compiler is doing right (and wrong)
than for writing asm yourself.
>
>
> --
> - Stephen Fuld
> (e-mail address disguised to prevent spam)

Re: Around the bike shed: Instruction names and assembler syntax

<svomq1$gf4$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!aioe.org!UXtAIYUgaw/fkqnS/V28xg.user.46.165.242.91.POSTED!not-for-mail
From: terje.ma...@tmsw.no (Terje Mathisen)
Newsgroups: comp.arch
Subject: Re: Around the bike shed: Instruction names and assembler syntax
Date: Wed, 2 Mar 2022 22:15:48 +0100
Organization: Aioe.org NNTP Server
Message-ID: <svomq1$gf4$1@gioia.aioe.org>
References: <svcqrj$jj6$1@newsreader4.netcologne.de>
<svd280$fiv$1@dont-email.me> <svh2tg$j53$1@gal.iecc.com>
<svj2ki$q0p$4@newsreader4.netcologne.de> <svjblm$idv$1@dont-email.me>
<j8666pFh0klU1@mid.individual.net> <svl27r$r8m$1@dont-email.me>
<2022Mar1.133629@mips.complang.tuwien.ac.at> <svl6qh$t5b$1@dont-email.me>
<2022Mar1.184731@mips.complang.tuwien.ac.at> <svlsr2$ebn$1@dont-email.me>
<2022Mar2.182320@mips.complang.tuwien.ac.at>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="16868"; posting-host="UXtAIYUgaw/fkqnS/V28xg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101
Firefox/68.0 SeaMonkey/2.53.10.2
X-Notice: Filtered by postfilter v. 0.9.2
 by: Terje Mathisen - Wed, 2 Mar 2022 21:15 UTC

Anton Ertl wrote:
> Ivan Godard <ivan@millcomputing.com> writes:
>> It turns out that *any* formal specification of language semantics is
>> beyond usual mortal ken; try reading Denotational Semantics someday :-)
>
> I have. Did not find it inspiring.
>
> I think that formal stuff can be ok for certain aspects; (E)BNF is the
> poster child for that, although the informal specification of the
> resolution of the dangling else problem by Wirth demonstrates that
> even EBNF is occasionally too complicated.
>
> I have just looked at PSHUFB
> <https://www.felixcloutier.com/x86/pshufb>, and I found the
> operational semantics more enlightening than the prose. So there are
> cases where formal stuff is competetive. But in most cases it's too
> unwieldy.

For many (most?) of these SIMD operations I find the pseudo-code
implementation the only one I'm sure I understand.

Terje

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

Re: Around the bike shed: Instruction names and assembler syntax

<svon37$m2p$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!aioe.org!UXtAIYUgaw/fkqnS/V28xg.user.46.165.242.91.POSTED!not-for-mail
From: terje.ma...@tmsw.no (Terje Mathisen)
Newsgroups: comp.arch
Subject: Re: Around the bike shed: Instruction names and assembler syntax
Date: Wed, 2 Mar 2022 22:20:42 +0100
Organization: Aioe.org NNTP Server
Message-ID: <svon37$m2p$1@gioia.aioe.org>
References: <svcqrj$jj6$1@newsreader4.netcologne.de>
<svd280$fiv$1@dont-email.me> <svh2tg$j53$1@gal.iecc.com>
<svj2ki$q0p$4@newsreader4.netcologne.de> <svjblm$idv$1@dont-email.me>
<j8666pFh0klU1@mid.individual.net> <svl27r$r8m$1@dont-email.me>
<2022Mar1.133629@mips.complang.tuwien.ac.at>
<svnjsl$qpu$1@newsreader4.netcologne.de>
<2022Mar2.184051@mips.complang.tuwien.ac.at>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="22617"; posting-host="UXtAIYUgaw/fkqnS/V28xg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101
Firefox/68.0 SeaMonkey/2.53.10.2
X-Notice: Filtered by postfilter v. 0.9.2
 by: Terje Mathisen - Wed, 2 Mar 2022 21:20 UTC

Anton Ertl wrote:
> Thomas Koenig <tkoenig@netcologne.de> writes:
>> Anton Ertl <anton@mips.complang.tuwien.ac.at> schrieb:
>>> Ivan Godard <ivan@millcomputing.com> writes:
>>>> Declarable (!) precedence was a disaster
>>>> in A68 - what's the precedence of left circular shift?
>>>
>>> IMO the general concept of precedence is a disaster. You can do
>>> implicit parenthesizing between well-established pairs of operators
>>> (e.g., a+b*c,
>>
>> You should.
>>
>> FORTRAN pretty much settled this question. Evaluating a formula
>> in any other way is a desaster.
>
> What disaster would ensue from not accepting a+b*c and instead
> requiring a+(b*c)? However, it seems to me that the relative
> precedences of + and * and widely-enough known that accepting a+b*c
> instead does not cause problems.
>
>>> but not "a or b and c"),
>>
>> and is multiplication, or is (saturating) addition, so the precedence
>> is intuitive (at least if the relationship above is intuitive).
>
> It's not at all intuitive, and I expect that
>
> * newbies relatively frequently make mistakes when they rely on precedence.
>
> * experienced programmers and more cautious newbies use parentheses to
> make it clear whether they want "(a or b) and c" or "a or (b and c)".
>
>>> or in a few cases it's
>>> intuitive (a<b+c, a<b and c), but that does not establish a transitive
>>> relation (don't accept a+b and c).
>>
>> Conflating of numeric anc logical types is a misfeature rather specific
>> to C and its decendants.
>
> I have made productive use of treating the results of comparisons as
> numbers or masks, so I think it's a feature. The misfeature in C is a
> syntax that accepts "a+b&c".

That should at the very least be a warning: Is the intention "(a+b) & c"
or is it "a + (b & c)"?

IntelliJ flags lots of constructs that are legal but potentially
non-obvious to anyone reading the code.

Terje

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

Pages:12345678910
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor