Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

Nothing ever becomes real until it is experienced. -- John Keats


devel / comp.arch / Re: Alternative Representations of the Concertina II ISA

SubjectAuthor
* Alternative Representations of the Concertina II ISAQuadibloc
+* Re: Alternative Representations of the Concertina II ISAQuadibloc
|`- Re: Alternative Representations of the Concertina II ISAQuadibloc
+* Re: Alternative Representations of the Concertina II ISAMitchAlsup
|`* Re: Alternative Representations of the Concertina II ISAQuadibloc
| +* Re: Alternative Representations of the Concertina II ISAQuadibloc
| |`- Re: Alternative Representations of the Concertina II ISABGB
| `* Re: Alternative Representations of the Concertina II ISAMitchAlsup
|  `* Re: Alternative Representations of the Concertina II ISAQuadibloc
|   +- Re: Alternative Representations of the Concertina II ISAMitchAlsup
|   `* Re: Alternative Representations of the Concertina II ISABGB
|    +* Re: Alternative Representations of the Concertina II ISAAnton Ertl
|    |+* Re: Alternative Representations of the Concertina II ISAQuadibloc
|    ||`* Re: Alternative Representations of the Concertina II ISAAnton Ertl
|    || +* Re: Alternative Representations of the Concertina II ISAMitchAlsup
|    || |`- Re: Alternative Representations of the Concertina II ISAAnton Ertl
|    || `* Re: Alternative Representations of the Concertina II ISAQuadibloc
|    ||  `- Re: Alternative Representations of the Concertina II ISAMitchAlsup
|    |+- Re: Alternative Representations of the Concertina II ISABGB
|    |`* Re: Alternative Representations of the Concertina II ISAMitchAlsup
|    | +- Re: Alternative Representations of the Concertina II ISAAnton Ertl
|    | +* Re: Alternative Representations of the Concertina II ISABGB
|    | |`* Re: Alternative Representations of the Concertina II ISAMitchAlsup
|    | | `* Re: Alternative Representations of the Concertina II ISARobert Finch
|    | |  +* Re: Alternative Representations of the Concertina II ISAMitchAlsup
|    | |  |`- Re: Alternative Representations of the Concertina II ISABGB
|    | |  `- Re: Alternative Representations of the Concertina II ISABGB
|    | `* Re: Alternative Representations of the Concertina II ISAPaul A. Clayton
|    |  +* Re: Alternative Representations of the Concertina II ISAAnton Ertl
|    |  |+* Re: Alternative Representations of the Concertina II ISABGB
|    |  ||+- Re: Alternative Representations of the Concertina II ISABGB
|    |  ||+* Re: Alternative Representations of the Concertina II ISAMitchAlsup
|    |  |||`- Re: Alternative Representations of the Concertina II ISABGB
|    |  ||`* Re: Alternative Representations of the Concertina II ISAAnton Ertl
|    |  || `* Re: Alternative Representations of the Concertina II ISABGB
|    |  ||  `- Re: Alternative Representations of the Concertina II ISAAnton Ertl
|    |  |`* Re: Alternative Representations of the Concertina II ISAPaul A. Clayton
|    |  | `- Re: Alternative Representations of the Concertina II ISABGB
|    |  `* Re: Alternative Representations of the Concertina II ISAMitchAlsup
|    |   `* Re: Alternative Representations of the Concertina II ISAPaul A. Clayton
|    |    `* Re: Alternative Representations of the Concertina II ISAMitchAlsup
|    |     `* Re: Alternative Representations of the Concertina II ISAThomas Koenig
|    |      +* Re: Alternative Representations of the Concertina II ISAMitchAlsup
|    |      |`* Re: Alternative Representations of the Concertina II ISAThomas Koenig
|    |      | +* Re: Alternative Representations of the Concertina II ISABGB
|    |      | |`* Re: Alternative Representations of the Concertina II ISARobert Finch
|    |      | | +- Re: Alternative Representations of the Concertina II ISABGB
|    |      | | `* Re: Alternative Representations of the Concertina II ISAMitchAlsup
|    |      | |  `- Re: Alternative Representations of the Concertina II ISABGB
|    |      | `* Re: Alternative Representations of the Concertina II ISAThomas Koenig
|    |      |  `* Re: Alternative Representations of the Concertina II ISAMitchAlsup
|    |      |   `* Re: Alternative Representations of the Concertina II ISAThomas Koenig
|    |      |    +* Re: Alternative Representations of the Concertina II ISAMitchAlsup
|    |      |    |`* Re: Alternative Representations of the Concertina II ISAThomas Koenig
|    |      |    | `* Re: Alternative Representations of the Concertina II ISAMitchAlsup
|    |      |    |  `- Re: Alternative Representations of the Concertina II ISAPaul A. Clayton
|    |      |    `* Re: Alternative Representations of the Concertina II ISATerje Mathisen
|    |      |     `* Re: Alternative Representations of the Concertina II ISAThomas Koenig
|    |      |      `- Re: Alternative Representations of the Concertina II ISAMitchAlsup
|    |      `* Re: Alternative Representations of the Concertina II ISAMitchAlsup
|    |       `- Re: Alternative Representations of the Concertina II ISAThomas Koenig
|    `* Re: Alternative Representations of the Concertina II ISAMitchAlsup
|     +- Re: Alternative Representations of the Concertina II ISABGB
|     `* Re: Alternative Representations of the Concertina II ISAMarko Zec
|      `* Re: Alternative Representations of the Concertina II ISABGB
|       `* Re: Alternative Representations of the Concertina II ISAStephen Fuld
|        `* Re: Alternative Representations of the Concertina II ISABGB
|         `* Re: Alternative Representations of the Concertina II ISAMitchAlsup
|          +* Re: Alternative Representations of the Concertina II ISABGB
|          |`* Re: Alternative Representations of the Concertina II ISAMitchAlsup
|          | `* Re: Alternative Representations of the Concertina II ISABGB
|          |  `* Re: Alternative Representations of the Concertina II ISAMitchAlsup
|          |   +* Re: Alternative Representations of the Concertina II ISARobert Finch
|          |   |+* Re: Alternative Representations of the Concertina II ISAMitchAlsup
|          |   ||+* Re: Alternative Representations of the Concertina II ISAChris M. Thomasson
|          |   |||`- Re: Alternative Representations of the Concertina II ISAChris M. Thomasson
|          |   ||`- Re: Alternative Representations of the Concertina II ISARobert Finch
|          |   |`* Re: Alternative Representations of the Concertina II ISATerje Mathisen
|          |   | `* Re: Alternative Representations of the Concertina II ISAMitchAlsup
|          |   |  `* Re: Alternative Representations of the Concertina II ISATerje Mathisen
|          |   |   `* Re: Alternative Representations of the Concertina II ISAMitchAlsup
|          |   |    +* Re: Alternative Representations of the Concertina II ISAChris M. Thomasson
|          |   |    |`- Re: Alternative Representations of the Concertina II ISABGB
|          |   |    `- Re: Alternative Representations of the Concertina II ISATerje Mathisen
|          |   `* Re: Alternative Representations of the Concertina II ISABGB
|          |    `- Re: Alternative Representations of the Concertina II ISAMitchAlsup
|          `* Re: Alternative Representations of the Concertina II ISATerje Mathisen
|           +* Re: Alternative Representations of the Concertina II ISAChris M. Thomasson
|           |`* Fast approx hypotenuse (Was Re: Alternative Representations of theTerje Mathisen
|           | `- Re: Fast approx hypotenuse (Was Re: Alternative Representations ofBGB
|           `* Re: Alternative Representations of the Concertina II ISAMitchAlsup
|            `- Re: Alternative Representations of the Concertina II ISABGB
`* Re: Alternative Representations of the Concertina II ISAQuadibloc
 `- Re: Alternative Representations of the Concertina II ISAQuadibloc

Pages:1234
Re: Alternative Representations of the Concertina II ISA

<5b7aac36c16943ab6f861b49f1c7e832@news.novabbs.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!.POSTED!not-for-mail
From: mitchalsup@aol.com (MitchAlsup)
Newsgroups: comp.arch
Subject: Re: Alternative Representations of the Concertina II ISA
Date: Tue, 12 Dec 2023 00:13:03 +0000
Organization: novaBBS
Message-ID: <5b7aac36c16943ab6f861b49f1c7e832@news.novabbs.com>
References: <ujp81t$26ff9$1@dont-email.me> <43f9c94c44017bc3becd8d9c58d846d5@news.novabbs.com> <ujr8l8$2g4e8$1@dont-email.me> <f693434f205f88781a86a0c6fac43eda@news.novabbs.com> <uk0rek$3flrp$1@dont-email.me> <uk1cbs$3lign$1@dont-email.me> <2023Nov27.101759@mips.complang.tuwien.ac.at> <3020102144e0e12cd79c784d2b80af78@news.novabbs.com> <uko9la$e2he$2@dont-email.me> <c8a110514d5c8cb0534e217912a0369e@news.novabbs.com> <ul2bu4$2a7gb$2@dont-email.me> <a6924ec0fe2b7570aabc143b4e2604e5@news.novabbs.com> <ul6p4t$m8s4$1@newsreader4.netcologne.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="3823528"; mail-complaints-to="usenet@i2pn2.org";
posting-account="t+lO0yBNO1zGxasPvGSZV1BRu71QKx+JE37DnW+83jQ";
User-Agent: Rocksolid Light
X-Rslight-Posting-User: 7e9c45bcd6d4757c5904fbe9a694742e6f8aa949
X-Rslight-Site: $2y$10$2ff4YOt7KsjD..N17SvJHOYKd95/COML2KeiXzSf0VPcULLP.yjve
X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on novalink.us
 by: MitchAlsup - Tue, 12 Dec 2023 00:13 UTC

Thomas Koenig wrote:

> MitchAlsup <mitchalsup@aol.com> schrieb:
>
> #include <stdint.h>

> uint32_t div25 (uint32_t n)
> {
> return n / 25;
> }

> yields

> div25:
> lis 9,0x51eb // cycle 1
> ori 9,9,0x851f // cycle 2
> mulhwu 3,3,9 // cycle 3-6
> srwi 3,3,3 // cycle 7
> blr // cycle 8

div25:
CARRY R8,{{O}} // cycle 1
MUL R1,R1,#0x51eb851f // cycle 1-4
SLL R1,R8,#35 // cycle 5
RET // cycle 6

Re: Alternative Representations of the Concertina II ISA

<981d02e21d9add8467337065270831d7@news.novabbs.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!.POSTED!not-for-mail
From: mitchalsup@aol.com (MitchAlsup)
Newsgroups: comp.arch
Subject: Re: Alternative Representations of the Concertina II ISA
Date: Tue, 12 Dec 2023 00:14:44 +0000
Organization: novaBBS
Message-ID: <981d02e21d9add8467337065270831d7@news.novabbs.com>
References: <ujp81t$26ff9$1@dont-email.me> <43f9c94c44017bc3becd8d9c58d846d5@news.novabbs.com> <ujr8l8$2g4e8$1@dont-email.me> <f693434f205f88781a86a0c6fac43eda@news.novabbs.com> <uk0rek$3flrp$1@dont-email.me> <uk1cbs$3lign$1@dont-email.me> <2023Nov27.101759@mips.complang.tuwien.ac.at> <3020102144e0e12cd79c784d2b80af78@news.novabbs.com> <uko9la$e2he$2@dont-email.me> <c8a110514d5c8cb0534e217912a0369e@news.novabbs.com> <ul2bu4$2a7gb$2@dont-email.me> <a6924ec0fe2b7570aabc143b4e2604e5@news.novabbs.com> <ul6p4t$m8s4$1@newsreader4.netcologne.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="3823528"; mail-complaints-to="usenet@i2pn2.org";
posting-account="t+lO0yBNO1zGxasPvGSZV1BRu71QKx+JE37DnW+83jQ";
User-Agent: Rocksolid Light
X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on novalink.us
X-Rslight-Site: $2y$10$8ybH4r7lqz8ihXteIKalRuhrIwdgTulQ6EFLZScUrmtDMFO/mToTS
X-Rslight-Posting-User: 7e9c45bcd6d4757c5904fbe9a694742e6f8aa949
 by: MitchAlsup - Tue, 12 Dec 2023 00:14 UTC

Thomas Koenig wrote:

> MitchAlsup <mitchalsup@aol.com> schrieb:
>> Paul A. Clayton wrote:
>>
>>> On 12/7/23 1:55 PM, MitchAlsup wrote:

>>>>> What about multiply-high-no-carry-in?
>>>>
>>>>       CARRY   R9,{{O}}    // carry applies to next inst
>>>>                           // no carry in yes carry out
>>>>       MUL     R10,Rx,Ry   // {R9,R10} contain result
>>
>>> I was thinking of a single register result.
>>
>> How can a single 64-bit register hold a 128-bit result ??

> Sometimes, you don't need the whole result; the upper bits suffice.

> Consider dividing a 32-bit unsigned number n on a 32-bit system
> by 25 (equally applicable to similar examples with 64-bit systems,
> but I happen to have the numbers at hand).

> In plain C, you could do this by

> uint32_t res = ((uint64_t) n * (uint64_t) 1374389535) >> 35;

This only gives you 29 bits of significance.

What if you also need the remainder ??

Re: Alternative Representations of the Concertina II ISA

<ul8sem$nmjf$1@newsreader4.netcologne.de>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2001-4dd7-3b3f-0-85eb-9bd9-1cbe-d6b1.ipv6dyn.netcologne.de!not-for-mail
From: tkoenig@netcologne.de (Thomas Koenig)
Newsgroups: comp.arch
Subject: Re: Alternative Representations of the Concertina II ISA
Date: Tue, 12 Dec 2023 05:52:22 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <ul8sem$nmjf$1@newsreader4.netcologne.de>
References: <ujp81t$26ff9$1@dont-email.me>
<43f9c94c44017bc3becd8d9c58d846d5@news.novabbs.com>
<ujr8l8$2g4e8$1@dont-email.me>
<f693434f205f88781a86a0c6fac43eda@news.novabbs.com>
<uk0rek$3flrp$1@dont-email.me> <uk1cbs$3lign$1@dont-email.me>
<2023Nov27.101759@mips.complang.tuwien.ac.at>
<3020102144e0e12cd79c784d2b80af78@news.novabbs.com>
<uko9la$e2he$2@dont-email.me>
<c8a110514d5c8cb0534e217912a0369e@news.novabbs.com>
<ul2bu4$2a7gb$2@dont-email.me>
<a6924ec0fe2b7570aabc143b4e2604e5@news.novabbs.com>
<ul6p4t$m8s4$1@newsreader4.netcologne.de>
<981d02e21d9add8467337065270831d7@news.novabbs.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 12 Dec 2023 05:52:22 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd7-3b3f-0-85eb-9bd9-1cbe-d6b1.ipv6dyn.netcologne.de:2001:4dd7:3b3f:0:85eb:9bd9:1cbe:d6b1";
logging-data="776815"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Tue, 12 Dec 2023 05:52 UTC

MitchAlsup <mitchalsup@aol.com> schrieb:
> Thomas Koenig wrote:
>
>> MitchAlsup <mitchalsup@aol.com> schrieb:
>>> Paul A. Clayton wrote:
>>>
>>>> On 12/7/23 1:55 PM, MitchAlsup wrote:
>
>>>>>> What about multiply-high-no-carry-in?
>>>>>
>>>>>       CARRY   R9,{{O}}    // carry applies to next inst
>>>>>                           // no carry in yes carry out
>>>>>       MUL     R10,Rx,Ry   // {R9,R10} contain result
>>>
>>>> I was thinking of a single register result.
>>>
>>> How can a single 64-bit register hold a 128-bit result ??
>
>> Sometimes, you don't need the whole result; the upper bits suffice.
>
>> Consider dividing a 32-bit unsigned number n on a 32-bit system
>> by 25 (equally applicable to similar examples with 64-bit systems,
>> but I happen to have the numbers at hand).
>
>> In plain C, you could do this by
>
>> uint32_t res = ((uint64_t) n * (uint64_t) 1374389535) >> 35;
>
> This only gives you 29 bits of significance.

Because that's all it takes, dividing by 25 reduces the number
of significant bits.

> What if you also need the remainder ??

Multiply and subtract.

Re: Alternative Representations of the Concertina II ISA

<ul8tf4$nmjf$2@newsreader4.netcologne.de>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2001-4dd7-3b3f-0-85eb-9bd9-1cbe-d6b1.ipv6dyn.netcologne.de!not-for-mail
From: tkoenig@netcologne.de (Thomas Koenig)
Newsgroups: comp.arch
Subject: Re: Alternative Representations of the Concertina II ISA
Date: Tue, 12 Dec 2023 06:09:40 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <ul8tf4$nmjf$2@newsreader4.netcologne.de>
References: <ujp81t$26ff9$1@dont-email.me>
<43f9c94c44017bc3becd8d9c58d846d5@news.novabbs.com>
<ujr8l8$2g4e8$1@dont-email.me>
<f693434f205f88781a86a0c6fac43eda@news.novabbs.com>
<uk0rek$3flrp$1@dont-email.me> <uk1cbs$3lign$1@dont-email.me>
<2023Nov27.101759@mips.complang.tuwien.ac.at>
<3020102144e0e12cd79c784d2b80af78@news.novabbs.com>
<uko9la$e2he$2@dont-email.me>
<c8a110514d5c8cb0534e217912a0369e@news.novabbs.com>
<ul2bu4$2a7gb$2@dont-email.me>
<a6924ec0fe2b7570aabc143b4e2604e5@news.novabbs.com>
<ul6p4t$m8s4$1@newsreader4.netcologne.de>
<5b7aac36c16943ab6f861b49f1c7e832@news.novabbs.com>
Injection-Date: Tue, 12 Dec 2023 06:09:40 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd7-3b3f-0-85eb-9bd9-1cbe-d6b1.ipv6dyn.netcologne.de:2001:4dd7:3b3f:0:85eb:9bd9:1cbe:d6b1";
logging-data="776815"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Tue, 12 Dec 2023 06:09 UTC

MitchAlsup <mitchalsup@aol.com> schrieb:
> Thomas Koenig wrote:
>
>> MitchAlsup <mitchalsup@aol.com> schrieb:
>>
>> #include <stdint.h>
>
>> uint32_t div25 (uint32_t n)
>> {
>> return n / 25;
>> }
>
>> yields
>
>> div25:
>> lis 9,0x51eb // cycle 1
>> ori 9,9,0x851f // cycle 2
>> mulhwu 3,3,9 // cycle 3-6
>> srwi 3,3,3 // cycle 7
>> blr // cycle 8
>
> div25:
> CARRY R8,{{O}} // cycle 1
> MUL R1,R1,#0x51eb851f // cycle 1-4
> SLL R1,R8,#35 // cycle 5
> RET // cycle 6

Then let's use a 64-bit example:

#include <stdint.h>

uint64_t div (uint64_t n)
{ return n / 37;
}

which becomes

div:
..LFB0:
.cfi_startproc
movabsq $-2492803253203993461, %rax
mulq %rdi
movq %rdx, %rax
shrq $5, %rax
ret

on x86_64 (so, use the high result only and shift it five bits to
the right) and, with Power10,

div:
pli 10,3714566310
pli 9,232160395
rldimi 9,10,32,0
mulhdu 3,3,9
srdi 3,3,5
blr

(The first three instructions are pasting together the constant, which
of course My 66000 can do much better :-)

A hypothetical My66000 code could be

mulhu r1, r1, #-2492803253203993461
srl r1, r1, #5
ret

Re: Alternative Representations of the Concertina II ISA

<ul97fm$3jm6g$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!rocksolid2!news.neodome.net!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: cr88192@gmail.com (BGB)
Newsgroups: comp.arch
Subject: Re: Alternative Representations of the Concertina II ISA
Date: Tue, 12 Dec 2023 03:00:36 -0600
Organization: A noiseless patient Spider
Lines: 85
Message-ID: <ul97fm$3jm6g$1@dont-email.me>
References: <ujp81t$26ff9$1@dont-email.me>
<43f9c94c44017bc3becd8d9c58d846d5@news.novabbs.com>
<ujr8l8$2g4e8$1@dont-email.me>
<f693434f205f88781a86a0c6fac43eda@news.novabbs.com>
<uk0rek$3flrp$1@dont-email.me> <uk1cbs$3lign$1@dont-email.me>
<2023Nov27.101759@mips.complang.tuwien.ac.at>
<3020102144e0e12cd79c784d2b80af78@news.novabbs.com>
<uko9la$e2he$2@dont-email.me>
<c8a110514d5c8cb0534e217912a0369e@news.novabbs.com>
<ul2bu4$2a7gb$2@dont-email.me>
<a6924ec0fe2b7570aabc143b4e2604e5@news.novabbs.com>
<ul6p4t$m8s4$1@newsreader4.netcologne.de>
<5b7aac36c16943ab6f861b49f1c7e832@news.novabbs.com>
<ul8tf4$nmjf$2@newsreader4.netcologne.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 12 Dec 2023 09:00:38 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="747987315b883a8419e0086aa12f2688";
logging-data="3791056"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19ZZ/Kr+wR3h6Ml4D6gxOkz"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:ZWJE6LqlsvDdJyKiowpuePEbhcM=
Content-Language: en-US
In-Reply-To: <ul8tf4$nmjf$2@newsreader4.netcologne.de>
 by: BGB - Tue, 12 Dec 2023 09:00 UTC

On 12/12/2023 12:09 AM, Thomas Koenig wrote:
> MitchAlsup <mitchalsup@aol.com> schrieb:
>> Thomas Koenig wrote:
>>
>>> MitchAlsup <mitchalsup@aol.com> schrieb:
>>>
>>> #include <stdint.h>
>>
>>> uint32_t div25 (uint32_t n)
>>> {
>>> return n / 25;
>>> }
>>
>>> yields
>>
>>> div25:
>>> lis 9,0x51eb // cycle 1
>>> ori 9,9,0x851f // cycle 2
>>> mulhwu 3,3,9 // cycle 3-6
>>> srwi 3,3,3 // cycle 7
>>> blr // cycle 8
>>
>> div25:
>> CARRY R8,{{O}} // cycle 1
>> MUL R1,R1,#0x51eb851f // cycle 1-4
>> SLL R1,R8,#35 // cycle 5
>> RET // cycle 6
>
> Then let's use a 64-bit example:
>
> #include <stdint.h>
>
> uint64_t div (uint64_t n)
> {
> return n / 37;
> }
>
> which becomes
>
> div:
> .LFB0:
> .cfi_startproc
> movabsq $-2492803253203993461, %rax
> mulq %rdi
> movq %rdx, %rax
> shrq $5, %rax
> ret
>
> on x86_64 (so, use the high result only and shift it five bits to
> the right) and, with Power10,
>
> div:
> pli 10,3714566310
> pli 9,232160395
> rldimi 9,10,32,0
> mulhdu 3,3,9
> srdi 3,3,5
> blr
>
> (The first three instructions are pasting together the constant, which
> of course My 66000 can do much better :-)
>
> A hypothetical My66000 code could be
>
> mulhu r1, r1, #-2492803253203993461
> srl r1, r1, #5
> ret
>

And, for comparison, on BJX2 (with the MULQ extension):
MOV -2492803253203993461, R3
MULHU.Q R4, R3, R2
SHLD.Q R2, -5, R2
RTS
....

Though, this will take 24 bytes to encode, and wont be fast.

Also, currently the only instructions that take 64 bit immediate values are:
MOV Imm64, Rn
ADD Imm64, Rn
PLDCXH Imm64, Xn //4x Binary16 to 4x Binary32

....

Re: Alternative Representations of the Concertina II ISA

<ula1lv$3nhh3$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!nntp.terraraq.uk!news.gegeweb.eu!gegeweb.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: robfi680@gmail.com (Robert Finch)
Newsgroups: comp.arch
Subject: Re: Alternative Representations of the Concertina II ISA
Date: Tue, 12 Dec 2023 11:27:43 -0500
Organization: A noiseless patient Spider
Lines: 95
Message-ID: <ula1lv$3nhh3$1@dont-email.me>
References: <ujp81t$26ff9$1@dont-email.me>
<43f9c94c44017bc3becd8d9c58d846d5@news.novabbs.com>
<ujr8l8$2g4e8$1@dont-email.me>
<f693434f205f88781a86a0c6fac43eda@news.novabbs.com>
<uk0rek$3flrp$1@dont-email.me> <uk1cbs$3lign$1@dont-email.me>
<2023Nov27.101759@mips.complang.tuwien.ac.at>
<3020102144e0e12cd79c784d2b80af78@news.novabbs.com>
<uko9la$e2he$2@dont-email.me>
<c8a110514d5c8cb0534e217912a0369e@news.novabbs.com>
<ul2bu4$2a7gb$2@dont-email.me>
<a6924ec0fe2b7570aabc143b4e2604e5@news.novabbs.com>
<ul6p4t$m8s4$1@newsreader4.netcologne.de>
<5b7aac36c16943ab6f861b49f1c7e832@news.novabbs.com>
<ul8tf4$nmjf$2@newsreader4.netcologne.de> <ul97fm$3jm6g$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 12 Dec 2023 16:27:43 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="89c76c0b0cf5b79b365fb6e131a4ae89";
logging-data="3917347"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/cfJdNKMqOpWAfJzHJ1MPznwbi+nffR84="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:PJuAagwqcVG7CmyvblJ/K2/m27U=
In-Reply-To: <ul97fm$3jm6g$1@dont-email.me>
Content-Language: en-US
 by: Robert Finch - Tue, 12 Dec 2023 16:27 UTC

On 2023-12-12 4:00 a.m., BGB wrote:
> On 12/12/2023 12:09 AM, Thomas Koenig wrote:
>> MitchAlsup <mitchalsup@aol.com> schrieb:
>>> Thomas Koenig wrote:
>>>
>>>> MitchAlsup <mitchalsup@aol.com> schrieb:
>>>>
>>>> #include <stdint.h>
>>>
>>>> uint32_t div25 (uint32_t n)
>>>> {
>>>>    return n / 25;
>>>> }
>>>
>>>> yields
>>>
>>>> div25:
>>>>          lis 9,0x51eb        // cycle 1
>>>>          ori 9,9,0x851f    // cycle 2
>>>>          mulhwu 3,3,9        // cycle 3-6
>>>>          srwi 3,3,3        // cycle 7
>>>>          blr            // cycle 8
>>>
>>> div25:
>>>     CARRY R8,{{O}}       // cycle 1
>>>     MUL R1,R1,#0x51eb851f    // cycle 1-4
>>>     SLL R1,R8,#35        // cycle 5
>>>     RET            // cycle 6
>>
>> Then let's use a 64-bit example:
>>
>> #include <stdint.h>
>>
>> uint64_t div (uint64_t n)
>> {
>>    return n / 37;
>> }
>>
>> which becomes
>>
>> div:
>> .LFB0:
>>          .cfi_startproc
>>          movabsq $-2492803253203993461, %rax
>>          mulq    %rdi
>>          movq    %rdx, %rax
>>          shrq    $5, %rax
>>          ret
>>
>> on x86_64 (so, use the high result only and shift it five bits to
>> the right) and, with Power10,
>>
>> div:
>>          pli 10,3714566310
>>          pli 9,232160395
>>          rldimi 9,10,32,0
>>          mulhdu 3,3,9
>>          srdi 3,3,5
>>          blr
>>
>> (The first three instructions are pasting together the constant, which
>> of course My 66000 can do much better :-)
>>
>> A hypothetical My66000 code could be
>>
>>        mulhu    r1, r1, #-2492803253203993461
>>        srl    r1, r1, #5
>>        ret
>>
>
> And, for comparison, on BJX2 (with the MULQ extension):
>   MOV -2492803253203993461, R3
>   MULHU.Q R4, R3, R2
>   SHLD.Q R2, -5, R2
>   RTS
> ...
>
> Though, this will take 24 bytes to encode, and wont be fast.
>
> Also, currently the only instructions that take 64 bit immediate values
> are:
>   MOV Imm64, Rn
>   ADD Imm64, Rn
>   PLDCXH Imm64, Xn  //4x Binary16 to 4x Binary32
>
> ...
>
Q+ is almost the same as MY66000

muluh r1,r1,#-2492803253203993461
lsr r1,r1,#5
ret

but ret is only two bytes.

Re: Alternative Representations of the Concertina II ISA

<ulabcv$3p63l$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!news.furie.org.uk!usenet.goja.nl.eu.org!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: cr88192@gmail.com (BGB)
Newsgroups: comp.arch
Subject: Re: Alternative Representations of the Concertina II ISA
Date: Tue, 12 Dec 2023 13:13:35 -0600
Organization: A noiseless patient Spider
Lines: 113
Message-ID: <ulabcv$3p63l$1@dont-email.me>
References: <ujp81t$26ff9$1@dont-email.me>
<43f9c94c44017bc3becd8d9c58d846d5@news.novabbs.com>
<ujr8l8$2g4e8$1@dont-email.me>
<f693434f205f88781a86a0c6fac43eda@news.novabbs.com>
<uk0rek$3flrp$1@dont-email.me> <uk1cbs$3lign$1@dont-email.me>
<2023Nov27.101759@mips.complang.tuwien.ac.at>
<3020102144e0e12cd79c784d2b80af78@news.novabbs.com>
<uko9la$e2he$2@dont-email.me>
<c8a110514d5c8cb0534e217912a0369e@news.novabbs.com>
<ul2bu4$2a7gb$2@dont-email.me>
<a6924ec0fe2b7570aabc143b4e2604e5@news.novabbs.com>
<ul6p4t$m8s4$1@newsreader4.netcologne.de>
<5b7aac36c16943ab6f861b49f1c7e832@news.novabbs.com>
<ul8tf4$nmjf$2@newsreader4.netcologne.de> <ul97fm$3jm6g$1@dont-email.me>
<ula1lv$3nhh3$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 12 Dec 2023 19:13:36 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="747987315b883a8419e0086aa12f2688";
logging-data="3971189"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19QNDFNhYDp5En775z1NIbL"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:jPf3bzdNi+T7YChvktvdAa3rVjE=
Content-Language: en-US
In-Reply-To: <ula1lv$3nhh3$1@dont-email.me>
 by: BGB - Tue, 12 Dec 2023 19:13 UTC

On 12/12/2023 10:27 AM, Robert Finch wrote:
> On 2023-12-12 4:00 a.m., BGB wrote:
>> On 12/12/2023 12:09 AM, Thomas Koenig wrote:
>>> MitchAlsup <mitchalsup@aol.com> schrieb:
>>>> Thomas Koenig wrote:
>>>>
>>>>> MitchAlsup <mitchalsup@aol.com> schrieb:
>>>>>
>>>>> #include <stdint.h>
>>>>
>>>>> uint32_t div25 (uint32_t n)
>>>>> {
>>>>>    return n / 25;
>>>>> }
>>>>
>>>>> yields
>>>>
>>>>> div25:
>>>>>          lis 9,0x51eb        // cycle 1
>>>>>          ori 9,9,0x851f    // cycle 2
>>>>>          mulhwu 3,3,9        // cycle 3-6
>>>>>          srwi 3,3,3        // cycle 7
>>>>>          blr            // cycle 8
>>>>
>>>> div25:
>>>>     CARRY R8,{{O}}       // cycle 1
>>>>     MUL R1,R1,#0x51eb851f    // cycle 1-4
>>>>     SLL R1,R8,#35        // cycle 5
>>>>     RET            // cycle 6
>>>
>>> Then let's use a 64-bit example:
>>>
>>> #include <stdint.h>
>>>
>>> uint64_t div (uint64_t n)
>>> {
>>>    return n / 37;
>>> }
>>>
>>> which becomes
>>>
>>> div:
>>> .LFB0:
>>>          .cfi_startproc
>>>          movabsq $-2492803253203993461, %rax
>>>          mulq    %rdi
>>>          movq    %rdx, %rax
>>>          shrq    $5, %rax
>>>          ret
>>>
>>> on x86_64 (so, use the high result only and shift it five bits to
>>> the right) and, with Power10,
>>>
>>> div:
>>>          pli 10,3714566310
>>>          pli 9,232160395
>>>          rldimi 9,10,32,0
>>>          mulhdu 3,3,9
>>>          srdi 3,3,5
>>>          blr
>>>
>>> (The first three instructions are pasting together the constant, which
>>> of course My 66000 can do much better :-)
>>>
>>> A hypothetical My66000 code could be
>>>
>>>        mulhu    r1, r1, #-2492803253203993461
>>>        srl    r1, r1, #5
>>>        ret
>>>
>>
>> And, for comparison, on BJX2 (with the MULQ extension):
>>    MOV -2492803253203993461, R3
>>    MULHU.Q R4, R3, R2
>>    SHLD.Q R2, -5, R2
>>    RTS
>> ...
>>
>> Though, this will take 24 bytes to encode, and wont be fast.
>>
>> Also, currently the only instructions that take 64 bit immediate
>> values are:
>>    MOV Imm64, Rn
>>    ADD Imm64, Rn
>>    PLDCXH Imm64, Xn  //4x Binary16 to 4x Binary32
>>
>> ...
>>
> Q+ is almost the same as MY66000
>
> muluh r1,r1,#-2492803253203993461
> lsr r1,r1,#5
> ret
>
> but ret is only two bytes.
>

In my case, RTS is 16 bits in Baseline mode, 32 bits in XG2 mode (either
way, it effectively performs a branch to the address held in the link
register).

In my case, it is limited both by the instruction encoding rules
currently only allowing for a 96-bit instruction (which, in turn, and
only express a 64-bit immediate for a few ops).

To be able to encode a multiply with a 64-bit immediate would
effectively require a 128-bit instruction encoding (Say: FE-FE-FF-OP,
with the FF being able to glue a 17-bit immediate onto some instructions
that wouldn't normally be able to have an immediate, and 24+24+17=65).

....

Re: Alternative Representations of the Concertina II ISA

<82245c8faff3f35544489243157b0dbf@news.novabbs.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!.POSTED!not-for-mail
From: mitchalsup@aol.com (MitchAlsup)
Newsgroups: comp.arch
Subject: Re: Alternative Representations of the Concertina II ISA
Date: Tue, 12 Dec 2023 20:43:52 +0000
Organization: novaBBS
Message-ID: <82245c8faff3f35544489243157b0dbf@news.novabbs.com>
References: <ujp81t$26ff9$1@dont-email.me> <43f9c94c44017bc3becd8d9c58d846d5@news.novabbs.com> <ujr8l8$2g4e8$1@dont-email.me> <f693434f205f88781a86a0c6fac43eda@news.novabbs.com> <uk0rek$3flrp$1@dont-email.me> <uk1cbs$3lign$1@dont-email.me> <2023Nov27.101759@mips.complang.tuwien.ac.at> <3020102144e0e12cd79c784d2b80af78@news.novabbs.com> <uko9la$e2he$2@dont-email.me> <c8a110514d5c8cb0534e217912a0369e@news.novabbs.com> <ul2bu4$2a7gb$2@dont-email.me> <a6924ec0fe2b7570aabc143b4e2604e5@news.novabbs.com> <ul6p4t$m8s4$1@newsreader4.netcologne.de> <5b7aac36c16943ab6f861b49f1c7e832@news.novabbs.com> <ul8tf4$nmjf$2@newsreader4.netcologne.de> <ul97fm$3jm6g$1@dont-email.me> <ula1lv$3nhh3$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="3913952"; mail-complaints-to="usenet@i2pn2.org";
posting-account="t+lO0yBNO1zGxasPvGSZV1BRu71QKx+JE37DnW+83jQ";
User-Agent: Rocksolid Light
X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on novalink.us
X-Rslight-Posting-User: 7e9c45bcd6d4757c5904fbe9a694742e6f8aa949
X-Rslight-Site: $2y$10$oXxyOX9TPsH5xzsikaTFUeBmNWznSPUVlkJrB8k2LguapSB409FnC
 by: MitchAlsup - Tue, 12 Dec 2023 20:43 UTC

Robert Finch wrote:

> On 2023-12-12 4:00 a.m., BGB wrote:
>> On 12/12/2023 12:09 AM, Thomas Koenig wrote:
>>> MitchAlsup <mitchalsup@aol.com> schrieb:
>>>> Thomas Koenig wrote:
>>>>
>>>>> MitchAlsup <mitchalsup@aol.com> schrieb:
>>>>>
>>>>> #include <stdint.h>
>>>>
>>>>> uint32_t div25 (uint32_t n)
>>>>> {
>>>>>    return n / 25;
>>>>> }
>>>>
>>>>> yields
>>>>
>>>>> div25:
>>>>>          lis 9,0x51eb        // cycle 1
>>>>>          ori 9,9,0x851f    // cycle 2
>>>>>          mulhwu 3,3,9        // cycle 3-6
>>>>>          srwi 3,3,3        // cycle 7
>>>>>          blr            // cycle 8
>>>>
>>>> div25:
>>>>     CARRY R8,{{O}}       // cycle 1
>>>>     MUL R1,R1,#0x51eb851f    // cycle 1-4
>>>>     SLL R1,R8,#35        // cycle 5
>>>>     RET            // cycle 6
>>>
>>> Then let's use a 64-bit example:
>>>
>>> #include <stdint.h>
>>>
>>> uint64_t div (uint64_t n)
>>> {
>>>    return n / 37;
>>> }
>>>
>>> which becomes
>>>
>>> div:
>>> .LFB0:
>>>          .cfi_startproc
>>>          movabsq $-2492803253203993461, %rax
>>>          mulq    %rdi
>>>          movq    %rdx, %rax
>>>          shrq    $5, %rax
>>>          ret
>>>
>>> on x86_64 (so, use the high result only and shift it five bits to
>>> the right) and, with Power10,
>>>
>>> div:
>>>          pli 10,3714566310
>>>          pli 9,232160395
>>>          rldimi 9,10,32,0
>>>          mulhdu 3,3,9
>>>          srdi 3,3,5
>>>          blr
>>>
>>> (The first three instructions are pasting together the constant, which
>>> of course My 66000 can do much better :-)
>>>
>>> A hypothetical My66000 code could be
>>>
>>>        mulhu    r1, r1, #-2492803253203993461
>>>        srl    r1, r1, #5
>>>        ret
>>>
>>
>> And, for comparison, on BJX2 (with the MULQ extension):
>>   MOV -2492803253203993461, R3
>>   MULHU.Q R4, R3, R2
>>   SHLD.Q R2, -5, R2
>>   RTS
>> ...
>>
>> Though, this will take 24 bytes to encode, and wont be fast.
>>
>> Also, currently the only instructions that take 64 bit immediate values
>> are:
>>   MOV Imm64, Rn
>>   ADD Imm64, Rn
>>   PLDCXH Imm64, Xn  //4x Binary16 to 4x Binary32
>>
>> ...
>>
> Q+ is almost the same as MY66000

> muluh r1,r1,#-2492803253203993461
> lsr r1,r1,#5
> ret

> but ret is only two bytes.

When subroutines are aligned to cache line boundaries, that adds nothing.

Re: Alternative Representations of the Concertina II ISA

<ulakmt$3qn4g$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: cr88192@gmail.com (BGB)
Newsgroups: comp.arch
Subject: Re: Alternative Representations of the Concertina II ISA
Date: Tue, 12 Dec 2023 15:52:26 -0600
Organization: A noiseless patient Spider
Lines: 123
Message-ID: <ulakmt$3qn4g$1@dont-email.me>
References: <ujp81t$26ff9$1@dont-email.me>
<43f9c94c44017bc3becd8d9c58d846d5@news.novabbs.com>
<ujr8l8$2g4e8$1@dont-email.me>
<f693434f205f88781a86a0c6fac43eda@news.novabbs.com>
<uk0rek$3flrp$1@dont-email.me> <uk1cbs$3lign$1@dont-email.me>
<2023Nov27.101759@mips.complang.tuwien.ac.at>
<3020102144e0e12cd79c784d2b80af78@news.novabbs.com>
<uko9la$e2he$2@dont-email.me>
<c8a110514d5c8cb0534e217912a0369e@news.novabbs.com>
<ul2bu4$2a7gb$2@dont-email.me>
<a6924ec0fe2b7570aabc143b4e2604e5@news.novabbs.com>
<ul6p4t$m8s4$1@newsreader4.netcologne.de>
<5b7aac36c16943ab6f861b49f1c7e832@news.novabbs.com>
<ul8tf4$nmjf$2@newsreader4.netcologne.de> <ul97fm$3jm6g$1@dont-email.me>
<ula1lv$3nhh3$1@dont-email.me>
<82245c8faff3f35544489243157b0dbf@news.novabbs.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 12 Dec 2023 21:52:29 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="747987315b883a8419e0086aa12f2688";
logging-data="4021392"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19yZ6JnJhchXpX5zvzXgt+s"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:LeGbf1CYpeShur00iPhRLVTUXWc=
Content-Language: en-US
In-Reply-To: <82245c8faff3f35544489243157b0dbf@news.novabbs.com>
 by: BGB - Tue, 12 Dec 2023 21:52 UTC

On 12/12/2023 2:43 PM, MitchAlsup wrote:
> Robert Finch wrote:
>
>> On 2023-12-12 4:00 a.m., BGB wrote:
>>> On 12/12/2023 12:09 AM, Thomas Koenig wrote:
>>>> MitchAlsup <mitchalsup@aol.com> schrieb:
>>>>> Thomas Koenig wrote:
>>>>>
>>>>>> MitchAlsup <mitchalsup@aol.com> schrieb:
>>>>>>
>>>>>> #include <stdint.h>
>>>>>
>>>>>> uint32_t div25 (uint32_t n)
>>>>>> {
>>>>>>    return n / 25;
>>>>>> }
>>>>>
>>>>>> yields
>>>>>
>>>>>> div25:
>>>>>>          lis 9,0x51eb        // cycle 1
>>>>>>          ori 9,9,0x851f    // cycle 2
>>>>>>          mulhwu 3,3,9        // cycle 3-6
>>>>>>          srwi 3,3,3        // cycle 7
>>>>>>          blr            // cycle 8
>>>>>
>>>>> div25:
>>>>>     CARRY R8,{{O}}       // cycle 1
>>>>>     MUL R1,R1,#0x51eb851f    // cycle 1-4
>>>>>     SLL R1,R8,#35        // cycle 5
>>>>>     RET            // cycle 6
>>>>
>>>> Then let's use a 64-bit example:
>>>>
>>>> #include <stdint.h>
>>>>
>>>> uint64_t div (uint64_t n)
>>>> {
>>>>    return n / 37;
>>>> }
>>>>
>>>> which becomes
>>>>
>>>> div:
>>>> .LFB0:
>>>>          .cfi_startproc
>>>>          movabsq $-2492803253203993461, %rax
>>>>          mulq    %rdi
>>>>          movq    %rdx, %rax
>>>>          shrq    $5, %rax
>>>>          ret
>>>>
>>>> on x86_64 (so, use the high result only and shift it five bits to
>>>> the right) and, with Power10,
>>>>
>>>> div:
>>>>          pli 10,3714566310
>>>>          pli 9,232160395
>>>>          rldimi 9,10,32,0
>>>>          mulhdu 3,3,9
>>>>          srdi 3,3,5
>>>>          blr
>>>>
>>>> (The first three instructions are pasting together the constant, which
>>>> of course My 66000 can do much better :-)
>>>>
>>>> A hypothetical My66000 code could be
>>>>
>>>>        mulhu    r1, r1, #-2492803253203993461
>>>>        srl    r1, r1, #5
>>>>        ret
>>>>
>>>
>>> And, for comparison, on BJX2 (with the MULQ extension):
>>>    MOV -2492803253203993461, R3
>>>    MULHU.Q R4, R3, R2
>>>    SHLD.Q R2, -5, R2
>>>    RTS
>>> ...
>>>
>>> Though, this will take 24 bytes to encode, and wont be fast.
>>>
>>> Also, currently the only instructions that take 64 bit immediate
>>> values are:
>>>    MOV Imm64, Rn
>>>    ADD Imm64, Rn
>>>    PLDCXH Imm64, Xn  //4x Binary16 to 4x Binary32
>>>
>>> ...
>>>
>> Q+ is almost the same as MY66000
>
>> muluh r1,r1,#-2492803253203993461
>> lsr r1,r1,#5
>> ret
>
>> but ret is only two bytes.
>
> When subroutines are aligned to cache line boundaries, that adds nothing.

Technically, yes.

Or, even if not, very little, given that RET / RTS is comparably
infrequent...

In other news, did at least go and tweak decoding rules slightly such
that an Op64 prefix can now glue an Imm17s onto most "normal" 3R
instructions, with a few exceptions:
4R and 3R/3RI forms:
These may add either an Imm17s, 4th register, or 3R+Imm9.
This includes the Integer MAC and FMAC instructions.
FPU and FP-SIMD ops, where this encoding encodes a rounding-mode.

This change is N/A for ops not otherwise following the "OP Rm, Ro, Rn"
format.

Or: FFw0-0Vii-F0nm-ZeiZ OP Rm, Imm17s, Rn

This case is mostly intended to allow encoding an immediate form for
many ops which don't otherwise have an immediate form (but does have the
usual drawbacks associated with being a 64-bit encoding).

Re: Alternative Representations of the Concertina II ISA

<ulka0j$uubn$2@newsreader4.netcologne.de>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!news.samoylyk.net!news.szaf.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2001-4dd7-dd23-0-3405-29ed-c929-c26d.ipv6dyn.netcologne.de!not-for-mail
From: tkoenig@netcologne.de (Thomas Koenig)
Newsgroups: comp.arch
Subject: Re: Alternative Representations of the Concertina II ISA
Date: Sat, 16 Dec 2023 13:51:15 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <ulka0j$uubn$2@newsreader4.netcologne.de>
References: <ujp81t$26ff9$1@dont-email.me>
<43f9c94c44017bc3becd8d9c58d846d5@news.novabbs.com>
<ujr8l8$2g4e8$1@dont-email.me>
<f693434f205f88781a86a0c6fac43eda@news.novabbs.com>
<uk0rek$3flrp$1@dont-email.me> <uk1cbs$3lign$1@dont-email.me>
<2023Nov27.101759@mips.complang.tuwien.ac.at>
<3020102144e0e12cd79c784d2b80af78@news.novabbs.com>
<uko9la$e2he$2@dont-email.me>
<c8a110514d5c8cb0534e217912a0369e@news.novabbs.com>
<ul2bu4$2a7gb$2@dont-email.me>
<a6924ec0fe2b7570aabc143b4e2604e5@news.novabbs.com>
<ul6p4t$m8s4$1@newsreader4.netcologne.de>
<5b7aac36c16943ab6f861b49f1c7e832@news.novabbs.com>
<ul8tf4$nmjf$2@newsreader4.netcologne.de>
Injection-Date: Sat, 16 Dec 2023 13:51:15 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd7-dd23-0-3405-29ed-c929-c26d.ipv6dyn.netcologne.de:2001:4dd7:dd23:0:3405:29ed:c929:c26d";
logging-data="1014135"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Sat, 16 Dec 2023 13:51 UTC

Thomas Koenig <tkoenig@netcologne.de> schrieb:

> A hypothetical My66000 code could be
>
> mulhu r1, r1, #-2492803253203993461
> srl r1, r1, #5
> ret

By "hypothetical" I mean that it isn't in the ISA at the moment.

Re: Alternative Representations of the Concertina II ISA

<9cb4c28774cba30222d4a1e6c1f3714a@news.novabbs.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!.POSTED!not-for-mail
From: mitchalsup@aol.com (MitchAlsup)
Newsgroups: comp.arch
Subject: Re: Alternative Representations of the Concertina II ISA
Date: Sat, 16 Dec 2023 19:21:43 +0000
Organization: novaBBS
Message-ID: <9cb4c28774cba30222d4a1e6c1f3714a@news.novabbs.com>
References: <ujp81t$26ff9$1@dont-email.me> <43f9c94c44017bc3becd8d9c58d846d5@news.novabbs.com> <ujr8l8$2g4e8$1@dont-email.me> <f693434f205f88781a86a0c6fac43eda@news.novabbs.com> <uk0rek$3flrp$1@dont-email.me> <uk1cbs$3lign$1@dont-email.me> <2023Nov27.101759@mips.complang.tuwien.ac.at> <3020102144e0e12cd79c784d2b80af78@news.novabbs.com> <uko9la$e2he$2@dont-email.me> <c8a110514d5c8cb0534e217912a0369e@news.novabbs.com> <ul2bu4$2a7gb$2@dont-email.me> <a6924ec0fe2b7570aabc143b4e2604e5@news.novabbs.com> <ul6p4t$m8s4$1@newsreader4.netcologne.de> <5b7aac36c16943ab6f861b49f1c7e832@news.novabbs.com> <ul8tf4$nmjf$2@newsreader4.netcologne.de> <ulka0j$uubn$2@newsreader4.netcologne.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="138624"; mail-complaints-to="usenet@i2pn2.org";
posting-account="t+lO0yBNO1zGxasPvGSZV1BRu71QKx+JE37DnW+83jQ";
User-Agent: Rocksolid Light
X-Rslight-Posting-User: 7e9c45bcd6d4757c5904fbe9a694742e6f8aa949
X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on novalink.us
X-Rslight-Site: $2y$10$8dPbFD8JHk6X175HbVsDP.UEq1MOazKKY.VUgsjYoKzzMJZJ7Ku6u
 by: MitchAlsup - Sat, 16 Dec 2023 19:21 UTC

Thomas Koenig wrote:

> Thomas Koenig <tkoenig@netcologne.de> schrieb:

>> A hypothetical My66000 code could be
>>
>> mulhu r1, r1, #-2492803253203993461
>> srl r1, r1, #5
>> ret

> By "hypothetical" I mean that it isn't in the ISA at the moment.

If I knew what mulhu does I could illuminate::
a) how many bits get multiplied?
b) how many bits are produced?

But assuming h means high, and the widths are 64-bit operands and
128-bit results::

CARRY R1,{{O}{I}}
MUL R2,R1,#-2492803253203993461
SHR R1,R2,<0,5>
RET

Re: Alternative Representations of the Concertina II ISA

<ull85v$vkan$1@newsreader4.netcologne.de>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2001-4dd7-dd23-0-3405-29ed-c929-c26d.ipv6dyn.netcologne.de!not-for-mail
From: tkoenig@netcologne.de (Thomas Koenig)
Newsgroups: comp.arch
Subject: Re: Alternative Representations of the Concertina II ISA
Date: Sat, 16 Dec 2023 22:26:07 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <ull85v$vkan$1@newsreader4.netcologne.de>
References: <ujp81t$26ff9$1@dont-email.me>
<43f9c94c44017bc3becd8d9c58d846d5@news.novabbs.com>
<ujr8l8$2g4e8$1@dont-email.me>
<f693434f205f88781a86a0c6fac43eda@news.novabbs.com>
<uk0rek$3flrp$1@dont-email.me> <uk1cbs$3lign$1@dont-email.me>
<2023Nov27.101759@mips.complang.tuwien.ac.at>
<3020102144e0e12cd79c784d2b80af78@news.novabbs.com>
<uko9la$e2he$2@dont-email.me>
<c8a110514d5c8cb0534e217912a0369e@news.novabbs.com>
<ul2bu4$2a7gb$2@dont-email.me>
<a6924ec0fe2b7570aabc143b4e2604e5@news.novabbs.com>
<ul6p4t$m8s4$1@newsreader4.netcologne.de>
<5b7aac36c16943ab6f861b49f1c7e832@news.novabbs.com>
<ul8tf4$nmjf$2@newsreader4.netcologne.de>
<ulka0j$uubn$2@newsreader4.netcologne.de>
<9cb4c28774cba30222d4a1e6c1f3714a@news.novabbs.com>
Injection-Date: Sat, 16 Dec 2023 22:26:07 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd7-dd23-0-3405-29ed-c929-c26d.ipv6dyn.netcologne.de:2001:4dd7:dd23:0:3405:29ed:c929:c26d";
logging-data="1036631"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Sat, 16 Dec 2023 22:26 UTC

MitchAlsup <mitchalsup@aol.com> schrieb:
> Thomas Koenig wrote:
>
>> Thomas Koenig <tkoenig@netcologne.de> schrieb:
>
>>> A hypothetical My66000 code could be
>>>
>>> mulhu r1, r1, #-2492803253203993461
>>> srl r1, r1, #5
>>> ret
>
>> By "hypothetical" I mean that it isn't in the ISA at the moment.
>
> If I knew what mulhu does I could illuminate::
> a) how many bits get multiplied?
> b) how many bits are produced?
>
> But assuming h means high, and the widths are 64-bit operands and
> 128-bit results::
>
> CARRY R1,{{O}{I}}
> MUL R2,R1,#-2492803253203993461
> SHR R1,R2,<0,5>
> RET

That works, but has two disadvantages over the non-Carry
version: It is longer (by one instruction modifier),
and R2 is overwritten with a value which is not needed.
This is why I think that having a "multiply high signed"
and "multiply high unsigned" operation is a good idea even
when My 66000's Carry is implemented.

Re: Alternative Representations of the Concertina II ISA

<03dece27e788384b218981ddeb64af5c@news.novabbs.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!.POSTED!not-for-mail
From: mitchalsup@aol.com (MitchAlsup)
Newsgroups: comp.arch
Subject: Re: Alternative Representations of the Concertina II ISA
Date: Sat, 16 Dec 2023 23:10:27 +0000
Organization: novaBBS
Message-ID: <03dece27e788384b218981ddeb64af5c@news.novabbs.com>
References: <ujp81t$26ff9$1@dont-email.me> <43f9c94c44017bc3becd8d9c58d846d5@news.novabbs.com> <ujr8l8$2g4e8$1@dont-email.me> <f693434f205f88781a86a0c6fac43eda@news.novabbs.com> <uk0rek$3flrp$1@dont-email.me> <uk1cbs$3lign$1@dont-email.me> <2023Nov27.101759@mips.complang.tuwien.ac.at> <3020102144e0e12cd79c784d2b80af78@news.novabbs.com> <uko9la$e2he$2@dont-email.me> <c8a110514d5c8cb0534e217912a0369e@news.novabbs.com> <ul2bu4$2a7gb$2@dont-email.me> <a6924ec0fe2b7570aabc143b4e2604e5@news.novabbs.com> <ul6p4t$m8s4$1@newsreader4.netcologne.de> <5b7aac36c16943ab6f861b49f1c7e832@news.novabbs.com> <ul8tf4$nmjf$2@newsreader4.netcologne.de> <ulka0j$uubn$2@newsreader4.netcologne.de> <9cb4c28774cba30222d4a1e6c1f3714a@news.novabbs.com> <ull85v$vkan$1@newsreader4.netcologne.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="157111"; mail-complaints-to="usenet@i2pn2.org";
posting-account="t+lO0yBNO1zGxasPvGSZV1BRu71QKx+JE37DnW+83jQ";
User-Agent: Rocksolid Light
X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on novalink.us
X-Rslight-Site: $2y$10$T7Lgn9.CWKNgx90i61D8UeuRDhFvK3zk9YFfqGItVdNPDSoVqyiii
X-Rslight-Posting-User: 7e9c45bcd6d4757c5904fbe9a694742e6f8aa949
 by: MitchAlsup - Sat, 16 Dec 2023 23:10 UTC

Thomas Koenig wrote:

> MitchAlsup <mitchalsup@aol.com> schrieb:
>> Thomas Koenig wrote:
>>
>>> Thomas Koenig <tkoenig@netcologne.de> schrieb:
>>
>>>> A hypothetical My66000 code could be
>>>>
>>>> mulhu r1, r1, #-2492803253203993461
>>>> srl r1, r1, #5
>>>> ret
>>
>>> By "hypothetical" I mean that it isn't in the ISA at the moment.
>>
>> If I knew what mulhu does I could illuminate::
>> a) how many bits get multiplied?
>> b) how many bits are produced?
>>
>> But assuming h means high, and the widths are 64-bit operands and
>> 128-bit results::
>>
>> CARRY R1,{{O}{I}}
>> MUL R2,R1,#-2492803253203993461
>> SHR R1,R2,<0,5>
>> RET

> That works, but has two disadvantages over the non-Carry
> version: It is longer (by one instruction modifier),
> and R2 is overwritten with a value which is not needed.
> This is why I think that having a "multiply high signed"
> and "multiply high unsigned" operation is a good idea even
> when My 66000's Carry is implemented.

Heck:: if you are worried about length::

DIV R1,R1,#27
RET

2 words instead of 6.

Re: Alternative Representations of the Concertina II ISA

<ulm9bc$109lt$1@newsreader4.netcologne.de>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!news.swapon.de!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2001-4dd7-dd23-0-b3b7-1409-c8d9-539f.ipv6dyn.netcologne.de!not-for-mail
From: tkoenig@netcologne.de (Thomas Koenig)
Newsgroups: comp.arch
Subject: Re: Alternative Representations of the Concertina II ISA
Date: Sun, 17 Dec 2023 07:52:12 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <ulm9bc$109lt$1@newsreader4.netcologne.de>
References: <ujp81t$26ff9$1@dont-email.me>
<43f9c94c44017bc3becd8d9c58d846d5@news.novabbs.com>
<ujr8l8$2g4e8$1@dont-email.me>
<f693434f205f88781a86a0c6fac43eda@news.novabbs.com>
<uk0rek$3flrp$1@dont-email.me> <uk1cbs$3lign$1@dont-email.me>
<2023Nov27.101759@mips.complang.tuwien.ac.at>
<3020102144e0e12cd79c784d2b80af78@news.novabbs.com>
<uko9la$e2he$2@dont-email.me>
<c8a110514d5c8cb0534e217912a0369e@news.novabbs.com>
<ul2bu4$2a7gb$2@dont-email.me>
<a6924ec0fe2b7570aabc143b4e2604e5@news.novabbs.com>
<ul6p4t$m8s4$1@newsreader4.netcologne.de>
<5b7aac36c16943ab6f861b49f1c7e832@news.novabbs.com>
<ul8tf4$nmjf$2@newsreader4.netcologne.de>
<ulka0j$uubn$2@newsreader4.netcologne.de>
<9cb4c28774cba30222d4a1e6c1f3714a@news.novabbs.com>
<ull85v$vkan$1@newsreader4.netcologne.de>
<03dece27e788384b218981ddeb64af5c@news.novabbs.com>
Injection-Date: Sun, 17 Dec 2023 07:52:12 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd7-dd23-0-b3b7-1409-c8d9-539f.ipv6dyn.netcologne.de:2001:4dd7:dd23:0:b3b7:1409:c8d9:539f";
logging-data="1058493"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Sun, 17 Dec 2023 07:52 UTC

MitchAlsup <mitchalsup@aol.com> schrieb:
> Thomas Koenig wrote:
>
>> MitchAlsup <mitchalsup@aol.com> schrieb:
>>> Thomas Koenig wrote:
>>>
>>>> Thomas Koenig <tkoenig@netcologne.de> schrieb:
>>>
>>>>> A hypothetical My66000 code could be
>>>>>
>>>>> mulhu r1, r1, #-2492803253203993461
>>>>> srl r1, r1, #5
>>>>> ret
>>>
>>>> By "hypothetical" I mean that it isn't in the ISA at the moment.
>>>
>>> If I knew what mulhu does I could illuminate::
>>> a) how many bits get multiplied?
>>> b) how many bits are produced?
>>>
>>> But assuming h means high, and the widths are 64-bit operands and
>>> 128-bit results::
>>>
>>> CARRY R1,{{O}{I}}
>>> MUL R2,R1,#-2492803253203993461
>>> SHR R1,R2,<0,5>
>>> RET
>
>> That works, but has two disadvantages over the non-Carry
>> version: It is longer (by one instruction modifier),
>> and R2 is overwritten with a value which is not needed.
>> This is why I think that having a "multiply high signed"
>> and "multiply high unsigned" operation is a good idea even
>> when My 66000's Carry is implemented.
>
> Heck:: if you are worried about length::
>
> DIV R1,R1,#27
> RET
>
> 2 words instead of 6.

This is an optimization problem with three objective functions:
Code size, register use and speed. Any solution in which at which
it is no longer possible to improve one of the objective functions
without making the others worse is a valid solution to that problem
(part of the Pareto front, if you want to use that terminology).

The version with the DIV with constant is the smallest, so it
trumps everything else on size. It is, however, likely to be
slower than the other two. It is what I would a compiler to emit
if optimizing for size (-Os), and when not optimizing.

The version with the Carry is likely faster than the DIV with
constant version, but is bigger and uses two registers instead
of one. It is what I would expect a compiler to generate in
the absence of multiply high unsigned and any -O option, except
for -Os.

The hypothetical version with "multiply high unsigned" is smaller
than the version with Carry and is better on register use, so
it is better in that sense. If it existed, I would expect a
compiler to always generate that for any optimization level
except -Os. (Small caveat: Maybe hardware has a fiendishly
clever algorithm to divide by 37 in four or less cycles; this
would then be known to the compiler, and it could chose accordingly).

Re: Alternative Representations of the Concertina II ISA

<c2d787b6d54d8427440fb104aabf22fe@news.novabbs.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!.POSTED!not-for-mail
From: mitchalsup@aol.com (MitchAlsup)
Newsgroups: comp.arch
Subject: Re: Alternative Representations of the Concertina II ISA
Date: Sun, 17 Dec 2023 21:55:47 +0000
Organization: novaBBS
Message-ID: <c2d787b6d54d8427440fb104aabf22fe@news.novabbs.com>
References: <ujp81t$26ff9$1@dont-email.me> <43f9c94c44017bc3becd8d9c58d846d5@news.novabbs.com> <ujr8l8$2g4e8$1@dont-email.me> <f693434f205f88781a86a0c6fac43eda@news.novabbs.com> <uk0rek$3flrp$1@dont-email.me> <uk1cbs$3lign$1@dont-email.me> <2023Nov27.101759@mips.complang.tuwien.ac.at> <3020102144e0e12cd79c784d2b80af78@news.novabbs.com> <uko9la$e2he$2@dont-email.me> <c8a110514d5c8cb0534e217912a0369e@news.novabbs.com> <ul2bu4$2a7gb$2@dont-email.me> <a6924ec0fe2b7570aabc143b4e2604e5@news.novabbs.com> <ul6p4t$m8s4$1@newsreader4.netcologne.de> <5b7aac36c16943ab6f861b49f1c7e832@news.novabbs.com> <ul8tf4$nmjf$2@newsreader4.netcologne.de> <ulka0j$uubn$2@newsreader4.netcologne.de> <9cb4c28774cba30222d4a1e6c1f3714a@news.novabbs.com> <ull85v$vkan$1@newsreader4.netcologne.de> <03dece27e788384b218981ddeb64af5c@news.novabbs.com> <ulm9bc$109lt$1@newsreader4.netcologne.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="255061"; mail-complaints-to="usenet@i2pn2.org";
posting-account="t+lO0yBNO1zGxasPvGSZV1BRu71QKx+JE37DnW+83jQ";
User-Agent: Rocksolid Light
X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on novalink.us
X-Rslight-Site: $2y$10$rkNOsPgbDLdFJ2fP8rjXLOTscpnueok3oks0Oz5LLpUA5U919ZIbi
X-Rslight-Posting-User: 7e9c45bcd6d4757c5904fbe9a694742e6f8aa949
 by: MitchAlsup - Sun, 17 Dec 2023 21:55 UTC

Thomas Koenig wrote:

> MitchAlsup <mitchalsup@aol.com> schrieb:
>> Thomas Koenig wrote:
>>
>>> MitchAlsup <mitchalsup@aol.com> schrieb:
>>>> Thomas Koenig wrote:
>>>>
>>>>> Thomas Koenig <tkoenig@netcologne.de> schrieb:
>>>>
>>>>>> A hypothetical My66000 code could be
>>>>>>
>>>>>> mulhu r1, r1, #-2492803253203993461
>>>>>> srl r1, r1, #5
>>>>>> ret
>>>>
>>>>> By "hypothetical" I mean that it isn't in the ISA at the moment.
>>>>
>>>> If I knew what mulhu does I could illuminate::
>>>> a) how many bits get multiplied?
>>>> b) how many bits are produced?
>>>>
>>>> But assuming h means high, and the widths are 64-bit operands and
>>>> 128-bit results::
>>>>
>>>> CARRY R1,{{O}{I}}
>>>> MUL R2,R1,#-2492803253203993461
>>>> SHR R1,R2,<0,5>
>>>> RET
>>
>>> That works, but has two disadvantages over the non-Carry
>>> version: It is longer (by one instruction modifier),
>>> and R2 is overwritten with a value which is not needed.
>>> This is why I think that having a "multiply high signed"
>>> and "multiply high unsigned" operation is a good idea even
>>> when My 66000's Carry is implemented.
>>
>> Heck:: if you are worried about length::
>>
>> DIV R1,R1,#27
>> RET
>>
>> 2 words instead of 6.

> This is an optimization problem with three objective functions:
> Code size, register use and speed. Any solution in which at which
> it is no longer possible to improve one of the objective functions
> without making the others worse is a valid solution to that problem
> (part of the Pareto front, if you want to use that terminology).

> The version with the DIV with constant is the smallest, so it
> trumps everything else on size. It is, however, likely to be
> slower than the other two. It is what I would a compiler to emit
> if optimizing for size (-Os), and when not optimizing.

Since I do IDIV in the FMAC unit, and integers are not normalized::
FMAC passes both operands through the normalizer's Find First logic
and knows the significance of the numerator and denominator.

Thus, for this case, 27 is detected to have only 5-bits of significance
and the 1-bit per loop* only takes 5 cycles. Giving a fall through time
of 8-cycles total.

(*) assuming a 1-bit at a time loop--which I would not do--but I
still do the normalization steps to make the integers smell like
FP numbers, so, 1 Goldschmidt step and 1 Newton-Raphson step and
you have 8 cycle IDIV for denominators with less than 8-bits of
significance, 10-cycles for denominators of less then 16-bits,...

> The version with the Carry is likely faster than the DIV with
> constant version, but is bigger and uses two registers instead
> of one. It is what I would expect a compiler to generate in
> the absence of multiply high unsigned and any -O option, except
> for -Os.

What if we solve the problem by making IDIV fast instead !!

Given a fast IDIV, is there any use for IMULH ??

> The hypothetical version with "multiply high unsigned" is smaller
> than the version with Carry and is better on register use, so

I should point out that having the constant attached to the
MUL (as is were) you have already saves a register compared to
ISAs without large constants.

> it is better in that sense. If it existed, I would expect a
> compiler to always generate that for any optimization level
> except -Os. (Small caveat: Maybe hardware has a fiendishly
> clever algorithm to divide by 37 in four or less cycles; this
> would then be known to the compiler, and it could chose accordingly).

This is one gigantic reason to use FDIV to perform IDIV--and another
smaller one not to separate register files. FIDVs are in the 17-20
cycle range, why should IDIV not also be in that range ??

Re: Alternative Representations of the Concertina II ISA

<ulodeo$3ast0$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!news.samoylyk.net!hugayda.aid.in.ua!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: paaronclayton@gmail.com (Paul A. Clayton)
Newsgroups: comp.arch
Subject: Re: Alternative Representations of the Concertina II ISA
Date: Sun, 17 Dec 2023 22:14:30 -0500
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <ulodeo$3ast0$1@dont-email.me>
References: <ujp81t$26ff9$1@dont-email.me>
<43f9c94c44017bc3becd8d9c58d846d5@news.novabbs.com>
<ujr8l8$2g4e8$1@dont-email.me>
<f693434f205f88781a86a0c6fac43eda@news.novabbs.com>
<uk0rek$3flrp$1@dont-email.me> <uk1cbs$3lign$1@dont-email.me>
<2023Nov27.101759@mips.complang.tuwien.ac.at>
<3020102144e0e12cd79c784d2b80af78@news.novabbs.com>
<uko9la$e2he$2@dont-email.me>
<c8a110514d5c8cb0534e217912a0369e@news.novabbs.com>
<ul2bu4$2a7gb$2@dont-email.me>
<a6924ec0fe2b7570aabc143b4e2604e5@news.novabbs.com>
<ul6p4t$m8s4$1@newsreader4.netcologne.de>
<5b7aac36c16943ab6f861b49f1c7e832@news.novabbs.com>
<ul8tf4$nmjf$2@newsreader4.netcologne.de>
<ulka0j$uubn$2@newsreader4.netcologne.de>
<9cb4c28774cba30222d4a1e6c1f3714a@news.novabbs.com>
<ull85v$vkan$1@newsreader4.netcologne.de>
<03dece27e788384b218981ddeb64af5c@news.novabbs.com>
<ulm9bc$109lt$1@newsreader4.netcologne.de>
<c2d787b6d54d8427440fb104aabf22fe@news.novabbs.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 18 Dec 2023 03:14:33 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="cc336373cd61ea6cd9a20d66838d2ebd";
logging-data="3503008"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18ltSCIclQABUmFG+WiMsM2iuI991Ea3G4="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.0
Cancel-Lock: sha1:eXD0a9ObPBppjp+AAR5eTlN8EeQ=
In-Reply-To: <c2d787b6d54d8427440fb104aabf22fe@news.novabbs.com>
 by: Paul A. Clayton - Mon, 18 Dec 2023 03:14 UTC

On 12/17/23 4:55 PM, MitchAlsup wrote:
[snip]
> What if we solve the problem by making IDIV fast instead !!
>
> Given a fast IDIV, is there any use for IMULH ??

I saw using IMULH (or better a "division based on providing a
reciprocal") as a method to perform common subexpression
elimination on the iterative refinement of the reciprocal for
constants and for reused values. Storing and reusing the
reciprocal just seemed to make sense, though sometimes recomputing
may have less overhead.

Latency is also not the only consideration. Energy use is also a
consideration.

This technique might also be applicable when divisors are not
identical, but I doubt that would be very useful (though I vaguely
recall reading that some scientific computation had such divisions
somewhat commonly).

Hardware memoization of reciprocals has been proposed. I merely
thought that allowing a compiler to cache (and reuse) reciprocals
might be useful.

Re: Alternative Representations of the Concertina II ISA

<ulp8p7$3fcr8$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: terje.mathisen@tmsw.no (Terje Mathisen)
Newsgroups: comp.arch
Subject: Re: Alternative Representations of the Concertina II ISA
Date: Mon, 18 Dec 2023 12:00:54 +0100
Organization: A noiseless patient Spider
Lines: 49
Message-ID: <ulp8p7$3fcr8$1@dont-email.me>
References: <ujp81t$26ff9$1@dont-email.me>
<43f9c94c44017bc3becd8d9c58d846d5@news.novabbs.com>
<ujr8l8$2g4e8$1@dont-email.me>
<f693434f205f88781a86a0c6fac43eda@news.novabbs.com>
<uk0rek$3flrp$1@dont-email.me> <uk1cbs$3lign$1@dont-email.me>
<2023Nov27.101759@mips.complang.tuwien.ac.at>
<3020102144e0e12cd79c784d2b80af78@news.novabbs.com>
<uko9la$e2he$2@dont-email.me>
<c8a110514d5c8cb0534e217912a0369e@news.novabbs.com>
<ul2bu4$2a7gb$2@dont-email.me>
<a6924ec0fe2b7570aabc143b4e2604e5@news.novabbs.com>
<ul6p4t$m8s4$1@newsreader4.netcologne.de>
<5b7aac36c16943ab6f861b49f1c7e832@news.novabbs.com>
<ul8tf4$nmjf$2@newsreader4.netcologne.de>
<ulka0j$uubn$2@newsreader4.netcologne.de>
<9cb4c28774cba30222d4a1e6c1f3714a@news.novabbs.com>
<ull85v$vkan$1@newsreader4.netcologne.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 18 Dec 2023 11:00:55 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="f3c2ca2b59784eb76ba7accbb808f231";
logging-data="3650408"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/vOqHk1882VdQAxPzucjCO0KglOX90XdXYMdhuonDc/w=="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.18
Cancel-Lock: sha1:Kw7N/RkYwMcdoQl6LlnG0OeTVqg=
In-Reply-To: <ull85v$vkan$1@newsreader4.netcologne.de>
 by: Terje Mathisen - Mon, 18 Dec 2023 11:00 UTC

Thomas Koenig wrote:
> MitchAlsup <mitchalsup@aol.com> schrieb:
>> Thomas Koenig wrote:
>>
>>> Thomas Koenig <tkoenig@netcologne.de> schrieb:
>>
>>>> A hypothetical My66000 code could be
>>>>
>>>> mulhu r1, r1, #-2492803253203993461
>>>> srl r1, r1, #5
>>>> ret
>>
>>> By "hypothetical" I mean that it isn't in the ISA at the moment.
>>
>> If I knew what mulhu does I could illuminate::
>> a) how many bits get multiplied?
>> b) how many bits are produced?
>>
>> But assuming h means high, and the widths are 64-bit operands and
>> 128-bit results::
>>
>> CARRY R1,{{O}{I}}
>> MUL R2,R1,#-2492803253203993461
>> SHR R1,R2,<0,5>
>> RET
>
> That works, but has two disadvantages over the non-Carry
> version: It is longer (by one instruction modifier),
> and R2 is overwritten with a value which is not needed.
> This is why I think that having a "multiply high signed"
> and "multiply high unsigned" operation is a good idea even
> when My 66000's Carry is implemented.

I disagree:

The R2 overwrite really doesn't matter since the OoO circuitry will
quickly notice that the value isn't used at all, and the extra CARRY
modifier does not make the code any slower: It will still take exactly
the latency of MUL + SHR, so presumably 5-6 total cycles.

Since MULHU is very rarely used in regular code (pretty much only in
constant divisions that got replaced with reciprocal muls), this tiny
overhead is a very good deal.

Terje

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

Re: Alternative Representations of the Concertina II ISA

<uls7fj$141v3$1@newsreader4.netcologne.de>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2001-4dd7-dd23-0-e011-e4d7-b00e-43ad.ipv6dyn.netcologne.de!not-for-mail
From: tkoenig@netcologne.de (Thomas Koenig)
Newsgroups: comp.arch
Subject: Re: Alternative Representations of the Concertina II ISA
Date: Tue, 19 Dec 2023 13:57:07 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <uls7fj$141v3$1@newsreader4.netcologne.de>
References: <ujp81t$26ff9$1@dont-email.me>
<43f9c94c44017bc3becd8d9c58d846d5@news.novabbs.com>
<ujr8l8$2g4e8$1@dont-email.me>
<f693434f205f88781a86a0c6fac43eda@news.novabbs.com>
<uk0rek$3flrp$1@dont-email.me> <uk1cbs$3lign$1@dont-email.me>
<2023Nov27.101759@mips.complang.tuwien.ac.at>
<3020102144e0e12cd79c784d2b80af78@news.novabbs.com>
<uko9la$e2he$2@dont-email.me>
<c8a110514d5c8cb0534e217912a0369e@news.novabbs.com>
<ul2bu4$2a7gb$2@dont-email.me>
<a6924ec0fe2b7570aabc143b4e2604e5@news.novabbs.com>
<ul6p4t$m8s4$1@newsreader4.netcologne.de>
<5b7aac36c16943ab6f861b49f1c7e832@news.novabbs.com>
<ul8tf4$nmjf$2@newsreader4.netcologne.de>
<ulka0j$uubn$2@newsreader4.netcologne.de>
<9cb4c28774cba30222d4a1e6c1f3714a@news.novabbs.com>
<ull85v$vkan$1@newsreader4.netcologne.de> <ulp8p7$3fcr8$1@dont-email.me>
Injection-Date: Tue, 19 Dec 2023 13:57:07 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd7-dd23-0-e011-e4d7-b00e-43ad.ipv6dyn.netcologne.de:2001:4dd7:dd23:0:e011:e4d7:b00e:43ad";
logging-data="1181667"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Tue, 19 Dec 2023 13:57 UTC

Terje Mathisen <terje.mathisen@tmsw.no> schrieb:
> Thomas Koenig wrote:
>> MitchAlsup <mitchalsup@aol.com> schrieb:
>>> Thomas Koenig wrote:
>>>
>>>> Thomas Koenig <tkoenig@netcologne.de> schrieb:
>>>
>>>>> A hypothetical My66000 code could be
>>>>>
>>>>> mulhu r1, r1, #-2492803253203993461
>>>>> srl r1, r1, #5
>>>>> ret
>>>
>>>> By "hypothetical" I mean that it isn't in the ISA at the moment.
>>>
>>> If I knew what mulhu does I could illuminate::
>>> a) how many bits get multiplied?
>>> b) how many bits are produced?
>>>
>>> But assuming h means high, and the widths are 64-bit operands and
>>> 128-bit results::
>>>
>>> CARRY R1,{{O}{I}}
>>> MUL R2,R1,#-2492803253203993461
>>> SHR R1,R2,<0,5>
>>> RET
>>
>> That works, but has two disadvantages over the non-Carry
>> version: It is longer (by one instruction modifier),
>> and R2 is overwritten with a value which is not needed.
>> This is why I think that having a "multiply high signed"
>> and "multiply high unsigned" operation is a good idea even
>> when My 66000's Carry is implemented.
>
> I disagree:
>
> The R2 overwrite really doesn't matter since the OoO circuitry will
> quickly notice that the value isn't used at all, and the extra CARRY
> modifier does not make the code any slower: It will still take exactly
> the latency of MUL + SHR, so presumably 5-6 total cycles.

You're correct that the register use will probably be elided in
an OoO machine, but the register is still overwritten. This does
not matter for a function that does just that division, but in
larger functions, this can lead to an additional spill/restore.

> Since MULHU is very rarely used in regular code (pretty much only in
> constant divisions that got replaced with reciprocal muls), this tiny
> overhead is a very good deal.

My 66000 has very low register usage, especially due to the encoding
of constants. Another reason are indexed and scaled loads and
stores, which allows fewer registers because, for code like

do i=1,n
a(i) = b(i) + c(i)
end do

there is no need for having a pointer run through a, b and c,
requiring fewer registers.

This is why putting floating point values and integer values into
the same register set actually works well for My 66000, and would
not work so well for others.

Still, when I see an inefficiency, even minor, I tend to remark
on it :-)

Re: Alternative Representations of the Concertina II ISA

<6fc8dc045469288c9c6932ac69d313e9@news.novabbs.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!.POSTED!not-for-mail
From: mitchalsup@aol.com (MitchAlsup)
Newsgroups: comp.arch
Subject: Re: Alternative Representations of the Concertina II ISA
Date: Tue, 19 Dec 2023 18:35:44 +0000
Organization: novaBBS
Message-ID: <6fc8dc045469288c9c6932ac69d313e9@news.novabbs.com>
References: <ujp81t$26ff9$1@dont-email.me> <43f9c94c44017bc3becd8d9c58d846d5@news.novabbs.com> <ujr8l8$2g4e8$1@dont-email.me> <f693434f205f88781a86a0c6fac43eda@news.novabbs.com> <uk0rek$3flrp$1@dont-email.me> <uk1cbs$3lign$1@dont-email.me> <2023Nov27.101759@mips.complang.tuwien.ac.at> <3020102144e0e12cd79c784d2b80af78@news.novabbs.com> <uko9la$e2he$2@dont-email.me> <c8a110514d5c8cb0534e217912a0369e@news.novabbs.com> <ul2bu4$2a7gb$2@dont-email.me> <a6924ec0fe2b7570aabc143b4e2604e5@news.novabbs.com> <ul6p4t$m8s4$1@newsreader4.netcologne.de> <5b7aac36c16943ab6f861b49f1c7e832@news.novabbs.com> <ul8tf4$nmjf$2@newsreader4.netcologne.de> <ulka0j$uubn$2@newsreader4.netcologne.de> <9cb4c28774cba30222d4a1e6c1f3714a@news.novabbs.com> <ull85v$vkan$1@newsreader4.netcologne.de> <ulp8p7$3fcr8$1@dont-email.me> <uls7fj$141v3$1@newsreader4.netcologne.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="454329"; mail-complaints-to="usenet@i2pn2.org";
posting-account="t+lO0yBNO1zGxasPvGSZV1BRu71QKx+JE37DnW+83jQ";
User-Agent: Rocksolid Light
X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on novalink.us
X-Rslight-Posting-User: 7e9c45bcd6d4757c5904fbe9a694742e6f8aa949
X-Rslight-Site: $2y$10$q/doasG3pH2gnUSRAlAkh.4ODv2jQD3p.j0ItZNEH/oyYBJvbo8KK
 by: MitchAlsup - Tue, 19 Dec 2023 18:35 UTC

Thomas Koenig wrote:

> Still, when I see an inefficiency, even minor, I tend to remark
> on it :-)

And that is why we love you.

Pages:1234
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor