Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

My little brother got this fortune: nohup rm -fr /& So he did...


devel / comp.arch / my66 COMPARE operator question

SubjectAuthor
* my66 COMPARE operator questionIvan Godard
+* Re: my66 COMPARE operator questionMitchAlsup
|`* Re: my66 COMPARE operator questionIvan Godard
| `* Re: my66 COMPARE operator questionMitchAlsup
|  `* Re: my66 COMPARE operator questionIvan Godard
|   +* Re: my66 COMPARE operator questionMitchAlsup
|   |`* Re: my66 COMPARE operator questionBGB
|   | `* Re: my66 COMPARE operator questionMitchAlsup
|   |  `* Re: my66 COMPARE operator questionBGB
|   |   +* Re: my66 COMPARE operator questionIvan Godard
|   |   |`* Re: my66 COMPARE operator questionBGB
|   |   | `* Re: my66 COMPARE operator questionIvan Godard
|   |   |  +* Re: my66 COMPARE operator questionMitchAlsup
|   |   |  |+- Re: my66 COMPARE operator questionIvan Godard
|   |   |  |`* Re: my66 COMPARE operator questionBGB
|   |   |  | `* Re: my66 COMPARE operator questionIvan Godard
|   |   |  |  `- Re: my66 COMPARE operator questionBGB
|   |   |  `- Re: my66 COMPARE operator questionBGB
|   |   +* Re: my66 COMPARE operator questionTerje Mathisen
|   |   |`- Re: my66 COMPARE operator questionBGB
|   |   `* Re: my66 COMPARE operator questionMarcus
|   |    +- Re: my66 COMPARE operator questionMitchAlsup
|   |    `* Re: my66 COMPARE operator questionBGB
|   |     `* Re: my66 COMPARE operator questionrobf...@gmail.com
|   |      `* Re: my66 COMPARE operator questionMitchAlsup
|   |       +* Re: my66 COMPARE operator questionBGB
|   |       |`- Re: my66 COMPARE operator questionMitchAlsup
|   |       `* Re: my66 COMPARE operator questionluke.l...@gmail.com
|   |        `- Re: my66 COMPARE operator questionMitchAlsup
|   `- Re: my66 COMPARE operator questionThomas Koenig
`* Re: my66 COMPARE operator questionStefan Monnier
 +- Re: my66 COMPARE operator questionMitchAlsup
 `* Re: my66 COMPARE operator questionMarcus
  `- Re: my66 COMPARE operator questionMitchAlsup

Pages:12
my66 COMPARE operator question

<tf93ab$56s2$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: iva...@millcomputing.com (Ivan Godard)
Newsgroups: comp.arch
Subject: my66 COMPARE operator question
Date: Tue, 6 Sep 2022 20:31:22 -0700
Organization: A noiseless patient Spider
Lines: 5
Message-ID: <tf93ab$56s2$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 7 Sep 2022 03:31:24 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="266c0cea928e2add520b9cdf2b2e4809";
logging-data="170882"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18UF+izJSiyJUr/cD5+NfB8"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.13.0
Cancel-Lock: sha1:HkFJLmtX8t0Xu2g4sM0w+52nHjc=
Content-Language: en-US
 by: Ivan Godard - Wed, 7 Sep 2022 03:31 UTC

Most ISAs (ignoring those with implicit CCs) have a bunch of compare ops
and one- or two-way branches. Mitch has one compare op and a multi-test
branch. ISTM that there's no gain in entropy either way, although one or
the other may pack better if the ISA is stuck with fixed size
instructions. Yes?

Re: my66 COMPARE operator question

<b5ee3bfc-471b-4177-8b8c-cf33783dec1cn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:6214:daf:b0:49f:5ce8:e628 with SMTP id h15-20020a0562140daf00b0049f5ce8e628mr3654534qvh.115.1662566438048;
Wed, 07 Sep 2022 09:00:38 -0700 (PDT)
X-Received: by 2002:a05:622a:174b:b0:343:1fc:14d8 with SMTP id
l11-20020a05622a174b00b0034301fc14d8mr3822630qtk.579.1662566437893; Wed, 07
Sep 2022 09:00:37 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Wed, 7 Sep 2022 09:00:37 -0700 (PDT)
In-Reply-To: <tf93ab$56s2$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:d979:1fcd:bd70:d8be;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:d979:1fcd:bd70:d8be
References: <tf93ab$56s2$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b5ee3bfc-471b-4177-8b8c-cf33783dec1cn@googlegroups.com>
Subject: Re: my66 COMPARE operator question
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Wed, 07 Sep 2022 16:00:38 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 5158
 by: MitchAlsup - Wed, 7 Sep 2022 16:00 UTC

On Tuesday, September 6, 2022 at 10:31:26 PM UTC-5, Ivan Godard wrote:
> Most ISAs (ignoring those with implicit CCs) have a bunch of compare ops
> and one- or two-way branches. Mitch has one compare op and a multi-test
> branch. ISTM that there's no gain in entropy either way, although one or
> the other may pack better if the ISA is stuck with fixed size
> instructions. Yes?
<
It goes deeper than that! CMP creates a bit-vector of all sorts of things one might
want to know between 2 values. This relationship can be sampled in "branch context"
with the Branch-on-Bit (BB) instruction, or it can be sampled in "data context" with
the {signed or unsigned} extract (SL) instruction. Since My 66000 already had
extract instructions, this obviates any need to create SETcc-like instructions,
making the instruction set more "reduced". So with 4 instructions {CMP, FCMP,
BB, and SL} one can do anything one wants from a relationship between 2 values.
Compare this to the SETcc instructions in the INT and FP sides of RISC-V and
the CMP-BC instruction lacking in immediates,.........and come to our own conclusion.
<
RISC-V will argue that CMP-BC saves the compare instruction (code path
length argument) whereas in practice; due to lack of immediates and other
more minor ISA deficiencies, most of the purported gain is lost.
<
When comparing (sic) RISC-V code (and by extension MIPS code) with My
66000 code out of LLVM, we both execute the same number of instructions
in "branch context"*. For as many compare-branches as they do, I get a CMP
with immediate and branch-on-bit (they have to put a constant into a register in
order to use CMP-BC. This alone, gets rid of ½ of any RISC-V advantage that
was thought to exist.)
<
Plus, over on the FP side, RISC-V does not provide FP compare to zero and branch
which My 66000 does. Also, over here, My 66000 can compare to a FP constant
and branch-on bit in 2 instructions, LLVM RISC-V compiler has to synthesize an
address, then load the constant, then SETcc and finally Branch on condition..
<
And finally, My 66000 has a complete set of predicates. Every time a PRED is used
that contains both a then-clause and an else-clause, It saves a branch (and the
power wasted disrupting the FETCH process.)
<
Then there is the problem of epilogues. My 66000 has a single instruction to perform
restoration of the preserved registers and transfer of control back to caller. RISC-V,
because of the length of the epilogue sequence, will branch to the sequence instead
of performing the sequence at multiple locations. My 66000 does not need to
"economize" in this fashion.
<
And at the microarchitectural level, every CMP-BB can be CoIssued as if it
were a single instruction, so can LD-BB, ST-BB, and OPER-BB. You just have to
setup the FETCH-DECODE process to FETCH-wide and be able to issue 2
successive instructions (as long as you don't overload the 3R1W register
porting.)
<
(*) In "branch context" means all of the instructions needed to effect a flow control
decision--including the loading of constants (or other operands) to be compared
against, but not including any arithmetic that was inherent in creating the
situation on which a branch could be effected. For example:: if( x & 7 ); the
AND with #7 is not part of branch context.
<
In counting of CoreMark and LLVM main.c My 66000 only has 95% as many
branches (instructions which potentially alter the flow of control) as RISC_V.
With regards to switch(s); My 66000 uses an indexed table of 16-bit displacements
while RISC-V uses an indexed table of 64-bit absolutes--saving space, avoiding
the waste of a register, and the pollution of the data cache
<
Code size of My 66000 is essentially identical with RISC-V using the compressed
extension when My 66000 uses no compression whatsoever.

Re: my66 COMPARE operator question

<tfaqfg$a57b$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: iva...@millcomputing.com (Ivan Godard)
Newsgroups: comp.arch
Subject: Re: my66 COMPARE operator question
Date: Wed, 7 Sep 2022 12:12:47 -0700
Organization: A noiseless patient Spider
Lines: 72
Message-ID: <tfaqfg$a57b$1@dont-email.me>
References: <tf93ab$56s2$1@dont-email.me>
<b5ee3bfc-471b-4177-8b8c-cf33783dec1cn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 7 Sep 2022 19:12:48 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="266c0cea928e2add520b9cdf2b2e4809";
logging-data="333035"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX187rKs8rrMtN+KFZ4WXYVja"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.13.0
Cancel-Lock: sha1:xU4aXcbDiBhmckIxOlFc5Xky/sE=
In-Reply-To: <b5ee3bfc-471b-4177-8b8c-cf33783dec1cn@googlegroups.com>
Content-Language: en-US
 by: Ivan Godard - Wed, 7 Sep 2022 19:12 UTC

On 9/7/2022 9:00 AM, MitchAlsup wrote:
> On Tuesday, September 6, 2022 at 10:31:26 PM UTC-5, Ivan Godard wrote:
>> Most ISAs (ignoring those with implicit CCs) have a bunch of compare ops
>> and one- or two-way branches. Mitch has one compare op and a multi-test
>> branch. ISTM that there's no gain in entropy either way, although one or
>> the other may pack better if the ISA is stuck with fixed size
>> instructions. Yes?
> <
> It goes deeper than that! CMP creates a bit-vector of all sorts of things one might
> want to know between 2 values. This relationship can be sampled in "branch context"
> with the Branch-on-Bit (BB) instruction, or it can be sampled in "data context" with
> the {signed or unsigned} extract (SL) instruction. Since My 66000 already had
> extract instructions, this obviates any need to create SETcc-like instructions,
> making the instruction set more "reduced". So with 4 instructions {CMP, FCMP,
> BB, and SL} one can do anything one wants from a relationship between 2 values.
> Compare this to the SETcc instructions in the INT and FP sides of RISC-V and
> the CMP-BC instruction lacking in immediates,.........and come to our own conclusion.
> <
> RISC-V will argue that CMP-BC saves the compare instruction (code path
> length argument) whereas in practice; due to lack of immediates and other
> more minor ISA deficiencies, most of the purported gain is lost.
> <
> When comparing (sic) RISC-V code (and by extension MIPS code) with My
> 66000 code out of LLVM, we both execute the same number of instructions
> in "branch context"*. For as many compare-branches as they do, I get a CMP
> with immediate and branch-on-bit (they have to put a constant into a register in
> order to use CMP-BC. This alone, gets rid of ½ of any RISC-V advantage that
> was thought to exist.)
> <
> Plus, over on the FP side, RISC-V does not provide FP compare to zero and branch
> which My 66000 does. Also, over here, My 66000 can compare to a FP constant
> and branch-on bit in 2 instructions, LLVM RISC-V compiler has to synthesize an
> address, then load the constant, then SETcc and finally Branch on condition.
> <
> And finally, My 66000 has a complete set of predicates. Every time a PRED is used
> that contains both a then-clause and an else-clause, It saves a branch (and the
> power wasted disrupting the FETCH process.)
> <
> Then there is the problem of epilogues. My 66000 has a single instruction to perform
> restoration of the preserved registers and transfer of control back to caller. RISC-V,
> because of the length of the epilogue sequence, will branch to the sequence instead
> of performing the sequence at multiple locations. My 66000 does not need to
> "economize" in this fashion.
> <
> And at the microarchitectural level, every CMP-BB can be CoIssued as if it
> were a single instruction, so can LD-BB, ST-BB, and OPER-BB. You just have to
> setup the FETCH-DECODE process to FETCH-wide and be able to issue 2
> successive instructions (as long as you don't overload the 3R1W register
> porting.)
> <
> (*) In "branch context" means all of the instructions needed to effect a flow control
> decision--including the loading of constants (or other operands) to be compared
> against, but not including any arithmetic that was inherent in creating the
> situation on which a branch could be effected. For example:: if( x & 7 ); the
> AND with #7 is not part of branch context.
> <
> In counting of CoreMark and LLVM main.c My 66000 only has 95% as many
> branches (instructions which potentially alter the flow of control) as RISC_V.
> With regards to switch(s); My 66000 uses an indexed table of 16-bit displacements
> while RISC-V uses an indexed table of 64-bit absolutes--saving space, avoiding
> the waste of a register, and the pollution of the data cache
> <
> Code size of My 66000 is essentially identical with RISC-V using the compressed
> extension when My 66000 uses no compression whatsoever.

Yeah, but I was asking entropy, not ISA comparisons. Does one multi-rest
and a result selector have the same entropy as lots of one-way tests and
no selector? Seems to me it does. Whether that entropy packs better into
actual instructions in different ISAs is not the question; if he
entropuis are equal then there is no fundamental entropy reason to
choose one over the other, and so you can leave it up to packing density
and ease of unpack.

Re: my66 COMPARE operator question

<ec758b74-71c0-4f58-8256-50a6e8d52233n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a37:b943:0:b0:6be:a0a7:60cd with SMTP id j64-20020a37b943000000b006bea0a760cdmr4116267qkf.350.1662579748919;
Wed, 07 Sep 2022 12:42:28 -0700 (PDT)
X-Received: by 2002:a37:4553:0:b0:6be:6c1d:92ff with SMTP id
s80-20020a374553000000b006be6c1d92ffmr4018086qka.151.1662579748726; Wed, 07
Sep 2022 12:42:28 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Wed, 7 Sep 2022 12:42:28 -0700 (PDT)
In-Reply-To: <tfaqfg$a57b$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:d979:1fcd:bd70:d8be;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:d979:1fcd:bd70:d8be
References: <tf93ab$56s2$1@dont-email.me> <b5ee3bfc-471b-4177-8b8c-cf33783dec1cn@googlegroups.com>
<tfaqfg$a57b$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ec758b74-71c0-4f58-8256-50a6e8d52233n@googlegroups.com>
Subject: Re: my66 COMPARE operator question
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Wed, 07 Sep 2022 19:42:28 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 64
 by: MitchAlsup - Wed, 7 Sep 2022 19:42 UTC

On Wednesday, September 7, 2022 at 2:12:51 PM UTC-5, Ivan Godard wrote:
> On 9/7/2022 9:00 AM, MitchAlsup wrote:
> > On Tuesday, September 6, 2022 at 10:31:26 PM UTC-5, Ivan Godard wrote:
> >> Most ISAs (ignoring those with implicit CCs) have a bunch of compare ops
> >> and one- or two-way branches. Mitch has one compare op and a multi-test
> >> branch. ISTM that there's no gain in entropy either way, although one or
> >> the other may pack better if the ISA is stuck with fixed size
> >> instructions. Yes?
<judicious snip>
> > In counting of CoreMark and LLVM main.c My 66000 only has 95% as many
> > branches (instructions which potentially alter the flow of control) as RISC_V.
> > With regards to switch(s); My 66000 uses an indexed table of 16-bit displacements
> > while RISC-V uses an indexed table of 64-bit absolutes--saving space, avoiding
> > the waste of a register, and the pollution of the data cache
> > <
> > Code size of My 66000 is essentially identical with RISC-V using the compressed
> > extension when My 66000 uses no compression whatsoever.
<
> Yeah, but I was asking entropy, not ISA comparisons. Does one multi-rest
> and a result selector have the same entropy as lots of one-way tests and
> no selector? Seems to me it does.
<
Depends if you are defining entropy in OpCodes or bits or semantic actions ?
{That is are you measuring entropy before-or-after performing the act of
instruction-encode.}
<
< Whether that entropy packs better into
> actual instructions in different ISAs is not the question; if he
> entropuis are equal then there is no fundamental entropy reason to
> choose one over the other, and so you can leave it up to packing density
> and ease of unpack.
<
My general guess (GUESS) is that if RISC-V had the universal constant scheme
of My 66000, that RISC-V CMP-BC instruction would have greater density. But
they don't and I can't see any way of them getting there.*
<
How much greater ? :: down in the 1% OpCode range.
<
I was surprised how infrequent RISC-V CMP-BC occurred in actual code, and
how often the compiler changed counted loops into count up to zero. I was
also surprised to discover real code of RISC-V having to paste a constant in
order to do:: {if, for, while}×( x rel_op constant ).
<
(*) But I think what you are getting at is related to my statement from about 18
months ago when I stated the ideal size of a fixed format instruction was about
36-bits.

Re: my66 COMPARE operator question

<tfbkk6$f5mq$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: iva...@millcomputing.com (Ivan Godard)
Newsgroups: comp.arch
Subject: Re: my66 COMPARE operator question
Date: Wed, 7 Sep 2022 19:39:00 -0700
Organization: A noiseless patient Spider
Lines: 78
Message-ID: <tfbkk6$f5mq$1@dont-email.me>
References: <tf93ab$56s2$1@dont-email.me>
<b5ee3bfc-471b-4177-8b8c-cf33783dec1cn@googlegroups.com>
<tfaqfg$a57b$1@dont-email.me>
<ec758b74-71c0-4f58-8256-50a6e8d52233n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 8 Sep 2022 02:39:02 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="d5cdeaa72bdb1b0e1b6fbae94a59eba2";
logging-data="497370"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18WsCJPjwvLSMx/1sJ/UMen"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.13.0
Cancel-Lock: sha1:zCDhtCGK3xIFVg92Ep9I71v+KbU=
Content-Language: en-US
In-Reply-To: <ec758b74-71c0-4f58-8256-50a6e8d52233n@googlegroups.com>
 by: Ivan Godard - Thu, 8 Sep 2022 02:39 UTC

On 9/7/2022 12:42 PM, MitchAlsup wrote:
> On Wednesday, September 7, 2022 at 2:12:51 PM UTC-5, Ivan Godard wrote:
>> On 9/7/2022 9:00 AM, MitchAlsup wrote:
>>> On Tuesday, September 6, 2022 at 10:31:26 PM UTC-5, Ivan Godard wrote:
>>>> Most ISAs (ignoring those with implicit CCs) have a bunch of compare ops
>>>> and one- or two-way branches. Mitch has one compare op and a multi-test
>>>> branch. ISTM that there's no gain in entropy either way, although one or
>>>> the other may pack better if the ISA is stuck with fixed size
>>>> instructions. Yes?
> <judicious snip>
>>> In counting of CoreMark and LLVM main.c My 66000 only has 95% as many
>>> branches (instructions which potentially alter the flow of control) as RISC_V.
>>> With regards to switch(s); My 66000 uses an indexed table of 16-bit displacements
>>> while RISC-V uses an indexed table of 64-bit absolutes--saving space, avoiding
>>> the waste of a register, and the pollution of the data cache
>>> <
>>> Code size of My 66000 is essentially identical with RISC-V using the compressed
>>> extension when My 66000 uses no compression whatsoever.
> <
>> Yeah, but I was asking entropy, not ISA comparisons. Does one multi-rest
>> and a result selector have the same entropy as lots of one-way tests and
>> no selector? Seems to me it does.
> <
> Depends if you are defining entropy in OpCodes or bits or semantic actions ?
> {That is are you measuring entropy before-or-after performing the act of
> instruction-encode.}

Information-theoretic entropy, in bits, nats, shannons or hartleys as
you choose.

> <
> < Whether that entropy packs better into
>> actual instructions in different ISAs is not the question; if he
>> entropuis are equal then there is no fundamental entropy reason to
>> choose one over the other, and so you can leave it up to packing density
>> and ease of unpack.
> <
> My general guess (GUESS) is that if RISC-V had the universal constant scheme
> of My 66000, that RISC-V CMP-BC instruction would have greater density. But
> they don't and I can't see any way of them getting there.*
> <
> How much greater ? :: down in the 1% OpCode range.
> <
> I was surprised how infrequent RISC-V CMP-BC occurred in actual code, and
> how often the compiler changed counted loops into count up to zero. I was
> also surprised to discover real code of RISC-V having to paste a constant in
> order to do:: {if, for, while}×( x rel_op constant ).
> <
> (*) But I think what you are getting at is related to my statement from about 18
> months ago when I stated the ideal size of a fixed format instruction was about
> 36-bits.

actually I was thinking about whether, and how, a multitest compare
would fit in our ISA. We already have a bit-test instruction, so turning
a result into a bool for store is provided for. But we only have two-way
branches, so we'd need either a compare-bittest-branch sequence or add a
selecting branch.

At that point I realized that the number of distinct cases (i.e. the
natural entropy) required y a selecting branch is the same as the number
of distinct compares required to feed a bool to a non-selecting branch.
Hence the entropy must be the same. Being suspicious of such insights, I
posted to confirm.

We wouldn't want to do a compare-bittest-branch because that costs a
slot and a cycle over simple separate comparison ops. We don't have any
packing constraints in the encoding, so separate comparison ops has no
don't-fit problems. Adding say 32 opcodes to a slot that already has
several hundred costs around 0.1 bit entropy for every op therein, while
adding 5 bits to each branch to select from the 32 conditions costs 5
bits from branches alone, say 0.25 of the ops in a slot with branches.

That would seem to favor separate opcodes, but only for the particular
slot population. Multiple test opcodes costs less each for more
instructions; multitest costs more but for fewer instructions. So which
is better (ignoring packing) depends on how many other codes are in the
same slot.

Re: my66 COMPARE operator question

<63a4a09c-a8f1-4237-badb-f95e49c14c76n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:620a:1a07:b0:6bc:3aa1:90fb with SMTP id bk7-20020a05620a1a0700b006bc3aa190fbmr6532881qkb.292.1662646479749;
Thu, 08 Sep 2022 07:14:39 -0700 (PDT)
X-Received: by 2002:a05:622a:38a:b0:344:aac4:780e with SMTP id
j10-20020a05622a038a00b00344aac4780emr8203604qtx.151.1662646479560; Thu, 08
Sep 2022 07:14:39 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Thu, 8 Sep 2022 07:14:39 -0700 (PDT)
In-Reply-To: <tfbkk6$f5mq$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:39b0:c0c1:a2ea:202d;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:39b0:c0c1:a2ea:202d
References: <tf93ab$56s2$1@dont-email.me> <b5ee3bfc-471b-4177-8b8c-cf33783dec1cn@googlegroups.com>
<tfaqfg$a57b$1@dont-email.me> <ec758b74-71c0-4f58-8256-50a6e8d52233n@googlegroups.com>
<tfbkk6$f5mq$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <63a4a09c-a8f1-4237-badb-f95e49c14c76n@googlegroups.com>
Subject: Re: my66 COMPARE operator question
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Thu, 08 Sep 2022 14:14:39 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 6569
 by: MitchAlsup - Thu, 8 Sep 2022 14:14 UTC

On Wednesday, September 7, 2022 at 9:39:06 PM UTC-5, Ivan Godard wrote:
> On 9/7/2022 12:42 PM, MitchAlsup wrote:
> > On Wednesday, September 7, 2022 at 2:12:51 PM UTC-5, Ivan Godard wrote:
> >> On 9/7/2022 9:00 AM, MitchAlsup wrote:
> >>> On Tuesday, September 6, 2022 at 10:31:26 PM UTC-5, Ivan Godard wrote:
> >>>> Most ISAs (ignoring those with implicit CCs) have a bunch of compare ops
> >>>> and one- or two-way branches. Mitch has one compare op and a multi-test
> >>>> branch. ISTM that there's no gain in entropy either way, although one or
> >>>> the other may pack better if the ISA is stuck with fixed size
> >>>> instructions. Yes?
> > <judicious snip>
> >>> In counting of CoreMark and LLVM main.c My 66000 only has 95% as many
> >>> branches (instructions which potentially alter the flow of control) as RISC_V.
> >>> With regards to switch(s); My 66000 uses an indexed table of 16-bit displacements
> >>> while RISC-V uses an indexed table of 64-bit absolutes--saving space, avoiding
> >>> the waste of a register, and the pollution of the data cache
> >>> <
> >>> Code size of My 66000 is essentially identical with RISC-V using the compressed
> >>> extension when My 66000 uses no compression whatsoever.
> > <
> >> Yeah, but I was asking entropy, not ISA comparisons. Does one multi-rest
> >> and a result selector have the same entropy as lots of one-way tests and
> >> no selector? Seems to me it does.
> > <
> > Depends if you are defining entropy in OpCodes or bits or semantic actions ?
> > {That is are you measuring entropy before-or-after performing the act of
> > instruction-encode.}
> Information-theoretic entropy, in bits, nats, shannons or hartleys as
> you choose.
> > <
> > < Whether that entropy packs better into
> >> actual instructions in different ISAs is not the question; if he
> >> entropuis are equal then there is no fundamental entropy reason to
> >> choose one over the other, and so you can leave it up to packing density
> >> and ease of unpack.
> > <
> > My general guess (GUESS) is that if RISC-V had the universal constant scheme
> > of My 66000, that RISC-V CMP-BC instruction would have greater density. But
> > they don't and I can't see any way of them getting there.*
> > <
> > How much greater ? :: down in the 1% OpCode range.
> > <
> > I was surprised how infrequent RISC-V CMP-BC occurred in actual code, and
> > how often the compiler changed counted loops into count up to zero. I was
> > also surprised to discover real code of RISC-V having to paste a constant in
> > order to do:: {if, for, while}×( x rel_op constant ).
> > <
> > (*) But I think what you are getting at is related to my statement from about 18
> > months ago when I stated the ideal size of a fixed format instruction was about
> > 36-bits.
> actually I was thinking about whether, and how, a multitest compare
> would fit in our ISA. We already have a bit-test instruction, so turning
> a result into a bool for store is provided for. But we only have two-way
> branches, so we'd need either a compare-bittest-branch sequence or add a
> selecting branch.
>
> At that point I realized that the number of distinct cases (i.e. the
> natural entropy) required y a selecting branch is the same as the number
> of distinct compares required to feed a bool to a non-selecting branch.
> Hence the entropy must be the same. Being suspicious of such insights, I
> posted to confirm.
>
> We wouldn't want to do a compare-bittest-branch because that costs a
> slot and a cycle over simple separate comparison ops. We don't have any
> packing constraints in the encoding, so separate comparison ops has no
> don't-fit problems. Adding say 32 opcodes to a slot that already has
> several hundred costs around 0.1 bit entropy for every op therein, while
> adding 5 bits to each branch to select from the 32 conditions costs 5
> bits from branches alone, say 0.25 of the ops in a slot with branches.
>
> That would seem to favor separate opcodes, but only for the particular
> slot population. Multiple test opcodes costs less each for more
> instructions; multitest costs more but for fewer instructions. So which
> is better (ignoring packing) depends on how many other codes are in the
> same slot.
<
In actuality, I call my Branch-on-bit instruction 1-instruction but in actuality
it has 64 instances (1 for every bit position in a register). You can either
consider this 64 instructions, or 1 instruction with a 6-bit immediate. I
lean towards the later and encoded it that way.
<
Similarly, there are 48 different ways to convert amongst the data types
(when you consider all of the rounding modes). I consider this 1-instruction
as the pipeline has but a single sequence to run this instruction down it, and
a small constant used to discriminate which of the instances is in play now..

Re: my66 COMPARE operator question

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

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: monn...@iro.umontreal.ca (Stefan Monnier)
Newsgroups: comp.arch
Subject: Re: my66 COMPARE operator question
Date: Thu, 08 Sep 2022 10:26:20 -0400
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <jwvh71i9cc6.fsf-monnier+comp.arch@gnu.org>
References: <tf93ab$56s2$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: reader01.eternal-september.org; posting-host="65d4fcf664f7a48b5a01e80eed2228d8";
logging-data="791746"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX190ndXj7zMyeTeepsJDxjb5"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
Cancel-Lock: sha1:XYXv8eqdPAdHmVoULa6Q7M4CrAc=
sha1:8sgGNd0QlmCGf1+X/+3a22zv4Eg=
 by: Stefan Monnier - Thu, 8 Sep 2022 14:26 UTC

> Most ISAs (ignoring those with implicit CCs) have a bunch of compare ops and
> one- or two-way branches. Mitch has one compare op and a multi-test
> branch. ISTM that there's no gain in entropy either way, although one or the
> other may pack better if the ISA is stuck with fixed size instructions. Yes?

A difference I can see is:
- with the test encoded together with the compare operation, you have
N possible tests to encode.
- with the test encoded as a bit-select in the branch, you have
M possible bits to select.
Say you only support 8 different tests, but your words are 64bits,
that's a difference of 3bit vs 6bits.

Then another difference is when a single compare's results are used in
N subsequent branches, in which case you save the repetition of
the operands compared to the scheme where you need to perform
N different comparisons.

I don't think either factor will make much difference in real life, tho.

Stefan

Re: my66 COMPARE operator question

<tfd5h1$qdr$1@newsreader4.netcologne.de>

  copy mid

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

  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-1471-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoe...@netcologne.de (Thomas Koenig)
Newsgroups: comp.arch
Subject: Re: my66 COMPARE operator question
Date: Thu, 8 Sep 2022 16:33:37 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <tfd5h1$qdr$1@newsreader4.netcologne.de>
References: <tf93ab$56s2$1@dont-email.me>
<b5ee3bfc-471b-4177-8b8c-cf33783dec1cn@googlegroups.com>
<tfaqfg$a57b$1@dont-email.me>
<ec758b74-71c0-4f58-8256-50a6e8d52233n@googlegroups.com>
<tfbkk6$f5mq$1@dont-email.me>
Injection-Date: Thu, 8 Sep 2022 16:33:37 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2a0a-a540-1471-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2a0a:a540:1471:0:7285:c2ff:fe6c:992d";
logging-data="27067"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Thu, 8 Sep 2022 16:33 UTC

Ivan Godard <ivan@millcomputing.com> schrieb:

> Information-theoretic entropy, in bits, nats, shannons or hartleys as
> you choose.

I would probably prefer J/(mol*K), but since Boltzmann's constant
is so small, the numbers would be quite small (although still well
within the range of an IEEE single precision variable).

Re: my66 COMPARE operator question

<tfdcbr$pkm9$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: cr88...@gmail.com (BGB)
Newsgroups: comp.arch
Subject: Re: my66 COMPARE operator question
Date: Thu, 8 Sep 2022 13:30:08 -0500
Organization: A noiseless patient Spider
Lines: 161
Message-ID: <tfdcbr$pkm9$1@dont-email.me>
References: <tf93ab$56s2$1@dont-email.me>
<b5ee3bfc-471b-4177-8b8c-cf33783dec1cn@googlegroups.com>
<tfaqfg$a57b$1@dont-email.me>
<ec758b74-71c0-4f58-8256-50a6e8d52233n@googlegroups.com>
<tfbkk6$f5mq$1@dont-email.me>
<63a4a09c-a8f1-4237-badb-f95e49c14c76n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 8 Sep 2022 18:30:19 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="c7c7100327a46e2b26250f30f24f1f86";
logging-data="840393"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18z8344Cd325J3+R18cvBiN"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.13.0
Cancel-Lock: sha1:xsKKzo997qQIm0ulSidhcGKEzwk=
Content-Language: en-US
In-Reply-To: <63a4a09c-a8f1-4237-badb-f95e49c14c76n@googlegroups.com>
 by: BGB - Thu, 8 Sep 2022 18:30 UTC

On 9/8/2022 9:14 AM, MitchAlsup wrote:
> On Wednesday, September 7, 2022 at 9:39:06 PM UTC-5, Ivan Godard wrote:
>> On 9/7/2022 12:42 PM, MitchAlsup wrote:
>>> On Wednesday, September 7, 2022 at 2:12:51 PM UTC-5, Ivan Godard wrote:
>>>> On 9/7/2022 9:00 AM, MitchAlsup wrote:
>>>>> On Tuesday, September 6, 2022 at 10:31:26 PM UTC-5, Ivan Godard wrote:
>>>>>> Most ISAs (ignoring those with implicit CCs) have a bunch of compare ops
>>>>>> and one- or two-way branches. Mitch has one compare op and a multi-test
>>>>>> branch. ISTM that there's no gain in entropy either way, although one or
>>>>>> the other may pack better if the ISA is stuck with fixed size
>>>>>> instructions. Yes?
>>> <judicious snip>
>>>>> In counting of CoreMark and LLVM main.c My 66000 only has 95% as many
>>>>> branches (instructions which potentially alter the flow of control) as RISC_V.
>>>>> With regards to switch(s); My 66000 uses an indexed table of 16-bit displacements
>>>>> while RISC-V uses an indexed table of 64-bit absolutes--saving space, avoiding
>>>>> the waste of a register, and the pollution of the data cache
>>>>> <
>>>>> Code size of My 66000 is essentially identical with RISC-V using the compressed
>>>>> extension when My 66000 uses no compression whatsoever.
>>> <
>>>> Yeah, but I was asking entropy, not ISA comparisons. Does one multi-rest
>>>> and a result selector have the same entropy as lots of one-way tests and
>>>> no selector? Seems to me it does.
>>> <
>>> Depends if you are defining entropy in OpCodes or bits or semantic actions ?
>>> {That is are you measuring entropy before-or-after performing the act of
>>> instruction-encode.}
>> Information-theoretic entropy, in bits, nats, shannons or hartleys as
>> you choose.
>>> <
>>> < Whether that entropy packs better into
>>>> actual instructions in different ISAs is not the question; if he
>>>> entropuis are equal then there is no fundamental entropy reason to
>>>> choose one over the other, and so you can leave it up to packing density
>>>> and ease of unpack.
>>> <
>>> My general guess (GUESS) is that if RISC-V had the universal constant scheme
>>> of My 66000, that RISC-V CMP-BC instruction would have greater density. But
>>> they don't and I can't see any way of them getting there.*
>>> <
>>> How much greater ? :: down in the 1% OpCode range.
>>> <
>>> I was surprised how infrequent RISC-V CMP-BC occurred in actual code, and
>>> how often the compiler changed counted loops into count up to zero. I was
>>> also surprised to discover real code of RISC-V having to paste a constant in
>>> order to do:: {if, for, while}×( x rel_op constant ).
>>> <
>>> (*) But I think what you are getting at is related to my statement from about 18
>>> months ago when I stated the ideal size of a fixed format instruction was about
>>> 36-bits.
>> actually I was thinking about whether, and how, a multitest compare
>> would fit in our ISA. We already have a bit-test instruction, so turning
>> a result into a bool for store is provided for. But we only have two-way
>> branches, so we'd need either a compare-bittest-branch sequence or add a
>> selecting branch.
>>
>> At that point I realized that the number of distinct cases (i.e. the
>> natural entropy) required y a selecting branch is the same as the number
>> of distinct compares required to feed a bool to a non-selecting branch.
>> Hence the entropy must be the same. Being suspicious of such insights, I
>> posted to confirm.
>>
>> We wouldn't want to do a compare-bittest-branch because that costs a
>> slot and a cycle over simple separate comparison ops. We don't have any
>> packing constraints in the encoding, so separate comparison ops has no
>> don't-fit problems. Adding say 32 opcodes to a slot that already has
>> several hundred costs around 0.1 bit entropy for every op therein, while
>> adding 5 bits to each branch to select from the 32 conditions costs 5
>> bits from branches alone, say 0.25 of the ops in a slot with branches.
>>
>> That would seem to favor separate opcodes, but only for the particular
>> slot population. Multiple test opcodes costs less each for more
>> instructions; multitest costs more but for fewer instructions. So which
>> is better (ignoring packing) depends on how many other codes are in the
>> same slot.
> <
> In actuality, I call my Branch-on-bit instruction 1-instruction but in actuality
> it has 64 instances (1 for every bit position in a register). You can either
> consider this 64 instructions, or 1 instruction with a 6-bit immediate. I
> lean towards the later and encoded it that way.
> <
> Similarly, there are 48 different ways to convert amongst the data types
> (when you consider all of the rounding modes). I consider this 1-instruction
> as the pipeline has but a single sequence to run this instruction down it, and
> a small constant used to discriminate which of the instances is in play now.

If I were not using my current scheme, would probably go for something like:
BZ Rn, label //Branch if Rn==0
BNZ Rn, label //Branch if Rn!=0
BGE Rn, label //Branch if Rn>=0 (Sign=0)
BLT Rn, label //Branch if Rn< 0 (Sign=1)

Average case would still be 2 instructions for compare-and-branch, and
it would be cheaper for hardware than the strategy used by RISC-V.

Supporting arbitrary bits could be useful, estimated cost ~ 30 LUTs (vs
~ 14 LUTs for an Rn==0 check). Could reduce many "if(x&mask)" operations
to a single branch, but would likely still need an (Rn==0) / (Rn!=0)
check to deal with the general cases.

Less cost and latency either way than requiring a relative comparison.

With the mechanism above, say:
if(x)
BNZ x, lbl
if(!x)
BZ x, lbl
if(x&mask)
AND x, mask, t
BNZ t, lbl
if(!(x&mask))
AND x, mask, t
BZ t, lbl
if(x==y)
SUB x, y, t
BZ t, lbl
if(x!=y)
SUB x, y, t
BNZ t, lbl
if(x<y)
SUB x, y, t
BLT t, lbl
if(x>y)
SUB y, x, t
BLT t, lbl
if(x<=y)
SUB y, x, t
BGE t, lbl
if(x>=y)
SUB x, y, t
BGE t, lbl

Assuming 64-bit, would need dedicated compare ops for 64-bit comparisons
(for 32-bit, SUB should work assuming 32-bit values are kept sign or
zero extended).

Constant cases would be similar, except:
if(x>c) ..
if(x<=c) ..

Can't be directly encoded in 2 ops if we only have:
SUB Rm, imm, Rn // Rn=Rm-Imm
Would likely also need:
RSUB Rm, imm, Rn // Rn=Imm-Rm

One could argue about MSB tagged pointers, but I already have this issue
and mostly ignore it. Normal C code doesn't use pointer tagging; and
there is no need to do relative comparisons for the Link Register or
similar, ...; so can mostly sweep this whole issue under the carpet.

One drawback is that there would no longer be a particularly "good" way
to support predicated instructions (at least much beyond interpreting
certain short-forward-branches as a predicate mask or similar).

....

Re: my66 COMPARE operator question

<9e831e28-2140-4160-8239-af51e956437cn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:ae9:e410:0:b0:6cb:e230:8df8 with SMTP id q16-20020ae9e410000000b006cbe2308df8mr2172117qkc.132.1662672986311;
Thu, 08 Sep 2022 14:36:26 -0700 (PDT)
X-Received: by 2002:a05:620a:1b8e:b0:6bb:f85e:6de0 with SMTP id
dv14-20020a05620a1b8e00b006bbf85e6de0mr8088062qkb.618.1662672986182; Thu, 08
Sep 2022 14:36:26 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!news.mixmin.net!newsreader4.netcologne.de!news.netcologne.de!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Thu, 8 Sep 2022 14:36:26 -0700 (PDT)
In-Reply-To: <jwvh71i9cc6.fsf-monnier+comp.arch@gnu.org>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:55d6:80fd:950f:8e24;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:55d6:80fd:950f:8e24
References: <tf93ab$56s2$1@dont-email.me> <jwvh71i9cc6.fsf-monnier+comp.arch@gnu.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9e831e28-2140-4160-8239-af51e956437cn@googlegroups.com>
Subject: Re: my66 COMPARE operator question
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Thu, 08 Sep 2022 21:36:26 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3173
 by: MitchAlsup - Thu, 8 Sep 2022 21:36 UTC

On Thursday, September 8, 2022 at 9:26:25 AM UTC-5, Stefan Monnier wrote:
> > Most ISAs (ignoring those with implicit CCs) have a bunch of compare ops and
> > one- or two-way branches. Mitch has one compare op and a multi-test
> > branch. ISTM that there's no gain in entropy either way, although one or the
> > other may pack better if the ISA is stuck with fixed size instructions. Yes?
<
> A difference I can see is:
> - with the test encoded together with the compare operation, you have
> N possible tests to encode.
> - with the test encoded as a bit-select in the branch, you have
> M possible bits to select.
> Say you only support 8 different tests, but your words are 64bits,
> that's a difference of 3bit vs 6bits.
<
You then have to weigh the cost of not having such an available combination.
Say, your compiler wants to flip then and else clauses with a FP compare.
You want the NaN comparisons to go into the else-clause even after re-
arrangement. Here you need not 8 ways to perform the comparisons but 14.
{Unless you don't care about what numerical analysts care about......}
<
Then consider if you ever want to compare with "any byte zero", "Any halfword
zero",.... "compare any byte equal",..."compare any byte LT",...,...,...
these are trivial to add with the bit-vector approach and "expensive" with the
compare-and-branch approach.
>
> Then another difference is when a single compare's results are used in
> N subsequent branches, in which case you save the repetition of
> the operands compared to the scheme where you need to perform
> N different comparisons.
<
Not surprisingly, reuse of a comparison occurs slightly less often than
reuse of typical results--however, Brian's LLVM compiler seems to find
these cases.
>
> I don't think either factor will make much difference in real life, tho.
>
Probably right.
>
> Stefan

Re: my66 COMPARE operator question

<6c22b55d-50df-41db-b6da-9cfb514cf8d0n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a37:b943:0:b0:6be:a0a7:60cd with SMTP id j64-20020a37b943000000b006bea0a760cdmr8353611qkf.350.1662673189141;
Thu, 08 Sep 2022 14:39:49 -0700 (PDT)
X-Received: by 2002:ac8:7d84:0:b0:344:662d:278c with SMTP id
c4-20020ac87d84000000b00344662d278cmr9659966qtd.513.1662673189019; Thu, 08
Sep 2022 14:39:49 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!news.mixmin.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Thu, 8 Sep 2022 14:39:48 -0700 (PDT)
In-Reply-To: <tfdcbr$pkm9$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:55d6:80fd:950f:8e24;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:55d6:80fd:950f:8e24
References: <tf93ab$56s2$1@dont-email.me> <b5ee3bfc-471b-4177-8b8c-cf33783dec1cn@googlegroups.com>
<tfaqfg$a57b$1@dont-email.me> <ec758b74-71c0-4f58-8256-50a6e8d52233n@googlegroups.com>
<tfbkk6$f5mq$1@dont-email.me> <63a4a09c-a8f1-4237-badb-f95e49c14c76n@googlegroups.com>
<tfdcbr$pkm9$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <6c22b55d-50df-41db-b6da-9cfb514cf8d0n@googlegroups.com>
Subject: Re: my66 COMPARE operator question
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Thu, 08 Sep 2022 21:39:49 +0000
Content-Type: text/plain; charset="UTF-8"
 by: MitchAlsup - Thu, 8 Sep 2022 21:39 UTC

On Thursday, September 8, 2022 at 1:30:22 PM UTC-5, BGB wrote:
> On 9/8/2022 9:14 AM, MitchAlsup wrote:
> > On Wednesday, September 7, 2022 at 9:39:06 PM UTC-5, Ivan Godard wrote:
<snip>
> If I were not using my current scheme, would probably go for something like:
> BZ Rn, label //Branch if Rn==0
> BNZ Rn, label //Branch if Rn!=0
> BGE Rn, label //Branch if Rn>=0 (Sign=0)
> BLT Rn, label //Branch if Rn< 0 (Sign=1)
>
> Average case would still be 2 instructions for compare-and-branch, and
> it would be cheaper for hardware than the strategy used by RISC-V.
>
>
> Supporting arbitrary bits could be useful, estimated cost ~ 30 LUTs (vs
> ~ 14 LUTs for an Rn==0 check). Could reduce many "if(x&mask)" operations
> to a single branch, but would likely still need an (Rn==0) / (Rn!=0)
> check to deal with the general cases.
>
> Less cost and latency either way than requiring a relative comparison.
>
>
> With the mechanism above, say:
> if(x)
> BNZ x, lbl
> if(!x)
> BZ x, lbl
> if(x&mask)
> AND x, mask, t
> BNZ t, lbl
> if(!(x&mask))
> AND x, mask, t
> BZ t, lbl
> if(x==y)
> SUB x, y, t
> BZ t, lbl
> if(x!=y)
> SUB x, y, t
> BNZ t, lbl
> if(x<y)
> SUB x, y, t
> BLT t, lbl
> if(x>y)
> SUB y, x, t
> BLT t, lbl
> if(x<=y)
> SUB y, x, t
> BGE t, lbl
> if(x>=y)
> SUB x, y, t
> BGE t, lbl
>
> Assuming 64-bit, would need dedicated compare ops for 64-bit comparisons
> (for 32-bit, SUB should work assuming 32-bit values are kept sign or
> zero extended).
>
> Constant cases would be similar, except:
> if(x>c) ..
> if(x<=c) ..
>
> Can't be directly encoded in 2 ops if we only have:
> SUB Rm, imm, Rn // Rn=Rm-Imm
> Would likely also need:
> RSUB Rm, imm, Rn // Rn=Imm-Rm
>
"Breakdown, go ahead and give it to me
Breakdown, honey, take me through the night" Tom Petty and the Heartbreakers....
>
> One could argue about MSB tagged pointers, but I already have this issue
> and mostly ignore it. Normal C code doesn't use pointer tagging; and
> there is no need to do relative comparisons for the Link Register or
> similar, ...; so can mostly sweep this whole issue under the carpet.
>
>
> One drawback is that there would no longer be a particularly "good" way
> to support predicated instructions (at least much beyond interpreting
> certain short-forward-branches as a predicate mask or similar).
>
>
> ...

Re: my66 COMPARE operator question

<tff2jj$10uqn$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: cr88...@gmail.com (BGB)
Newsgroups: comp.arch
Subject: Re: my66 COMPARE operator question
Date: Fri, 9 Sep 2022 04:55:53 -0500
Organization: A noiseless patient Spider
Lines: 166
Message-ID: <tff2jj$10uqn$1@dont-email.me>
References: <tf93ab$56s2$1@dont-email.me>
<b5ee3bfc-471b-4177-8b8c-cf33783dec1cn@googlegroups.com>
<tfaqfg$a57b$1@dont-email.me>
<ec758b74-71c0-4f58-8256-50a6e8d52233n@googlegroups.com>
<tfbkk6$f5mq$1@dont-email.me>
<63a4a09c-a8f1-4237-badb-f95e49c14c76n@googlegroups.com>
<tfdcbr$pkm9$1@dont-email.me>
<6c22b55d-50df-41db-b6da-9cfb514cf8d0n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 9 Sep 2022 09:56:03 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="098f6e9bb3c85a7143a6b8087b40f24c";
logging-data="1080151"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX199OzZ7Jn9X2da/FNJ9Td4U"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.13.0
Cancel-Lock: sha1:Tump7nHJt7E/iFvF2uu4msJC2z4=
In-Reply-To: <6c22b55d-50df-41db-b6da-9cfb514cf8d0n@googlegroups.com>
Content-Language: en-US
 by: BGB - Fri, 9 Sep 2022 09:55 UTC

On 9/8/2022 4:39 PM, MitchAlsup wrote:
> On Thursday, September 8, 2022 at 1:30:22 PM UTC-5, BGB wrote:
>> On 9/8/2022 9:14 AM, MitchAlsup wrote:
>>> On Wednesday, September 7, 2022 at 9:39:06 PM UTC-5, Ivan Godard wrote:
> <snip>
>> If I were not using my current scheme, would probably go for something like:
>> BZ Rn, label //Branch if Rn==0
>> BNZ Rn, label //Branch if Rn!=0
>> BGE Rn, label //Branch if Rn>=0 (Sign=0)
>> BLT Rn, label //Branch if Rn< 0 (Sign=1)
>>
>> Average case would still be 2 instructions for compare-and-branch, and
>> it would be cheaper for hardware than the strategy used by RISC-V.
>>
>>
>> Supporting arbitrary bits could be useful, estimated cost ~ 30 LUTs (vs
>> ~ 14 LUTs for an Rn==0 check). Could reduce many "if(x&mask)" operations
>> to a single branch, but would likely still need an (Rn==0) / (Rn!=0)
>> check to deal with the general cases.
>>
>> Less cost and latency either way than requiring a relative comparison.
>>
>>
>> With the mechanism above, say:
>> if(x)
>> BNZ x, lbl
>> if(!x)
>> BZ x, lbl
>> if(x&mask)
>> AND x, mask, t
>> BNZ t, lbl
>> if(!(x&mask))
>> AND x, mask, t
>> BZ t, lbl
>> if(x==y)
>> SUB x, y, t
>> BZ t, lbl
>> if(x!=y)
>> SUB x, y, t
>> BNZ t, lbl
>> if(x<y)
>> SUB x, y, t
>> BLT t, lbl
>> if(x>y)
>> SUB y, x, t
>> BLT t, lbl
>> if(x<=y)
>> SUB y, x, t
>> BGE t, lbl
>> if(x>=y)
>> SUB x, y, t
>> BGE t, lbl
>>
>> Assuming 64-bit, would need dedicated compare ops for 64-bit comparisons
>> (for 32-bit, SUB should work assuming 32-bit values are kept sign or
>> zero extended).
>>
>> Constant cases would be similar, except:
>> if(x>c) ..
>> if(x<=c) ..
>>
>> Can't be directly encoded in 2 ops if we only have:
>> SUB Rm, imm, Rn // Rn=Rm-Imm
>> Would likely also need:
>> RSUB Rm, imm, Rn // Rn=Imm-Rm
>>

I was initially looking at stuff, and reverse-subtract cases initially
seemed rare.

But, I added a mock-up pseudo-instruction (faked by a constant load
followed by a 3R subtract), and modified the 3AC->ASM code to try to use it.

Then suddenly they appeared all over the place, along with a noticeable
improvement in Doom framerates (and a slight decrease in the Load/Store
density).

It seems like reverse subtracts weren't quite as rare as I thought, and
it was also seemingly adversely effecting the register allocator (which
would handle the constants in these cases by treating them like they
were variables; albeit ones' without any backing memory; so they simply
disappear when evicted, and generate a constant-load when used again).

Goes and adds the actual instruction as a test, seems it is still pretty
far down the ranking (still nowhere near as common as most of the other
ALU ops).

It seems like the gains were more likely due to not dealing with these
constants via the register allocator, than due to any particular merit
of the instruction itself.

> "Breakdown, go ahead and give it to me
> Breakdown, honey, take me through the night" Tom Petty and the Heartbreakers....

Not really heard much of Tom Petty, I think my parents like his music
though.

Am personally more into House/Dubstep/EDM/etc.

When I was younger, I was kinda into Goth (was mostly Synthpop based at
the time, I guess vs an older Rock/Metal based style). I guess when I
got a little older though, I ended up taking issue with the genre's
almost cult-like obsession with vampires and occult topics.

Well, and I guess at some point I went from seeing existence through a
primarily negative lens, to being more neutral. Say, where in the
greater scheme of thing, ones' existence is mostly meaningless, but like
at least one can try to make the best of it; like it doesn't do much
good to spend all of ones' time being caught up in ones' existence being
ultimately meaningless, etc.

Unlike some people, could really never make the jump to believing there
is intrinsic value in anything; but will at least to claim that a sort
of localized value exists (say, things can have value so long as there
are still people to take value in them).

Well, or, say, value exists for humans in much the same way as software
exists for computers. If there were no computers, there would not be any
way for software to exist, but as long as they exist, so too does the
software they contain.

Well, ignoring any religious / theological arguments; ultimately can't
take a solid stance on this; nor is it entirely obvious whether this is
enough to justify a claim that intrinsic value exists, or if it merely
changes the scope slightly.

I guess I loosely identify with existentialism, but also disagree with
their tendency to assign emotional/subjective qualities to existence
being (ultimately) meaningless (basically "smells" too much like the
same sort of underlying philosophy as the goth subculture). Say, the
lack of meaning not being any sort of malice, but rather, nothing
whatsoever (can't assign malice to something which doesn't really exist
in the first place).

Not quite figured out how other people think in these areas.
Sometimes I am left with some inward facing concerns as to "who I am",
but am then left to no real way to "fix" them nor with any real way that
they are "fixable".

Torn between trying to go into this topic, but it is an difficult area,
and I am kinda really needing to go to sleep...

Kinda really need to sleep, I guess now is probably not the right time
to go into my thoughts here.

>>
>> One could argue about MSB tagged pointers, but I already have this issue
>> and mostly ignore it. Normal C code doesn't use pointer tagging; and
>> there is no need to do relative comparisons for the Link Register or
>> similar, ...; so can mostly sweep this whole issue under the carpet.
>>
>>
>> One drawback is that there would no longer be a particularly "good" way
>> to support predicated instructions (at least much beyond interpreting
>> certain short-forward-branches as a predicate mask or similar).
>>
>>
>> ...

Re: my66 COMPARE operator question

<tff3ib$111o9$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: iva...@millcomputing.com (Ivan Godard)
Newsgroups: comp.arch
Subject: Re: my66 COMPARE operator question
Date: Fri, 9 Sep 2022 03:12:26 -0700
Organization: A noiseless patient Spider
Lines: 157
Message-ID: <tff3ib$111o9$1@dont-email.me>
References: <tf93ab$56s2$1@dont-email.me>
<b5ee3bfc-471b-4177-8b8c-cf33783dec1cn@googlegroups.com>
<tfaqfg$a57b$1@dont-email.me>
<ec758b74-71c0-4f58-8256-50a6e8d52233n@googlegroups.com>
<tfbkk6$f5mq$1@dont-email.me>
<63a4a09c-a8f1-4237-badb-f95e49c14c76n@googlegroups.com>
<tfdcbr$pkm9$1@dont-email.me>
<6c22b55d-50df-41db-b6da-9cfb514cf8d0n@googlegroups.com>
<tff2jj$10uqn$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 9 Sep 2022 10:12:27 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="127de198f6c7a39a53e15b4cbf6ae078";
logging-data="1083145"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18w8GyWoN+y7h4rocdqOoDD"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.13.0
Cancel-Lock: sha1:1O1YuBG/IT5kfTjTz2L4eAsFing=
In-Reply-To: <tff2jj$10uqn$1@dont-email.me>
Content-Language: en-US
 by: Ivan Godard - Fri, 9 Sep 2022 10:12 UTC

On 9/9/2022 2:55 AM, BGB wrote:
> On 9/8/2022 4:39 PM, MitchAlsup wrote:
>> On Thursday, September 8, 2022 at 1:30:22 PM UTC-5, BGB wrote:
>>> On 9/8/2022 9:14 AM, MitchAlsup wrote:
>>>> On Wednesday, September 7, 2022 at 9:39:06 PM UTC-5, Ivan Godard wrote:
>> <snip>
>>> If I were not using my current scheme, would probably go for
>>> something like:
>>> BZ Rn, label //Branch if Rn==0
>>> BNZ Rn, label //Branch if Rn!=0
>>> BGE Rn, label //Branch if Rn>=0 (Sign=0)
>>> BLT Rn, label //Branch if Rn< 0 (Sign=1)
>>>
>>> Average case would still be 2 instructions for compare-and-branch, and
>>> it would be cheaper for hardware than the strategy used by RISC-V.
>>>
>>>
>>> Supporting arbitrary bits could be useful, estimated cost ~ 30 LUTs (vs
>>> ~ 14 LUTs for an Rn==0 check). Could reduce many "if(x&mask)" operations
>>> to a single branch, but would likely still need an (Rn==0) / (Rn!=0)
>>> check to deal with the general cases.
>>>
>>> Less cost and latency either way than requiring a relative comparison.
>>>
>>>
>>> With the mechanism above, say:
>>> if(x)
>>> BNZ x, lbl
>>> if(!x)
>>> BZ x, lbl
>>> if(x&mask)
>>> AND x, mask, t
>>> BNZ t, lbl
>>> if(!(x&mask))
>>> AND x, mask, t
>>> BZ t, lbl
>>> if(x==y)
>>> SUB x, y, t
>>> BZ t, lbl
>>> if(x!=y)
>>> SUB x, y, t
>>> BNZ t, lbl
>>> if(x<y)
>>> SUB x, y, t
>>> BLT t, lbl
>>> if(x>y)
>>> SUB y, x, t
>>> BLT t, lbl
>>> if(x<=y)
>>> SUB y, x, t
>>> BGE t, lbl
>>> if(x>=y)
>>> SUB x, y, t
>>> BGE t, lbl
>>>
>>> Assuming 64-bit, would need dedicated compare ops for 64-bit comparisons
>>> (for 32-bit, SUB should work assuming 32-bit values are kept sign or
>>> zero extended).
>>>
>>> Constant cases would be similar, except:
>>> if(x>c) ..
>>> if(x<=c) ..
>>>
>>> Can't be directly encoded in 2 ops if we only have:
>>> SUB Rm, imm, Rn // Rn=Rm-Imm
>>> Would likely also need:
>>> RSUB Rm, imm, Rn // Rn=Imm-Rm
>>>
>
> I was initially looking at stuff, and reverse-subtract cases initially
> seemed rare.
>
> But, I added a mock-up pseudo-instruction (faked by a constant load
> followed by a 3R subtract), and modified the 3AC->ASM code to try to use
> it.
>
> Then suddenly they appeared all over the place, along with a noticeable
> improvement in Doom framerates (and a slight decrease in the Load/Store
> density).
>
> It seems like reverse subtracts weren't quite as rare as I thought, and
> it was also seemingly adversely effecting the register allocator (which
> would handle the constants in these cases by treating them like they
> were variables; albeit ones' without any backing memory; so they simply
> disappear when evicted, and generate a constant-load when used again).
>
>
> Goes and adds the actual instruction as a test, seems it is still pretty
> far down the ranking (still nowhere near as common as most of the other
> ALU ops).
>
> It seems like the gains were more likely due to not dealing with these
> constants via the register allocator, than due to any particular merit
> of the instruction itself.
>
>
>> "Breakdown, go ahead and give it to me
>> Breakdown, honey, take me through the night" Tom Petty and the
>> Heartbreakers....
>
> Not really heard much of Tom Petty, I think my parents like his music
> though.
>
> Am personally more into House/Dubstep/EDM/etc.
>
>
> When I was younger, I was kinda into Goth (was mostly Synthpop based at
> the time, I guess vs an older Rock/Metal based style). I guess when I
> got a little older though, I ended up taking issue with the genre's
> almost cult-like obsession with vampires and occult topics.
>
>
> Well, and I guess at some point I went from seeing existence through a
> primarily negative lens, to being more neutral. Say, where in the
> greater scheme of thing, ones' existence is mostly meaningless, but like
> at least one can try to make the best of it; like it doesn't do much
> good to spend all of ones' time being caught up in ones' existence being
> ultimately meaningless, etc.
>
>
> Unlike some people, could really never make the jump to believing there
> is intrinsic value in anything; but will at least to claim that a sort
> of localized value exists (say, things can have value so long as there
> are still people to take value in them).
>
> Well, or, say, value exists for humans in much the same way as software
> exists for computers. If there were no computers, there would not be any
> way for software to exist, but as long as they exist, so too does the
> software they contain.
>
> Well, ignoring any religious / theological arguments; ultimately can't
> take a solid stance on this; nor is it entirely obvious whether this is
> enough to justify a claim that intrinsic value exists, or if it merely
> changes the scope slightly.
>
> I guess I loosely identify with existentialism, but also disagree with
> their tendency to assign emotional/subjective qualities to existence
> being (ultimately) meaningless (basically "smells" too much like the
> same sort of underlying philosophy as the goth subculture). Say, the
> lack of meaning not being any sort of malice, but rather, nothing
> whatsoever (can't assign malice to something which doesn't really exist
> in the first place).
>
>
> Not quite figured out how other people think in these areas.
> Sometimes I am left with some inward facing concerns as to "who I am",
> but am then left to no real way to "fix" them nor with any real way that
> they are "fixable".
>
> Torn between trying to go into this topic, but it is an difficult area,
> and I am kinda really needing to go to sleep...
>
> Kinda really need to sleep, I guess now is probably not the right time
> to go into my thoughts here.

There's extrinsic meaning (or lack thereof), or there's intrinsic
meaning, that one asserts. "Yes life has meaning, because I say it does".

Re: my66 COMPARE operator question

<tffvcr$13n3r$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: cr88...@gmail.com (BGB)
Newsgroups: comp.arch
Subject: Re: my66 COMPARE operator question
Date: Fri, 9 Sep 2022 13:07:13 -0500
Organization: A noiseless patient Spider
Lines: 239
Message-ID: <tffvcr$13n3r$1@dont-email.me>
References: <tf93ab$56s2$1@dont-email.me>
<b5ee3bfc-471b-4177-8b8c-cf33783dec1cn@googlegroups.com>
<tfaqfg$a57b$1@dont-email.me>
<ec758b74-71c0-4f58-8256-50a6e8d52233n@googlegroups.com>
<tfbkk6$f5mq$1@dont-email.me>
<63a4a09c-a8f1-4237-badb-f95e49c14c76n@googlegroups.com>
<tfdcbr$pkm9$1@dont-email.me>
<6c22b55d-50df-41db-b6da-9cfb514cf8d0n@googlegroups.com>
<tff2jj$10uqn$1@dont-email.me> <tff3ib$111o9$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 9 Sep 2022 18:07:23 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="098f6e9bb3c85a7143a6b8087b40f24c";
logging-data="1170555"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+2+vQ7VQ+HKwCE/1evkR32"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.13.0
Cancel-Lock: sha1:FvBRoQsc51shOfPpUq72oaGagIk=
In-Reply-To: <tff3ib$111o9$1@dont-email.me>
Content-Language: en-US
 by: BGB - Fri, 9 Sep 2022 18:07 UTC

On 9/9/2022 5:12 AM, Ivan Godard wrote:
> On 9/9/2022 2:55 AM, BGB wrote:
>> On 9/8/2022 4:39 PM, MitchAlsup wrote:
>>> On Thursday, September 8, 2022 at 1:30:22 PM UTC-5, BGB wrote:
>>>> On 9/8/2022 9:14 AM, MitchAlsup wrote:
>>>>> On Wednesday, September 7, 2022 at 9:39:06 PM UTC-5, Ivan Godard
>>>>> wrote:
>>> <snip>
>>>> If I were not using my current scheme, would probably go for
>>>> something like:
>>>> BZ Rn, label //Branch if Rn==0
>>>> BNZ Rn, label //Branch if Rn!=0
>>>> BGE Rn, label //Branch if Rn>=0 (Sign=0)
>>>> BLT Rn, label //Branch if Rn< 0 (Sign=1)
>>>>
>>>> Average case would still be 2 instructions for compare-and-branch, and
>>>> it would be cheaper for hardware than the strategy used by RISC-V.
>>>>
>>>>
>>>> Supporting arbitrary bits could be useful, estimated cost ~ 30 LUTs (vs
>>>> ~ 14 LUTs for an Rn==0 check). Could reduce many "if(x&mask)"
>>>> operations
>>>> to a single branch, but would likely still need an (Rn==0) / (Rn!=0)
>>>> check to deal with the general cases.
>>>>
>>>> Less cost and latency either way than requiring a relative comparison.
>>>>
>>>>
>>>> With the mechanism above, say:
>>>> if(x)
>>>> BNZ x, lbl
>>>> if(!x)
>>>> BZ x, lbl
>>>> if(x&mask)
>>>> AND x, mask, t
>>>> BNZ t, lbl
>>>> if(!(x&mask))
>>>> AND x, mask, t
>>>> BZ t, lbl
>>>> if(x==y)
>>>> SUB x, y, t
>>>> BZ t, lbl
>>>> if(x!=y)
>>>> SUB x, y, t
>>>> BNZ t, lbl
>>>> if(x<y)
>>>> SUB x, y, t
>>>> BLT t, lbl
>>>> if(x>y)
>>>> SUB y, x, t
>>>> BLT t, lbl
>>>> if(x<=y)
>>>> SUB y, x, t
>>>> BGE t, lbl
>>>> if(x>=y)
>>>> SUB x, y, t
>>>> BGE t, lbl
>>>>
>>>> Assuming 64-bit, would need dedicated compare ops for 64-bit
>>>> comparisons
>>>> (for 32-bit, SUB should work assuming 32-bit values are kept sign or
>>>> zero extended).
>>>>
>>>> Constant cases would be similar, except:
>>>> if(x>c) ..
>>>> if(x<=c) ..
>>>>
>>>> Can't be directly encoded in 2 ops if we only have:
>>>> SUB Rm, imm, Rn // Rn=Rm-Imm
>>>> Would likely also need:
>>>> RSUB Rm, imm, Rn // Rn=Imm-Rm
>>>>
>>
>> I was initially looking at stuff, and reverse-subtract cases initially
>> seemed rare.
>>
>> But, I added a mock-up pseudo-instruction (faked by a constant load
>> followed by a 3R subtract), and modified the 3AC->ASM code to try to
>> use it.
>>
>> Then suddenly they appeared all over the place, along with a
>> noticeable improvement in Doom framerates (and a slight decrease in
>> the Load/Store density).
>>
>> It seems like reverse subtracts weren't quite as rare as I thought,
>> and it was also seemingly adversely effecting the register allocator
>> (which would handle the constants in these cases by treating them like
>> they were variables; albeit ones' without any backing memory; so they
>> simply disappear when evicted, and generate a constant-load when used
>> again).
>>
>>
>> Goes and adds the actual instruction as a test, seems it is still
>> pretty far down the ranking (still nowhere near as common as most of
>> the other ALU ops).
>>
>> It seems like the gains were more likely due to not dealing with these
>> constants via the register allocator, than due to any particular merit
>> of the instruction itself.
>>
>>
>>> "Breakdown, go ahead and give it to me
>>> Breakdown, honey, take me through the night" Tom Petty and the
>>> Heartbreakers....
>>
>> Not really heard much of Tom Petty, I think my parents like his music
>> though.
>>
>> Am personally more into House/Dubstep/EDM/etc.
>>
>>
>> When I was younger, I was kinda into Goth (was mostly Synthpop based
>> at the time, I guess vs an older Rock/Metal based style). I guess when
>> I got a little older though, I ended up taking issue with the genre's
>> almost cult-like obsession with vampires and occult topics.
>>
>>
>> Well, and I guess at some point I went from seeing existence through a
>> primarily negative lens, to being more neutral. Say, where in the
>> greater scheme of thing, ones' existence is mostly meaningless, but
>> like at least one can try to make the best of it; like it doesn't do
>> much good to spend all of ones' time being caught up in ones'
>> existence being ultimately meaningless, etc.
>>
>>
>> Unlike some people, could really never make the jump to believing
>> there is intrinsic value in anything; but will at least to claim that
>> a sort of localized value exists (say, things can have value so long
>> as there are still people to take value in them).
>>
>> Well, or, say, value exists for humans in much the same way as
>> software exists for computers. If there were no computers, there would
>> not be any way for software to exist, but as long as they exist, so
>> too does the software they contain.
>>
>> Well, ignoring any religious / theological arguments; ultimately can't
>> take a solid stance on this; nor is it entirely obvious whether this
>> is enough to justify a claim that intrinsic value exists, or if it
>> merely changes the scope slightly.
>>
>> I guess I loosely identify with existentialism, but also disagree with
>> their tendency to assign emotional/subjective qualities to existence
>> being (ultimately) meaningless (basically "smells" too much like the
>> same sort of underlying philosophy as the goth subculture). Say, the
>> lack of meaning not being any sort of malice, but rather, nothing
>> whatsoever (can't assign malice to something which doesn't really
>> exist in the first place).
>>
>>
>> Not quite figured out how other people think in these areas.
>> Sometimes I am left with some inward facing concerns as to "who I am",
>> but am then left to no real way to "fix" them nor with any real way
>> that they are "fixable".
>>
>> Torn between trying to go into this topic, but it is an difficult
>> area, and I am kinda really needing to go to sleep...
>>
>> Kinda really need to sleep, I guess now is probably not the right time
>> to go into my thoughts here.
>

( Didn't get much sleep, not an ideal scenario... )

> There's extrinsic meaning (or lack thereof), or there's intrinsic
> meaning, that one asserts. "Yes life has meaning, because I say it does".

Yeah, I can believe in extrinsic meaning at least.

I am socially expected to believe in intrinsic meaning, except:
There isn't a whole lot of evidence to support it;
Things like moral ethics turn into a big convoluted mess if one assumes
it exists;
The model is a lot simpler if one assumes that only extrinsic value exists.

But, one is then left to say to others, "I value you because you are
useful to me, I hope I can also be of some use."

But, if one expresses it this way, people tend to respond like you just
crapped in their coffee. This is not ideal either, but it is hard to see
it any other way; say if one looks at their own thoughts, can't find any
'intrinsic' motives that are not in some way self-serving. One may find
they have no reason to care about their well-being other than how they
might be useful, and they have no reason to care about oneself either.

One can see that another person is upset, but then realize that they
can't relate to their feelings in these areas. Best one can do is limit
interactions, maybe try to stay on friendly terms, but then live in a
world where most people will eventually turn hostile.

Like, say, what if my emotional landscape looks about like the surface
of the moon?... I can't fix this...

One can try to act friendly towards people, but then also note that
ones' "baseline" interaction style tend to come off as abrasive and
impersonal. But, this becomes a "litmus test" of sorts, it isn't really
worthwhile trying to interact with people who demand that one maintains
a sort of false persona (and even if they do, these sorts of people tend
to turn hostile in the end).


Click here to read the complete article
Re: my66 COMPARE operator question

<tfg3oc$1442l$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: iva...@millcomputing.com (Ivan Godard)
Newsgroups: comp.arch
Subject: Re: my66 COMPARE operator question
Date: Fri, 9 Sep 2022 12:21:46 -0700
Organization: A noiseless patient Spider
Lines: 268
Message-ID: <tfg3oc$1442l$1@dont-email.me>
References: <tf93ab$56s2$1@dont-email.me>
<b5ee3bfc-471b-4177-8b8c-cf33783dec1cn@googlegroups.com>
<tfaqfg$a57b$1@dont-email.me>
<ec758b74-71c0-4f58-8256-50a6e8d52233n@googlegroups.com>
<tfbkk6$f5mq$1@dont-email.me>
<63a4a09c-a8f1-4237-badb-f95e49c14c76n@googlegroups.com>
<tfdcbr$pkm9$1@dont-email.me>
<6c22b55d-50df-41db-b6da-9cfb514cf8d0n@googlegroups.com>
<tff2jj$10uqn$1@dont-email.me> <tff3ib$111o9$1@dont-email.me>
<tffvcr$13n3r$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 9 Sep 2022 19:21:48 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="127de198f6c7a39a53e15b4cbf6ae078";
logging-data="1183829"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+OC0EanppF32Lfqd6LeShO"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.13.0
Cancel-Lock: sha1:EU1L9l1B7LFjwWuYp326PoR9TD4=
Content-Language: en-US
In-Reply-To: <tffvcr$13n3r$1@dont-email.me>
 by: Ivan Godard - Fri, 9 Sep 2022 19:21 UTC

On 9/9/2022 11:07 AM, BGB wrote:
> On 9/9/2022 5:12 AM, Ivan Godard wrote:
>> On 9/9/2022 2:55 AM, BGB wrote:
>>> On 9/8/2022 4:39 PM, MitchAlsup wrote:
>>>> On Thursday, September 8, 2022 at 1:30:22 PM UTC-5, BGB wrote:
>>>>> On 9/8/2022 9:14 AM, MitchAlsup wrote:
>>>>>> On Wednesday, September 7, 2022 at 9:39:06 PM UTC-5, Ivan Godard
>>>>>> wrote:
>>>> <snip>
>>>>> If I were not using my current scheme, would probably go for
>>>>> something like:
>>>>> BZ Rn, label //Branch if Rn==0
>>>>> BNZ Rn, label //Branch if Rn!=0
>>>>> BGE Rn, label //Branch if Rn>=0 (Sign=0)
>>>>> BLT Rn, label //Branch if Rn< 0 (Sign=1)
>>>>>
>>>>> Average case would still be 2 instructions for compare-and-branch, and
>>>>> it would be cheaper for hardware than the strategy used by RISC-V.
>>>>>
>>>>>
>>>>> Supporting arbitrary bits could be useful, estimated cost ~ 30 LUTs
>>>>> (vs
>>>>> ~ 14 LUTs for an Rn==0 check). Could reduce many "if(x&mask)"
>>>>> operations
>>>>> to a single branch, but would likely still need an (Rn==0) / (Rn!=0)
>>>>> check to deal with the general cases.
>>>>>
>>>>> Less cost and latency either way than requiring a relative comparison.
>>>>>
>>>>>
>>>>> With the mechanism above, say:
>>>>> if(x)
>>>>> BNZ x, lbl
>>>>> if(!x)
>>>>> BZ x, lbl
>>>>> if(x&mask)
>>>>> AND x, mask, t
>>>>> BNZ t, lbl
>>>>> if(!(x&mask))
>>>>> AND x, mask, t
>>>>> BZ t, lbl
>>>>> if(x==y)
>>>>> SUB x, y, t
>>>>> BZ t, lbl
>>>>> if(x!=y)
>>>>> SUB x, y, t
>>>>> BNZ t, lbl
>>>>> if(x<y)
>>>>> SUB x, y, t
>>>>> BLT t, lbl
>>>>> if(x>y)
>>>>> SUB y, x, t
>>>>> BLT t, lbl
>>>>> if(x<=y)
>>>>> SUB y, x, t
>>>>> BGE t, lbl
>>>>> if(x>=y)
>>>>> SUB x, y, t
>>>>> BGE t, lbl
>>>>>
>>>>> Assuming 64-bit, would need dedicated compare ops for 64-bit
>>>>> comparisons
>>>>> (for 32-bit, SUB should work assuming 32-bit values are kept sign or
>>>>> zero extended).
>>>>>
>>>>> Constant cases would be similar, except:
>>>>> if(x>c) ..
>>>>> if(x<=c) ..
>>>>>
>>>>> Can't be directly encoded in 2 ops if we only have:
>>>>> SUB Rm, imm, Rn // Rn=Rm-Imm
>>>>> Would likely also need:
>>>>> RSUB Rm, imm, Rn // Rn=Imm-Rm
>>>>>
>>>
>>> I was initially looking at stuff, and reverse-subtract cases
>>> initially seemed rare.
>>>
>>> But, I added a mock-up pseudo-instruction (faked by a constant load
>>> followed by a 3R subtract), and modified the 3AC->ASM code to try to
>>> use it.
>>>
>>> Then suddenly they appeared all over the place, along with a
>>> noticeable improvement in Doom framerates (and a slight decrease in
>>> the Load/Store density).
>>>
>>> It seems like reverse subtracts weren't quite as rare as I thought,
>>> and it was also seemingly adversely effecting the register allocator
>>> (which would handle the constants in these cases by treating them
>>> like they were variables; albeit ones' without any backing memory; so
>>> they simply disappear when evicted, and generate a constant-load when
>>> used again).
>>>
>>>
>>> Goes and adds the actual instruction as a test, seems it is still
>>> pretty far down the ranking (still nowhere near as common as most of
>>> the other ALU ops).
>>>
>>> It seems like the gains were more likely due to not dealing with
>>> these constants via the register allocator, than due to any
>>> particular merit of the instruction itself.
>>>
>>>
>>>> "Breakdown, go ahead and give it to me
>>>> Breakdown, honey, take me through the night" Tom Petty and the
>>>> Heartbreakers....
>>>
>>> Not really heard much of Tom Petty, I think my parents like his music
>>> though.
>>>
>>> Am personally more into House/Dubstep/EDM/etc.
>>>
>>>
>>> When I was younger, I was kinda into Goth (was mostly Synthpop based
>>> at the time, I guess vs an older Rock/Metal based style). I guess
>>> when I got a little older though, I ended up taking issue with the
>>> genre's almost cult-like obsession with vampires and occult topics.
>>>
>>>
>>> Well, and I guess at some point I went from seeing existence through
>>> a primarily negative lens, to being more neutral. Say, where in the
>>> greater scheme of thing, ones' existence is mostly meaningless, but
>>> like at least one can try to make the best of it; like it doesn't do
>>> much good to spend all of ones' time being caught up in ones'
>>> existence being ultimately meaningless, etc.
>>>
>>>
>>> Unlike some people, could really never make the jump to believing
>>> there is intrinsic value in anything; but will at least to claim that
>>> a sort of localized value exists (say, things can have value so long
>>> as there are still people to take value in them).
>>>
>>> Well, or, say, value exists for humans in much the same way as
>>> software exists for computers. If there were no computers, there
>>> would not be any way for software to exist, but as long as they
>>> exist, so too does the software they contain.
>>>
>>> Well, ignoring any religious / theological arguments; ultimately
>>> can't take a solid stance on this; nor is it entirely obvious whether
>>> this is enough to justify a claim that intrinsic value exists, or if
>>> it merely changes the scope slightly.
>>>
>>> I guess I loosely identify with existentialism, but also disagree
>>> with their tendency to assign emotional/subjective qualities to
>>> existence being (ultimately) meaningless (basically "smells" too much
>>> like the same sort of underlying philosophy as the goth subculture).
>>> Say, the lack of meaning not being any sort of malice, but rather,
>>> nothing whatsoever (can't assign malice to something which doesn't
>>> really exist in the first place).
>>>
>>>
>>> Not quite figured out how other people think in these areas.
>>> Sometimes I am left with some inward facing concerns as to "who I
>>> am", but am then left to no real way to "fix" them nor with any real
>>> way that they are "fixable".
>>>
>>> Torn between trying to go into this topic, but it is an difficult
>>> area, and I am kinda really needing to go to sleep...
>>>
>>> Kinda really need to sleep, I guess now is probably not the right
>>> time to go into my thoughts here.
>>
>
> ( Didn't get much sleep, not an ideal scenario... )
>
>> There's extrinsic meaning (or lack thereof), or there's intrinsic
>> meaning, that one asserts. "Yes life has meaning, because I say it does".
>
> Yeah, I can believe in extrinsic meaning at least.
>
>
> I am socially expected to believe in intrinsic meaning, except:
> There isn't a whole lot of evidence to support it;

It's intrinsic; it needs no evidence. You deem it good because you have
defined what good is.

> Things like moral ethics turn into a big convoluted mess if one assumes
> it exists;
> The model is a lot simpler if one assumes that only extrinsic value exists.

Pure intrinsic is simple too.

> But, one is then left to say to others, "I value you because you are
> useful to me, I hope I can also be of some use."

"I value you because in the cosmology I have created valuing you makes a
satisfying cosmology"


Click here to read the complete article
Re: my66 COMPARE operator question

<ca069d6a-b745-425b-9346-1431d4b51ef1n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a37:790:0:b0:6cb:ebb2:2bd4 with SMTP id 138-20020a370790000000b006cbebb22bd4mr4449311qkh.612.1662754412279;
Fri, 09 Sep 2022 13:13:32 -0700 (PDT)
X-Received: by 2002:a05:622a:1388:b0:344:4ff1:dd66 with SMTP id
o8-20020a05622a138800b003444ff1dd66mr13574645qtk.135.1662754412159; Fri, 09
Sep 2022 13:13:32 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Fri, 9 Sep 2022 13:13:32 -0700 (PDT)
In-Reply-To: <tfg3oc$1442l$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:f9ed:a4f0:f011:c46;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:f9ed:a4f0:f011:c46
References: <tf93ab$56s2$1@dont-email.me> <b5ee3bfc-471b-4177-8b8c-cf33783dec1cn@googlegroups.com>
<tfaqfg$a57b$1@dont-email.me> <ec758b74-71c0-4f58-8256-50a6e8d52233n@googlegroups.com>
<tfbkk6$f5mq$1@dont-email.me> <63a4a09c-a8f1-4237-badb-f95e49c14c76n@googlegroups.com>
<tfdcbr$pkm9$1@dont-email.me> <6c22b55d-50df-41db-b6da-9cfb514cf8d0n@googlegroups.com>
<tff2jj$10uqn$1@dont-email.me> <tff3ib$111o9$1@dont-email.me>
<tffvcr$13n3r$1@dont-email.me> <tfg3oc$1442l$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ca069d6a-b745-425b-9346-1431d4b51ef1n@googlegroups.com>
Subject: Re: my66 COMPARE operator question
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Fri, 09 Sep 2022 20:13:32 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2059
 by: MitchAlsup - Fri, 9 Sep 2022 20:13 UTC

On Friday, September 9, 2022 at 2:21:51 PM UTC-5, Ivan Godard wrote:
<merciful snip>
> >
> The challenge is to define a cosmology in which lameness is possible but
<
s/cosmology/ontology/
<
> is nevertheless fair. One such is the great judge in the sky that
> magically retitrates all earthly unfairness back to a neutral moral ph.
> I happen to find that design unsatisfying for other reasons, but it is
> at least fair.
<
Infinite punishment for finite crimes is "fair" ?!?

Re: my66 COMPARE operator question

<tfh217$19dec$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: cr88...@gmail.com (BGB)
Newsgroups: comp.arch
Subject: Re: my66 COMPARE operator question
Date: Fri, 9 Sep 2022 22:58:22 -0500
Organization: A noiseless patient Spider
Lines: 426
Message-ID: <tfh217$19dec$1@dont-email.me>
References: <tf93ab$56s2$1@dont-email.me>
<b5ee3bfc-471b-4177-8b8c-cf33783dec1cn@googlegroups.com>
<tfaqfg$a57b$1@dont-email.me>
<ec758b74-71c0-4f58-8256-50a6e8d52233n@googlegroups.com>
<tfbkk6$f5mq$1@dont-email.me>
<63a4a09c-a8f1-4237-badb-f95e49c14c76n@googlegroups.com>
<tfdcbr$pkm9$1@dont-email.me>
<6c22b55d-50df-41db-b6da-9cfb514cf8d0n@googlegroups.com>
<tff2jj$10uqn$1@dont-email.me> <tff3ib$111o9$1@dont-email.me>
<tffvcr$13n3r$1@dont-email.me> <tfg3oc$1442l$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 10 Sep 2022 03:58:31 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="8ee5985021ef3073de06bab7bfb092d3";
logging-data="1357260"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/HzVyt2Krwbfj07ZLiSdEa"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.13.0
Cancel-Lock: sha1:iIl/rOwDTqR4AW6tzJw8A5imoH4=
In-Reply-To: <tfg3oc$1442l$1@dont-email.me>
Content-Language: en-US
 by: BGB - Sat, 10 Sep 2022 03:58 UTC

On 9/9/2022 2:21 PM, Ivan Godard wrote:
> On 9/9/2022 11:07 AM, BGB wrote:
>> On 9/9/2022 5:12 AM, Ivan Godard wrote:
>>> On 9/9/2022 2:55 AM, BGB wrote:
>>>> On 9/8/2022 4:39 PM, MitchAlsup wrote:
>>>>> On Thursday, September 8, 2022 at 1:30:22 PM UTC-5, BGB wrote:
>>>>>> On 9/8/2022 9:14 AM, MitchAlsup wrote:
>>>>>>> On Wednesday, September 7, 2022 at 9:39:06 PM UTC-5, Ivan Godard
>>>>>>> wrote:
>>>>> <snip>
>>>>>> If I were not using my current scheme, would probably go for
>>>>>> something like:
>>>>>> BZ Rn, label //Branch if Rn==0
>>>>>> BNZ Rn, label //Branch if Rn!=0
>>>>>> BGE Rn, label //Branch if Rn>=0 (Sign=0)
>>>>>> BLT Rn, label //Branch if Rn< 0 (Sign=1)
>>>>>>
>>>>>> Average case would still be 2 instructions for compare-and-branch,
>>>>>> and
>>>>>> it would be cheaper for hardware than the strategy used by RISC-V.
>>>>>>
>>>>>>
>>>>>> Supporting arbitrary bits could be useful, estimated cost ~ 30
>>>>>> LUTs (vs
>>>>>> ~ 14 LUTs for an Rn==0 check). Could reduce many "if(x&mask)"
>>>>>> operations
>>>>>> to a single branch, but would likely still need an (Rn==0) / (Rn!=0)
>>>>>> check to deal with the general cases.
>>>>>>
>>>>>> Less cost and latency either way than requiring a relative
>>>>>> comparison.
>>>>>>
>>>>>>
>>>>>> With the mechanism above, say:
>>>>>> if(x)
>>>>>> BNZ x, lbl
>>>>>> if(!x)
>>>>>> BZ x, lbl
>>>>>> if(x&mask)
>>>>>> AND x, mask, t
>>>>>> BNZ t, lbl
>>>>>> if(!(x&mask))
>>>>>> AND x, mask, t
>>>>>> BZ t, lbl
>>>>>> if(x==y)
>>>>>> SUB x, y, t
>>>>>> BZ t, lbl
>>>>>> if(x!=y)
>>>>>> SUB x, y, t
>>>>>> BNZ t, lbl
>>>>>> if(x<y)
>>>>>> SUB x, y, t
>>>>>> BLT t, lbl
>>>>>> if(x>y)
>>>>>> SUB y, x, t
>>>>>> BLT t, lbl
>>>>>> if(x<=y)
>>>>>> SUB y, x, t
>>>>>> BGE t, lbl
>>>>>> if(x>=y)
>>>>>> SUB x, y, t
>>>>>> BGE t, lbl
>>>>>>
>>>>>> Assuming 64-bit, would need dedicated compare ops for 64-bit
>>>>>> comparisons
>>>>>> (for 32-bit, SUB should work assuming 32-bit values are kept sign or
>>>>>> zero extended).
>>>>>>
>>>>>> Constant cases would be similar, except:
>>>>>> if(x>c) ..
>>>>>> if(x<=c) ..
>>>>>>
>>>>>> Can't be directly encoded in 2 ops if we only have:
>>>>>> SUB Rm, imm, Rn // Rn=Rm-Imm
>>>>>> Would likely also need:
>>>>>> RSUB Rm, imm, Rn // Rn=Imm-Rm
>>>>>>
>>>>
>>>> I was initially looking at stuff, and reverse-subtract cases
>>>> initially seemed rare.
>>>>
>>>> But, I added a mock-up pseudo-instruction (faked by a constant load
>>>> followed by a 3R subtract), and modified the 3AC->ASM code to try to
>>>> use it.
>>>>
>>>> Then suddenly they appeared all over the place, along with a
>>>> noticeable improvement in Doom framerates (and a slight decrease in
>>>> the Load/Store density).
>>>>
>>>> It seems like reverse subtracts weren't quite as rare as I thought,
>>>> and it was also seemingly adversely effecting the register allocator
>>>> (which would handle the constants in these cases by treating them
>>>> like they were variables; albeit ones' without any backing memory;
>>>> so they simply disappear when evicted, and generate a constant-load
>>>> when used again).
>>>>
>>>>
>>>> Goes and adds the actual instruction as a test, seems it is still
>>>> pretty far down the ranking (still nowhere near as common as most of
>>>> the other ALU ops).
>>>>
>>>> It seems like the gains were more likely due to not dealing with
>>>> these constants via the register allocator, than due to any
>>>> particular merit of the instruction itself.
>>>>
>>>>
>>>>> "Breakdown, go ahead and give it to me
>>>>> Breakdown, honey, take me through the night" Tom Petty and the
>>>>> Heartbreakers....
>>>>
>>>> Not really heard much of Tom Petty, I think my parents like his
>>>> music though.
>>>>
>>>> Am personally more into House/Dubstep/EDM/etc.
>>>>
>>>>
>>>> When I was younger, I was kinda into Goth (was mostly Synthpop based
>>>> at the time, I guess vs an older Rock/Metal based style). I guess
>>>> when I got a little older though, I ended up taking issue with the
>>>> genre's almost cult-like obsession with vampires and occult topics.
>>>>
>>>>
>>>> Well, and I guess at some point I went from seeing existence through
>>>> a primarily negative lens, to being more neutral. Say, where in the
>>>> greater scheme of thing, ones' existence is mostly meaningless, but
>>>> like at least one can try to make the best of it; like it doesn't do
>>>> much good to spend all of ones' time being caught up in ones'
>>>> existence being ultimately meaningless, etc.
>>>>
>>>>
>>>> Unlike some people, could really never make the jump to believing
>>>> there is intrinsic value in anything; but will at least to claim
>>>> that a sort of localized value exists (say, things can have value so
>>>> long as there are still people to take value in them).
>>>>
>>>> Well, or, say, value exists for humans in much the same way as
>>>> software exists for computers. If there were no computers, there
>>>> would not be any way for software to exist, but as long as they
>>>> exist, so too does the software they contain.
>>>>
>>>> Well, ignoring any religious / theological arguments; ultimately
>>>> can't take a solid stance on this; nor is it entirely obvious
>>>> whether this is enough to justify a claim that intrinsic value
>>>> exists, or if it merely changes the scope slightly.
>>>>
>>>> I guess I loosely identify with existentialism, but also disagree
>>>> with their tendency to assign emotional/subjective qualities to
>>>> existence being (ultimately) meaningless (basically "smells" too
>>>> much like the same sort of underlying philosophy as the goth
>>>> subculture). Say, the lack of meaning not being any sort of malice,
>>>> but rather, nothing whatsoever (can't assign malice to something
>>>> which doesn't really exist in the first place).
>>>>
>>>>
>>>> Not quite figured out how other people think in these areas.
>>>> Sometimes I am left with some inward facing concerns as to "who I
>>>> am", but am then left to no real way to "fix" them nor with any real
>>>> way that they are "fixable".
>>>>
>>>> Torn between trying to go into this topic, but it is an difficult
>>>> area, and I am kinda really needing to go to sleep...
>>>>
>>>> Kinda really need to sleep, I guess now is probably not the right
>>>> time to go into my thoughts here.
>>>
>>
>> ( Didn't get much sleep, not an ideal scenario... )
>>
>>> There's extrinsic meaning (or lack thereof), or there's intrinsic
>>> meaning, that one asserts. "Yes life has meaning, because I say it
>>> does".
>>
>> Yeah, I can believe in extrinsic meaning at least.
>>
>>
>> I am socially expected to believe in intrinsic meaning, except:
>> There isn't a whole lot of evidence to support it;
>
> It's intrinsic; it needs no evidence. You deem it good because you have
> defined what good is.
>


Click here to read the complete article
Re: my66 COMPARE operator question

<tfh3co$19g3m$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: iva...@millcomputing.com (Ivan Godard)
Newsgroups: comp.arch
Subject: Re: my66 COMPARE operator question
Date: Fri, 9 Sep 2022 21:21:44 -0700
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <tfh3co$19g3m$1@dont-email.me>
References: <tf93ab$56s2$1@dont-email.me>
<b5ee3bfc-471b-4177-8b8c-cf33783dec1cn@googlegroups.com>
<tfaqfg$a57b$1@dont-email.me>
<ec758b74-71c0-4f58-8256-50a6e8d52233n@googlegroups.com>
<tfbkk6$f5mq$1@dont-email.me>
<63a4a09c-a8f1-4237-badb-f95e49c14c76n@googlegroups.com>
<tfdcbr$pkm9$1@dont-email.me>
<6c22b55d-50df-41db-b6da-9cfb514cf8d0n@googlegroups.com>
<tff2jj$10uqn$1@dont-email.me> <tff3ib$111o9$1@dont-email.me>
<tffvcr$13n3r$1@dont-email.me> <tfg3oc$1442l$1@dont-email.me>
<ca069d6a-b745-425b-9346-1431d4b51ef1n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 10 Sep 2022 04:21:44 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="00e6654ab5766797f92649fc0766797f";
logging-data="1359990"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19JUuHfOLc/B76UkW0qW7A3"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.13.0
Cancel-Lock: sha1:mZU+U4c4k2OxnRqyZ1BghpHSNpc=
Content-Language: en-US
In-Reply-To: <ca069d6a-b745-425b-9346-1431d4b51ef1n@googlegroups.com>
 by: Ivan Godard - Sat, 10 Sep 2022 04:21 UTC

On 9/9/2022 1:13 PM, MitchAlsup wrote:
> On Friday, September 9, 2022 at 2:21:51 PM UTC-5, Ivan Godard wrote:
> <merciful snip>
>>>
>> The challenge is to define a cosmology in which lameness is possible but
> <
> s/cosmology/ontology/
> <
>> is nevertheless fair. One such is the great judge in the sky that
>> magically retitrates all earthly unfairness back to a neutral moral ph.
>> I happen to find that design unsatisfying for other reasons, but it is
>> at least fair.
> <
> Infinite punishment for finite crimes is "fair" ?!?

Yes, because it applies equally to all. Whether it is just is another
matter.

Re: my66 COMPARE operator question

<tfh7c8$19pkv$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: cr88...@gmail.com (BGB)
Newsgroups: comp.arch
Subject: Re: my66 COMPARE operator question
Date: Sat, 10 Sep 2022 00:29:34 -0500
Organization: A noiseless patient Spider
Lines: 126
Message-ID: <tfh7c8$19pkv$1@dont-email.me>
References: <tf93ab$56s2$1@dont-email.me>
<b5ee3bfc-471b-4177-8b8c-cf33783dec1cn@googlegroups.com>
<tfaqfg$a57b$1@dont-email.me>
<ec758b74-71c0-4f58-8256-50a6e8d52233n@googlegroups.com>
<tfbkk6$f5mq$1@dont-email.me>
<63a4a09c-a8f1-4237-badb-f95e49c14c76n@googlegroups.com>
<tfdcbr$pkm9$1@dont-email.me>
<6c22b55d-50df-41db-b6da-9cfb514cf8d0n@googlegroups.com>
<tff2jj$10uqn$1@dont-email.me> <tff3ib$111o9$1@dont-email.me>
<tffvcr$13n3r$1@dont-email.me> <tfg3oc$1442l$1@dont-email.me>
<ca069d6a-b745-425b-9346-1431d4b51ef1n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 10 Sep 2022 05:29:44 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="8ee5985021ef3073de06bab7bfb092d3";
logging-data="1369759"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18u1Nm9676139G8fyKNL/ua"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.13.0
Cancel-Lock: sha1:YzKMlbiKzGlmDzjUcOHHnznZqHE=
Content-Language: en-US
In-Reply-To: <ca069d6a-b745-425b-9346-1431d4b51ef1n@googlegroups.com>
 by: BGB - Sat, 10 Sep 2022 05:29 UTC

On 9/9/2022 3:13 PM, MitchAlsup wrote:
> On Friday, September 9, 2022 at 2:21:51 PM UTC-5, Ivan Godard wrote:
> <merciful snip>
>>>
>> The challenge is to define a cosmology in which lameness is possible but
> <
> s/cosmology/ontology/

This would make more sense.

An ontology would mean the intrinsics are themselves an abstraction,
rather than claiming they are somehow anchored to the greater universe.

Many of the people asserting moral philosophies were also trying to
claim that their particular philosophy represented the universe as a
whole, rather than more simply as an organizing construct.

Asserting a non-existence of intrinsics works, as it makes no particular
claim about the greater universe.

One could try to claim it is a form of nihilism, but:
If nihilism were strictly true, one couldn't actually argue about
whether or not nihilism were true, it would exclude the possibility of
even raising the question.

Ultimately, it would itself (seemingly) decay into a form of
existentialism if for no other reason than this is what would be
required to be able to talk about it in the first place.

Though, I suspect in my case it would likely be classified as some sort
of existential utilitarianism. Likely differing from "traditional"
existentialism mainly in that, while I accept moral ethics as a sort of
emergent property, I see little reason to classify "the darkness" or
"the absurd" as inherently negative; rather it more represents the
distillation of "nothingness".

But, rather the more negative aspects would more likely be the result of
trying to face it while still trying to hold onto a belief in intrinsic
value. Say, if one tries to face the essence of nothingness and
meaninglessness while trying to hold on to a belief that their existence
has meaning in its own right, it can be admittedly, "kinda depressing".

I don't usually go that much into philosophy, it often doesn't go over
very well.

People believing in things like intrinsic worth and similar is,
admittedly, a whole lot more popular.

> <
>> is nevertheless fair. One such is the great judge in the sky that
>> magically retitrates all earthly unfairness back to a neutral moral ph.
>> I happen to find that design unsatisfying for other reasons, but it is
>> at least fair.
> <
> Infinite punishment for finite crimes is "fair" ?!?

There are several different ways of interpreting things, with the
different groups each claiming that that their views are "the truth".

Heaven/Hell:
Good people, Heaven;
Bad people, Hell.

Then, say, there are different definitions of what it means to be good
in this context:
Good actions (charitable actions);
Lack of bad actions (avoiding doing stuff that is immoral);
Faith alone.

Definitions differ, often the idea is that it is faith which leads to
the former. The former without the latter will not get one in the door.
Claiming to have faith but not doing the other two is seen as showing
that the persons' faith isn't actually real. Usual idea is that if one
has faith, they will feel a sense of caring towards everyone else, so of
course they would act charitably as a result (but, by themselves,
neither charitable actions, nor avoiding bad actions, is sufficient).

This seems to be the main interpretation in mainline Protestantism.

One has a problem though, if their "faith" is basically nowhere near
good enough to "pass muster" if all this is actually true (...yeah...).

Meanwhile, if the claim is that the way to Heaven involves paying large
sums of money or similar, or subservience to, to some religious leader,
chances are, this is a cult... (If the leaders also claim prophetic
visions or supernatural powers or similar, this is pretty much
guaranteed...).

Heaven/Hell/Purgatory:
Good people, Heaven;
(Really) Bad people, Hell;
(Most everyone else) Purgatory.

Here, most people go to purgatory for a while, where they get punished
for a while, but then still go off to Heaven once their time is served.

The line between purgatory and hell is fuzzy, usual idea I think is that
people who actively break the Ten Commandments rules, and don't repent
of this, are the main ones who go to hell. Getting into heaven directly
(without first going through purgatory) being more the realm of saints.

This seems more to be the general position for Catholics.

Heaven/Hell/Sheol:
Good People, Heaven;
Bad People, Hell;
Others, Sheol.

Differs slightly from Purgatory, in that it is more of a waiting ground
where one can either be eventually sent to Heaven, sent to Hell, or be
erased from existence entirely. This tends to be a little bit more of a
wildcard.

Etc...

Re: my66 COMPARE operator question

<tfhs7o$1cm0m$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: iva...@millcomputing.com (Ivan Godard)
Newsgroups: comp.arch
Subject: Re: my66 COMPARE operator question
Date: Sat, 10 Sep 2022 04:25:44 -0700
Organization: A noiseless patient Spider
Lines: 133
Message-ID: <tfhs7o$1cm0m$1@dont-email.me>
References: <tf93ab$56s2$1@dont-email.me>
<b5ee3bfc-471b-4177-8b8c-cf33783dec1cn@googlegroups.com>
<tfaqfg$a57b$1@dont-email.me>
<ec758b74-71c0-4f58-8256-50a6e8d52233n@googlegroups.com>
<tfbkk6$f5mq$1@dont-email.me>
<63a4a09c-a8f1-4237-badb-f95e49c14c76n@googlegroups.com>
<tfdcbr$pkm9$1@dont-email.me>
<6c22b55d-50df-41db-b6da-9cfb514cf8d0n@googlegroups.com>
<tff2jj$10uqn$1@dont-email.me> <tff3ib$111o9$1@dont-email.me>
<tffvcr$13n3r$1@dont-email.me> <tfg3oc$1442l$1@dont-email.me>
<ca069d6a-b745-425b-9346-1431d4b51ef1n@googlegroups.com>
<tfh7c8$19pkv$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 10 Sep 2022 11:25:45 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="00e6654ab5766797f92649fc0766797f";
logging-data="1464342"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+0i3idEz8EzQ2ahmzgR5Vj"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.13.0
Cancel-Lock: sha1:ek28x8ni025NhoPxEn9nyp5TWfU=
Content-Language: en-US
In-Reply-To: <tfh7c8$19pkv$1@dont-email.me>
 by: Ivan Godard - Sat, 10 Sep 2022 11:25 UTC

On 9/9/2022 10:29 PM, BGB wrote:
> On 9/9/2022 3:13 PM, MitchAlsup wrote:
>> On Friday, September 9, 2022 at 2:21:51 PM UTC-5, Ivan Godard wrote:
>> <merciful snip>
>>>>
>>> The challenge is to define a cosmology in which lameness is possible but
>> <
>> s/cosmology/ontology/
>
> This would make more sense.
>
> An ontology would mean the intrinsics are themselves an abstraction,
> rather than claiming they are somehow anchored to the greater universe.
>
> Many of the people asserting moral philosophies were also trying to
> claim that their particular philosophy represented the universe as a
> whole, rather than more simply as an organizing construct.
>
>
> Asserting a non-existence of intrinsics works, as it makes no particular
> claim about the greater universe.
>
>
> One could try to claim it is a form of nihilism, but:
> If nihilism were strictly true, one couldn't actually argue about
> whether or not nihilism were true, it would exclude the possibility of
> even raising the question.
>
> Ultimately, it would itself (seemingly) decay into a form of
> existentialism if for no other reason than this is what would be
> required to be able to talk about it in the first place.
>
>
> Though, I suspect in my case it would likely be classified as some sort
> of existential utilitarianism. Likely differing from "traditional"
> existentialism mainly in that, while I accept moral ethics as a sort of
> emergent property, I see little reason to classify "the darkness" or
> "the absurd" as inherently negative; rather it more represents the
> distillation of "nothingness".
>
> But, rather the more negative aspects would more likely be the result of
> trying to face it while still trying to hold onto a belief in intrinsic
> value. Say, if one tries to face the essence of nothingness and
> meaninglessness while trying to hold on to a belief that their existence
> has meaning in its own right, it can be admittedly, "kinda depressing".
>
> I don't usually go that much into philosophy, it often doesn't go over
> very well.
>
>
> People believing in things like intrinsic worth and similar is,
> admittedly, a whole lot more popular.
>
>
>
>> <
>>> is nevertheless fair. One such is the great judge in the sky that
>>> magically retitrates all earthly unfairness back to a neutral moral ph.
>>> I happen to find that design unsatisfying for other reasons, but it is
>>> at least fair.
>> <
>> Infinite punishment for finite crimes is "fair" ?!?
>
> There are several different ways of interpreting things, with the
> different groups each claiming that that their views are "the truth".
>
>
> Heaven/Hell:
>   Good people, Heaven;
>   Bad people, Hell.
>
> Then, say, there are different definitions of what it means to be good
> in this context:
>   Good actions (charitable actions);
>   Lack of bad actions (avoiding doing stuff that is immoral);
>   Faith alone.
>
> Definitions differ, often the idea is that it is faith which leads to
> the former. The former without the latter will not get one in the door.
> Claiming to have faith but not doing the other two is seen as showing
> that the persons' faith isn't actually real. Usual idea is that if one
> has faith, they will feel a sense of caring towards everyone else, so of
> course they would act charitably as a result (but, by themselves,
> neither charitable actions, nor avoiding bad actions, is sufficient).
>
> This seems to be the main interpretation in mainline Protestantism.
>
>
> One has a problem though, if their "faith" is basically nowhere near
> good enough to "pass muster" if all this is actually true (...yeah...).
>
>
> Meanwhile, if the claim is that the way to Heaven involves paying large
> sums of money or similar, or subservience to, to some religious leader,
> chances are, this is a cult... (If the leaders also claim prophetic
> visions or supernatural powers or similar, this is pretty much
> guaranteed...).
>
>
> Heaven/Hell/Purgatory:
>   Good people, Heaven;
>   (Really) Bad people, Hell;
>   (Most everyone else) Purgatory.
>
> Here, most people go to purgatory for a while, where they get punished
> for a while, but then still go off to Heaven once their time is served.
>
> The line between purgatory and hell is fuzzy, usual idea I think is that
> people who actively break the Ten Commandments rules, and don't repent
> of this, are the main ones who go to hell. Getting into heaven directly
> (without first going through purgatory) being more the realm of saints.
>
> This seems more to be the general position for Catholics.
>
>
> Heaven/Hell/Sheol:
>   Good People, Heaven;
>   Bad People, Hell;
>   Others, Sheol.
>
> Differs slightly from Purgatory, in that it is more of a waiting ground
> where one can either be eventually sent to Heaven, sent to Hell, or be
> erased from existence entirely. This tends to be a little bit more of a
> wildcard.
>
> Etc...
>

You have a different meaning for "intrinsic" than I do - as discovered,
while I mean as asserted.

Design the universe the way you want it to work, then live as if you
were in that universe.

Re: my66 COMPARE operator question

<tfiohd$1jtmh$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: cr88...@gmail.com (BGB)
Newsgroups: comp.arch
Subject: Re: my66 COMPARE operator question
Date: Sat, 10 Sep 2022 14:28:34 -0500
Organization: A noiseless patient Spider
Lines: 300
Message-ID: <tfiohd$1jtmh$1@dont-email.me>
References: <tf93ab$56s2$1@dont-email.me>
<b5ee3bfc-471b-4177-8b8c-cf33783dec1cn@googlegroups.com>
<tfaqfg$a57b$1@dont-email.me>
<ec758b74-71c0-4f58-8256-50a6e8d52233n@googlegroups.com>
<tfbkk6$f5mq$1@dont-email.me>
<63a4a09c-a8f1-4237-badb-f95e49c14c76n@googlegroups.com>
<tfdcbr$pkm9$1@dont-email.me>
<6c22b55d-50df-41db-b6da-9cfb514cf8d0n@googlegroups.com>
<tff2jj$10uqn$1@dont-email.me> <tff3ib$111o9$1@dont-email.me>
<tffvcr$13n3r$1@dont-email.me> <tfg3oc$1442l$1@dont-email.me>
<ca069d6a-b745-425b-9346-1431d4b51ef1n@googlegroups.com>
<tfh7c8$19pkv$1@dont-email.me> <tfhs7o$1cm0m$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 10 Sep 2022 19:28:45 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="8ee5985021ef3073de06bab7bfb092d3";
logging-data="1701585"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+xXKNARRnF1uG2fh/BTu1W"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.13.0
Cancel-Lock: sha1:xF209sN3kWbjzx+Fyy2wf+de9sY=
In-Reply-To: <tfhs7o$1cm0m$1@dont-email.me>
Content-Language: en-US
 by: BGB - Sat, 10 Sep 2022 19:28 UTC

On 9/10/2022 6:25 AM, Ivan Godard wrote:
> On 9/9/2022 10:29 PM, BGB wrote:
>> On 9/9/2022 3:13 PM, MitchAlsup wrote:
>>> On Friday, September 9, 2022 at 2:21:51 PM UTC-5, Ivan Godard wrote:
>>> <merciful snip>
>>>>>
>>>> The challenge is to define a cosmology in which lameness is possible
>>>> but
>>> <
>>> s/cosmology/ontology/
>>
>> This would make more sense.
>>
>> An ontology would mean the intrinsics are themselves an abstraction,
>> rather than claiming they are somehow anchored to the greater universe.
>>
>> Many of the people asserting moral philosophies were also trying to
>> claim that their particular philosophy represented the universe as a
>> whole, rather than more simply as an organizing construct.
>>
>>
>> Asserting a non-existence of intrinsics works, as it makes no
>> particular claim about the greater universe.
>>
>>
>> One could try to claim it is a form of nihilism, but:
>> If nihilism were strictly true, one couldn't actually argue about
>> whether or not nihilism were true, it would exclude the possibility of
>> even raising the question.
>>
>> Ultimately, it would itself (seemingly) decay into a form of
>> existentialism if for no other reason than this is what would be
>> required to be able to talk about it in the first place.
>>
>>
>> Though, I suspect in my case it would likely be classified as some
>> sort of existential utilitarianism. Likely differing from
>> "traditional" existentialism mainly in that, while I accept moral
>> ethics as a sort of emergent property, I see little reason to classify
>> "the darkness" or "the absurd" as inherently negative; rather it more
>> represents the distillation of "nothingness".
>>
>> But, rather the more negative aspects would more likely be the result
>> of trying to face it while still trying to hold onto a belief in
>> intrinsic value. Say, if one tries to face the essence of nothingness
>> and meaninglessness while trying to hold on to a belief that their
>> existence has meaning in its own right, it can be admittedly, "kinda
>> depressing".
>>
>> I don't usually go that much into philosophy, it often doesn't go over
>> very well.
>>
>>
>> People believing in things like intrinsic worth and similar is,
>> admittedly, a whole lot more popular.
>>
>>
>>
>>> <
>>>> is nevertheless fair. One such is the great judge in the sky that
>>>> magically retitrates all earthly unfairness back to a neutral moral ph.
>>>> I happen to find that design unsatisfying for other reasons, but it is
>>>> at least fair.
>>> <
>>> Infinite punishment for finite crimes is "fair" ?!?
>>
>> There are several different ways of interpreting things, with the
>> different groups each claiming that that their views are "the truth".
>>
>>
>> Heaven/Hell:
>>    Good people, Heaven;
>>    Bad people, Hell.
>>
>> Then, say, there are different definitions of what it means to be good
>> in this context:
>>    Good actions (charitable actions);
>>    Lack of bad actions (avoiding doing stuff that is immoral);
>>    Faith alone.
>>
>> Definitions differ, often the idea is that it is faith which leads to
>> the former. The former without the latter will not get one in the
>> door. Claiming to have faith but not doing the other two is seen as
>> showing that the persons' faith isn't actually real. Usual idea is
>> that if one has faith, they will feel a sense of caring towards
>> everyone else, so of course they would act charitably as a result
>> (but, by themselves, neither charitable actions, nor avoiding bad
>> actions, is sufficient).
>>
>> This seems to be the main interpretation in mainline Protestantism.
>>
>>
>> One has a problem though, if their "faith" is basically nowhere near
>> good enough to "pass muster" if all this is actually true (...yeah...).
>>
>>
>> Meanwhile, if the claim is that the way to Heaven involves paying
>> large sums of money or similar, or subservience to, to some religious
>> leader, chances are, this is a cult... (If the leaders also claim
>> prophetic visions or supernatural powers or similar, this is pretty
>> much guaranteed...).
>>
>>
>> Heaven/Hell/Purgatory:
>>    Good people, Heaven;
>>    (Really) Bad people, Hell;
>>    (Most everyone else) Purgatory.
>>
>> Here, most people go to purgatory for a while, where they get punished
>> for a while, but then still go off to Heaven once their time is served.
>>
>> The line between purgatory and hell is fuzzy, usual idea I think is
>> that people who actively break the Ten Commandments rules, and don't
>> repent of this, are the main ones who go to hell. Getting into heaven
>> directly (without first going through purgatory) being more the realm
>> of saints.
>>
>> This seems more to be the general position for Catholics.
>>
>>
>> Heaven/Hell/Sheol:
>>    Good People, Heaven;
>>    Bad People, Hell;
>>    Others, Sheol.
>>
>> Differs slightly from Purgatory, in that it is more of a waiting
>> ground where one can either be eventually sent to Heaven, sent to
>> Hell, or be erased from existence entirely. This tends to be a little
>> bit more of a wildcard.
>>
>> Etc...
>>
>
> You have a different meaning for "intrinsic" than I do - as discovered,
> while I mean as asserted.
>
> Design the universe the way you want it to work, then live as if you
> were in that universe.

AFAIK, the way I am using it is consistent with how it is usually used
in deontology style systems, where usually the assumption isn't just "A
is good because we assert it is good", but rather they assume that
either the universe or itself mandates that A is good or B is bad.

Something like Asimov's Three Laws being an example of a ridiculously
simplified version of such a system (and I also suspect its instability
likely being intentional part of its design; say, to make for more
interesting plot scenarios than one that "actually works as intended").

From what I can tell, most people seem to believe in this approach.

And, some people take it a little too far:
Hassidic Judaism, the Amish, etc, being examples of what can happen;
Fundamentalist Christianity also seems headed down this road;
Well, also Islamic Sharia law, etc;
...

One also doesn't necessarily want these sorts of systems to be put into
a place of authority over a society, as the results are usually not ideal.

Note though, that the problem is not necessarily due to people taking
the Bible too seriously, and (if anything) it on multiple occasions
basically says not to do this (warnings against "building a hedge around
the law", etc), but people ignore this part and do it anyways (and often
seemingly missing the point of the original rule in the first place).

The specifics differ, but still have the same underlying sorts of
issues. Everyone then takes it for granted that "morals just work that
way", never questioning that maybe some of their underlying assumptions
are broken.

Meanwhile, while secular law tends to follow a similar structure, people
are at least more open to acknowledge that it is a social construct and
are more willing to accept changes (laws get passed, something is now
legal or now illegal as a result, ...). Then there are legislative
structures, court of law, etc, for this purpose.

This tolerance to change is typically much less so with moral ethics.

For example, I can predict that there is (quite likely) to be a
religious/cultural opposition to things like cultured meat products,
once they become more widespread, because (in most ways of growing them)
they are a non-trivial violation of the Noahide laws, etc.

Similar issues would likely also apply to things like external
gestation, etc, as well.

My own views took a different approach, assuming not so much that the
values are handed down from "on high", but rather are themselves
emergent properties, based on the properties and constraints of humanity
as seen within the context of a hierarchical social structure.

In this case, the traditional rules make sense (significant deviation
being detrimental to the common good, etc).


Click here to read the complete article
Re: my66 COMPARE operator question

<tfmhu9$1aig$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!aioe.org!y0sttPrO1OAcON/g+jAtOw.user.46.165.242.91.POSTED!not-for-mail
From: terje.ma...@tmsw.no (Terje Mathisen)
Newsgroups: comp.arch
Subject: Re: my66 COMPARE operator question
Date: Mon, 12 Sep 2022 08:00:40 +0200
Organization: Aioe.org NNTP Server
Message-ID: <tfmhu9$1aig$1@gioia.aioe.org>
References: <tf93ab$56s2$1@dont-email.me>
<b5ee3bfc-471b-4177-8b8c-cf33783dec1cn@googlegroups.com>
<tfaqfg$a57b$1@dont-email.me>
<ec758b74-71c0-4f58-8256-50a6e8d52233n@googlegroups.com>
<tfbkk6$f5mq$1@dont-email.me>
<63a4a09c-a8f1-4237-badb-f95e49c14c76n@googlegroups.com>
<tfdcbr$pkm9$1@dont-email.me>
<6c22b55d-50df-41db-b6da-9cfb514cf8d0n@googlegroups.com>
<tff2jj$10uqn$1@dont-email.me>
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="43600"; posting-host="y0sttPrO1OAcON/g+jAtOw.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.13
X-Notice: Filtered by postfilter v. 0.9.2
 by: Terje Mathisen - Mon, 12 Sep 2022 06:00 UTC

BGB wrote:
> I was initially looking at stuff, and reverse-subtract cases initially
> seemed rare.

They are not!
>
> But, I added a mock-up pseudo-instruction (faked by a constant load
> followed by a 3R subtract), and modified the 3AC->ASM code to try to use
> it.
>
> Then suddenly they appeared all over the place, along with a noticeable
> improvement in Doom framerates (and a slight decrease in the Load/Store
> density).
>
> It seems like reverse subtracts weren't quite as rare as I thought, and
> it was also seemingly adversely effecting the register allocator (which
> would handle the constants in these cases by treating them like they
> were variables; albeit ones' without any backing memory; so they simply
> disappear when evicted, and generate a constant-load when used again).

I have desired reverse subtract quite often in inner loops, anywhere I'm
calculating the remaining space (bits/bytes) in a buffer: This is of
course exacerbated by x86 having only 2-reg instructions, but it also
comes into play when the value to be subtracted from is a constant.

Mitch's sign control is a beautiful solution, particularly since it
unlike the "free shift" in the original ARM doesn't actually add any
clock cycle time pressure.

Terje

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

Re: my66 COMPARE operator question

<tfmsj3$27lps$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: cr88...@gmail.com (BGB)
Newsgroups: comp.arch
Subject: Re: my66 COMPARE operator question
Date: Mon, 12 Sep 2022 04:02:15 -0500
Organization: A noiseless patient Spider
Lines: 119
Message-ID: <tfmsj3$27lps$1@dont-email.me>
References: <tf93ab$56s2$1@dont-email.me>
<b5ee3bfc-471b-4177-8b8c-cf33783dec1cn@googlegroups.com>
<tfaqfg$a57b$1@dont-email.me>
<ec758b74-71c0-4f58-8256-50a6e8d52233n@googlegroups.com>
<tfbkk6$f5mq$1@dont-email.me>
<63a4a09c-a8f1-4237-badb-f95e49c14c76n@googlegroups.com>
<tfdcbr$pkm9$1@dont-email.me>
<6c22b55d-50df-41db-b6da-9cfb514cf8d0n@googlegroups.com>
<tff2jj$10uqn$1@dont-email.me> <tfmhu9$1aig$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 12 Sep 2022 09:02:27 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="9220780c576cbb768b11b80b6a759fe4";
logging-data="2348860"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Yvbepeidec1GwuOxrK/xE"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.13.0
Cancel-Lock: sha1:RdzIpo7l0rGVcv9Gcu6JHVlCcsk=
Content-Language: en-US
In-Reply-To: <tfmhu9$1aig$1@gioia.aioe.org>
 by: BGB - Mon, 12 Sep 2022 09:02 UTC

On 9/12/2022 1:00 AM, Terje Mathisen wrote:
> BGB wrote:
>> I was initially looking at stuff, and reverse-subtract cases initially
>> seemed rare.
>
> They are not!

They seem to be in a gray area of neither particularly rare nor
particularly common.

Compared with normal ADD/SUB (in "Reg,Imm,Reg" form), they are rare.

If compared with a lot of more obscure operations, they are pretty common.

They seem to have a similar usage frequency to the 64-bit CMPQxx
operations and similar; when enabled, hanging around at around 0.1 to
0.3% of the cycle budget.

Added FPGA cost from decoding them is pretty small, but in this case it
is more a question of if they justify spending one of the last few Imm9
spots (or if in the future, another instruction might come along that
has a stronger need of an Imm9 spot).

While it would be cheaper to add it as an Imm5 encoding, due to encoding
reasons and a lot of the constants I was seeing, this would have made it
much less useful. Similar also applies to 2RI.

Where it looked like only spending an Imm9 spot on it would give it a
significant encoding advantage over faking it with a 2 instruction sequence.

Though, ironically, faking it via a pseudo instruction still seems to
offer a performance advantage over using the register allocator to treat
the constant like it was a variable.

>>
>> But, I added a mock-up pseudo-instruction (faked by a constant load
>> followed by a 3R subtract), and modified the 3AC->ASM code to try to
>> use it.
>>
>> Then suddenly they appeared all over the place, along with a
>> noticeable improvement in Doom framerates (and a slight decrease in
>> the Load/Store density).
>>
>> It seems like reverse subtracts weren't quite as rare as I thought,
>> and it was also seemingly adversely effecting the register allocator
>> (which would handle the constants in these cases by treating them like
>> they were variables; albeit ones' without any backing memory; so they
>> simply disappear when evicted, and generate a constant-load when used
>> again).
>
> I have desired reverse subtract quite often in inner loops, anywhere I'm
> calculating the remaining space (bits/bytes) in a buffer: This is of
> course exacerbated by x86 having only 2-reg instructions, but it also
> comes into play when the value to be subtracted from is a constant.
>
> Mitch's sign control is a beautiful solution, particularly since it
> unlike the "free shift" in the original ARM doesn't actually add any
> clock cycle time pressure.
>

OK, I don't have anything similar in my case.

Was also recently able to get another speedup by adding
loop-nesting-depth handling to the logic for tracing out and ranking
global variables (vs ranking them more simply by the number of times
they are referenced in the program being compiled).

This seems better able to consolidate commonly-accessed global variables
in a smaller area of memory, and seems to somewhat improve L1 hit rates
in Doom and similar.

Quake: Doesn't care about this.

Dhrystone: Doesn't care (already nearly 100% hit rate as-is).

Have noticed that it is a little faster if I turn on some aliasing
related optimizations, though BGBCC is still fairly conservative in this
area (this was mostly enabling struct-field caching and similar, vs the
"always do every load every time" semantics).

Recently was generally getting around 73k at 50MHz (not exactly great,
would need to get it up to ~ 115k at 50MHz to match RISC-V numbers here).

Could maybe be better if BGBCC didn't need to evict all the global
variables and similar at the end of every basic-block; but this is
easier said than done.

Unlike local variables, the "static assign variable to a CPU register"
trick doesn't work.

Have also noted that there seem to be edge cases where constant
expressions are leaking into the generated machine code, which ideally
shouldn't happen.

Well, and there are likewise scenarios where expression association
fails to evaluate (potential) constant cases:
y=x+3-5;
Could in theory be turned into:
y=x-2;
Except that the parser uses left-to-right associativity and thus the
constant parts of the expression don't get evaluated in the same way
that "y=x+(3-5);" would have been.

....

> Terje
>

Re: my66 COMPARE operator question

<tg41b4$4ie9$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: m.del...@this.bitsnbites.eu (Marcus)
Newsgroups: comp.arch
Subject: Re: my66 COMPARE operator question
Date: Sat, 17 Sep 2022 10:43:15 +0200
Organization: A noiseless patient Spider
Lines: 47
Message-ID: <tg41b4$4ie9$1@dont-email.me>
References: <tf93ab$56s2$1@dont-email.me>
<jwvh71i9cc6.fsf-monnier+comp.arch@gnu.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 17 Sep 2022 08:43:16 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="2c63de3c8ef37e45346b2c93442b1669";
logging-data="149961"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/0kx3s91KpDyT4q8swiawT4gQerlVg9DY="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.11.0
Cancel-Lock: sha1:trYf/TLu2A9VsZOLwzdj342TJWw=
In-Reply-To: <jwvh71i9cc6.fsf-monnier+comp.arch@gnu.org>
Content-Language: en-US
 by: Marcus - Sat, 17 Sep 2022 08:43 UTC

On 2022-09-08, Stefan Monnier wrote:
>> Most ISAs (ignoring those with implicit CCs) have a bunch of compare ops and
>> one- or two-way branches. Mitch has one compare op and a multi-test
>> branch. ISTM that there's no gain in entropy either way, although one or the
>> other may pack better if the ISA is stuck with fixed size instructions. Yes?
>
> A difference I can see is:
> - with the test encoded together with the compare operation, you have
> N possible tests to encode.
> - with the test encoded as a bit-select in the branch, you have
> M possible bits to select.
> Say you only support 8 different tests, but your words are 64bits,
> that's a difference of 3bit vs 6bits.
>
> Then another difference is when a single compare's results are used in
> N subsequent branches, in which case you save the repetition of
> the operands compared to the scheme where you need to perform
> N different comparisons.
>
> I don't think either factor will make much difference in real life, tho.
>

In MRISC32 I went with many tests (signed/unsigned integer EQ, LT, LE,
floating-point EQ, LT, ORDERED, ...), along with a bunch of different
branches (test SET/NOT-SET, signed integer ZERO, NOT-ZERO, LTZ, GTEZ,
etc).

That way I have the classical two-instruction sequence for most
conditional branches (TEST + BRANCH-IF-(NOT)-SET), which yields
equivalent instruction count as for most machines with a CC register.

The extra COMPARE-TO-ZERO-AND-BRANCH branch variants allows many
conditional branches to be done in a single instruction (e.g.
loop-downto-zero or skip-if-empty-array), which is an improvement
over CMP+Bcc.

The one thing that I'm not sure about, but that you are getting at, is
whether 1xCMP + NxBcc is common enough to warrant encoding multiple
comparison results in a single CMP instruction, rather than requiring
multiple SETcc instructions. In my experience it's not common enough to
make a difference - but that's just my gut feeling.

The main reason that I went with multiple SETcc instructions is that I
use the exact same instructions for Vector/SIMD comparisons, where you
typically want masks (per element true/false).

/Marcus

Re: my66 COMPARE operator question

<tg434u$4n6e$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: m.del...@this.bitsnbites.eu (Marcus)
Newsgroups: comp.arch
Subject: Re: my66 COMPARE operator question
Date: Sat, 17 Sep 2022 11:14:05 +0200
Organization: A noiseless patient Spider
Lines: 41
Message-ID: <tg434u$4n6e$1@dont-email.me>
References: <tf93ab$56s2$1@dont-email.me>
<b5ee3bfc-471b-4177-8b8c-cf33783dec1cn@googlegroups.com>
<tfaqfg$a57b$1@dont-email.me>
<ec758b74-71c0-4f58-8256-50a6e8d52233n@googlegroups.com>
<tfbkk6$f5mq$1@dont-email.me>
<63a4a09c-a8f1-4237-badb-f95e49c14c76n@googlegroups.com>
<tfdcbr$pkm9$1@dont-email.me>
<6c22b55d-50df-41db-b6da-9cfb514cf8d0n@googlegroups.com>
<tff2jj$10uqn$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 17 Sep 2022 09:14:06 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="2c63de3c8ef37e45346b2c93442b1669";
logging-data="154830"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19RGM6piaWWWs5fxAUbUkWZWsUOsWTqWXI="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.11.0
Cancel-Lock: sha1:CXS1VjjHa6aoJC+EC72jNs81wAE=
Content-Language: en-US
In-Reply-To: <tff2jj$10uqn$1@dont-email.me>
 by: Marcus - Sat, 17 Sep 2022 09:14 UTC

On 2022-09-09, BGB wrote:
> On 9/8/2022 4:39 PM, MitchAlsup wrote:
>> On Thursday, September 8, 2022 at 1:30:22 PM UTC-5, BGB wrote:
>>> On 9/8/2022 9:14 AM, MitchAlsup wrote:
>>>> On Wednesday, September 7, 2022 at 9:39:06 PM UTC-5, Ivan Godard wrote:
>> <snip>

<snip>

>
>> "Breakdown, go ahead and give it to me
>> Breakdown, honey, take me through the night" Tom Petty and the
>> Heartbreakers....
>
> Not really heard much of Tom Petty, I think my parents like his music
> though.
>
> Am personally more into House/Dubstep/EDM/etc.
>
>
> When I was younger, I was kinda into Goth (was mostly Synthpop based at
> the time, I guess vs an older Rock/Metal based style). I guess when I
> got a little older though, I ended up taking issue with the genre's
> almost cult-like obsession with vampires and occult topics.
>

If you like modern retro Synthwave/Chip/Dubstep you might enjoy this
Polish guy, LukHash, that never seems to run out of energy (I recently
found the music via my fancy for Commodore 64 music covers, of which he
has made a few):

https://youtu.be/o54xftPSwmA

On another topic, did you include an instruction for integer-subtract-
immediate-from-register-value, and if so, why? I only have
integer-subtract-register-value-from-immediate (a.k.a RSB in the ARM
world). I figured that integer-add-immediate-to-register-value works
just as well for subtracting immediates (just add a negative immediate
value).

/Marcus

Pages:12
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor