Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

19 May, 2024: Line wrapping has been changed to be more consistent with Usenet standards.
 If you find that it is broken please let me know here rocksolid.nodes.help


devel / comp.arch / Re: everything old is new again, Compare-and-branch vs PIC

SubjectAuthor
* Compare-and-branch vs PICRussell Wallace
+* Re: Compare-and-branch vs PICTheo
|`- Re: Compare-and-branch vs PICTheo
+- Re: Compare-and-branch vs PICMitchAlsup
+* Re: Compare-and-branch vs PICStephen Fuld
|+* Re: Compare-and-branch vs PICBGB
||`- Re: Compare-and-branch vs PICMitchAlsup
|`- Re: Compare-and-branch vs PICRussell Wallace
`* Re: Compare-and-branch vs PICBGB
 `* Re: Compare-and-branch vs PICMitchAlsup
  +* Re: Compare-and-branch vs PICrobf...@gmail.com
  |+- Re: Compare-and-branch vs PICBGB
  |`* Re: Compare-and-branch vs PICMitchAlsup
  | +* Re: Compare-and-branch vs PICScott Lurndal
  | |`- Re: Compare-and-branch vs PICMitchAlsup
  | `* Re: Compare-and-branch vs PICBGB
  |  +* Re: Compare-and-branch vs PICrobf...@gmail.com
  |  |+* Re: Compare-and-branch vs PICEricP
  |  ||+- Re: Compare-and-branch vs PICBGB
  |  ||`* Re: everything old is new again, Compare-and-branch vs PICJohn Levine
  |  || +- Re: everything old is new again, Compare-and-branch vs PICrobf...@gmail.com
  |  || +- Re: everything old is new again, Compare-and-branch vs PICMitchAlsup
  |  || `* Re: everything old is new again, Compare-and-branch vs PICEricP
  |  ||  +- Re: everything old is new again, Compare-and-branch vs PICMitchAlsup
  |  ||  +* Re: everything old is new again, Compare-and-branch vs PICJohn Levine
  |  ||  |+* Re: everything old is new again, Compare-and-branch vs PICStephen Fuld
  |  ||  ||`* Re: 36 bit history, everything old is new again, Compare-and-branch vs PICJohn Levine
  |  ||  || `- Re: 36 bit history, everything old is new again, Compare-and-branchStephen Fuld
  |  ||  |`* Re: everything old is new again, Compare-and-branch vs PICEricP
  |  ||  | `- Re: everything old is new again, Compare-and-branch vs PICJohn Levine
  |  ||  `* Re: everything old is new again, Compare-and-branch vs PICMitchAlsup
  |  ||   `* Re: everything old is new again, Compare-and-branch vs PICEricP
  |  ||    `* Re: everything old is new again, Compare-and-branch vs PICBGB
  |  ||     `* Re: everything old is new again, Compare-and-branch vs PICEricP
  |  ||      `* Re: everything old is new again, Compare-and-branch vs PICBGB
  |  ||       `* Re: everything old is new again, Compare-and-branch vs PICMitchAlsup
  |  ||        +* Re: everything old is new again, Compare-and-branch vs PICBGB
  |  ||        |+* Re: everything old is new again, Compare-and-branch vs PICMitchAlsup
  |  ||        ||+* Re: everything old is new again, Compare-and-branch vs PICBGB
  |  ||        |||`* Re: everything old is new again, Compare-and-branch vs PICMitchAlsup
  |  ||        ||| +* Re: everything old is new again, Compare-and-branch vs PICBGB
  |  ||        ||| |+- Re: everything old is new again, Compare-and-branch vs PICMitchAlsup
  |  ||        ||| |`* Re: everything old is new again, Compare-and-branch vs PICThomas Koenig
  |  ||        ||| | `* Re: everything old is new again, Compare-and-branch vs PICBGB
  |  ||        ||| |  +* Re: everything old is new again, Compare-and-branch vs PICStephen Fuld
  |  ||        ||| |  |+- Re: everything old is new again, Compare-and-branch vs PICMitchAlsup
  |  ||        ||| |  |`* Re: everything old is new again, Compare-and-branch vs PICBGB
  |  ||        ||| |  | `- Re: everything old is new again, Compare-and-branch vs PICThomas Koenig
  |  ||        ||| |  `* Re: everything old is new again, Compare-and-branch vs PICThomas Koenig
  |  ||        ||| |   `* Re: everything old is new again, Compare-and-branch vs PICBGB
  |  ||        ||| |    `* Re: everything old is new again, Compare-and-branch vs PICMitchAlsup
  |  ||        ||| |     `* Re: everything old is new again, Compare-and-branch vs PICBGB
  |  ||        ||| |      `* Re: everything old is new again, Compare-and-branch vs PICMitchAlsup
  |  ||        ||| |       `* Re: everything old is new again, Compare-and-branch vs PICBGB
  |  ||        ||| |        `* Re: everything old is new again, Compare-and-branch vs PICMitchAlsup
  |  ||        ||| |         `* Re: everything old is new again, Compare-and-branch vs PICBGB
  |  ||        ||| |          `- Re: everything old is new again, Compare-and-branch vs PICMitchAlsup
  |  ||        ||| +* Re: everything old is new again, Compare-and-branch vs PICTerje Mathisen
  |  ||        ||| |`- Re: everything old is new again, Compare-and-branch vs PICDavid Brown
  |  ||        ||| `* Re: everything old is new again, Compare-and-branch vs PICAnton Ertl
  |  ||        |||  +* Re: everything old is new again, Compare-and-branch vs PICBGB
  |  ||        |||  |+* Re: everything old is new again, Compare-and-branch vs PICTim Rentsch
  |  ||        |||  ||+* Re: everything old is new again, Compare-and-branch vs PICBGB
  |  ||        |||  |||+- Re: everything old is new again, Compare-and-branch vs PICrobf...@gmail.com
  |  ||        |||  |||+* Re: everything old is new again, Compare-and-branch vs PICThomas Koenig
  |  ||        |||  ||||`* Re: everything old is new again, Compare-and-branch vs PICStephen Fuld
  |  ||        |||  |||| +- Re: everything old is new again, Compare-and-branch vs PICBGB
  |  ||        |||  |||| +- Re: everything old is new again, Compare-and-branch vs PICDavid Brown
  |  ||        |||  |||| `- Re: everything old is new again, Compare-and-branch vs PICTim Rentsch
  |  ||        |||  |||`* Re: everything old is new again, Compare-and-branch vs PICTim Rentsch
  |  ||        |||  ||| `* Re: everything old is new again, Compare-and-branch vs PICBGB
  |  ||        |||  |||  `* Re: everything old is new again, Compare-and-branch vs PICTim Rentsch
  |  ||        |||  |||   `* Re: everything old is new again, Compare-and-branch vs PICBGB
  |  ||        |||  |||    `* Re: everything old is new again, Compare-and-branch vs PICScott Lurndal
  |  ||        |||  |||     `- Re: everything old is new again, Compare-and-branch vs PICBGB
  |  ||        |||  ||`* Re: everything old is new again, Compare-and-branch vs PICTerje Mathisen
  |  ||        |||  || +- Re: everything old is new again, Compare-and-branch vs PICThomas Koenig
  |  ||        |||  || +- Re: everything old is new again, Compare-and-branch vs PICDavid Brown
  |  ||        |||  || +- Re: everything old is new again, Compare-and-branch vs PICAnton Ertl
  |  ||        |||  || `* Re: everything old is new again, Compare-and-branch vs PICTim Rentsch
  |  ||        |||  ||  `* Re: everything old is new again, Compare-and-branch vs PICAnton Ertl
  |  ||        |||  ||   +* Re: everything old is new again, Compare-and-branch vs PICThomas Koenig
  |  ||        |||  ||   |`* Re: everything old is new again, Compare-and-branch vs PICBGB
  |  ||        |||  ||   | +* Re: everything old is new again, Compare-and-branch vs PICDavid Brown
  |  ||        |||  ||   | |`* Re: everything old is new again, Compare-and-branch vs PICBGB
  |  ||        |||  ||   | | `* Re: everything old is new again, Compare-and-branch vs PICDavid Brown
  |  ||        |||  ||   | |  `* Re: everything old is new again, Compare-and-branch vs PICBGB
  |  ||        |||  ||   | |   `* Re: everything old is new again, Compare-and-branch vs PICDavid Brown
  |  ||        |||  ||   | |    `* Re: everything old is new again, Compare-and-branch vs PICBGB
  |  ||        |||  ||   | |     `* Re: everything old is new again, Compare-and-branch vs PICDavid Brown
  |  ||        |||  ||   | |      +* Re: everything old is new again, Compare-and-branch vs PICMitchAlsup
  |  ||        |||  ||   | |      |+* Re: everything old is new again, Compare-and-branch vs PICEricP
  |  ||        |||  ||   | |      ||+- Re: everything old is new again, Compare-and-branch vs PICAnton Ertl
  |  ||        |||  ||   | |      ||+- Re: everything old is new again, Compare-and-branch vs PICMitchAlsup
  |  ||        |||  ||   | |      ||`* Re: everything old is new again, Compare-and-branch vs PICThomas Koenig
  |  ||        |||  ||   | |      || `- Re: everything old is new again, Compare-and-branch vs PICTerje Mathisen
  |  ||        |||  ||   | |      |+* Re: everything old is new again, Compare-and-branch vs PICMichael S
  |  ||        |||  ||   | |      ||+* Re: everything old is new again, Compare-and-branch vs PICThomas Koenig
  |  ||        |||  ||   | |      |||`* Re: everything old is new again, Compare-and-branch vs PICMichael S
  |  ||        |||  ||   | |      ||| `* Re: everything old is new again, Compare-and-branch vs PICThomas Koenig
  |  ||        |||  ||   | |      |||  `- Re: everything old is new again, Compare-and-branch vs PICMichael S
  |  ||        |||  ||   | |      ||`* Re: everything old is new again, Compare-and-branch vs PICMitchAlsup
  |  ||        |||  ||   | |      |`* Re: everything old is new again, Compare-and-branch vs PICDavid Brown
  |  ||        |||  ||   | |      +* Re: everything old is new again, Compare-and-branch vs PICBGB
  |  ||        |||  ||   | |      `* Re: everything old is new again, Compare-and-branch vs PICTerje Mathisen
  |  ||        |||  ||   | `* Re: everything old is new again, Compare-and-branch vs PICAnton Ertl
  |  ||        |||  ||   +* Re: everything old is new again, Compare-and-branch vs PICTim Rentsch
  |  ||        |||  ||   `* Re: everything old is new again, Compare-and-branch vs PICMichael S
  |  ||        |||  |`* Re: everything old is new again, Compare-and-branch vs PICTerje Mathisen
  |  ||        |||  `* Re: everything old is new again, Compare-and-branch vs PICMitchAlsup
  |  ||        ||+* Re: everything old is new again, Compare-and-branch vs PICTerje Mathisen
  |  ||        ||+* Re: everything old is new again, Compare-and-branch vs PICScott Lurndal
  |  ||        ||`* Re: everything old is new again, Compare-and-branch vs PICTim Rentsch
  |  ||        |`* Re: everything old is new again, Compare-and-branch vs PICThomas Koenig
  |  ||        +- Re: everything old is new again, Compare-and-branch vs PICThomas Koenig
  |  ||        `* Re: everything old is new again, Compare-and-branch vs PICAnton Ertl
  |  |`- Re: Compare-and-branch vs PICMitchAlsup
  |  `* Re: Compare-and-branch vs PICluke.l...@gmail.com
  `- Re: Compare-and-branch vs PICBGB

Pages:123456789101112131415161718192021222324
Re: everything old is new again, Compare-and-branch vs PIC

<13df9d3e-9ec4-4a01-a331-854eae3f5a2bn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:6214:5981:b0:4e2:e60e:f75b with SMTP id ll1-20020a056214598100b004e2e60ef75bmr624821qvb.114.1671222516185;
Fri, 16 Dec 2022 12:28:36 -0800 (PST)
X-Received: by 2002:a05:6870:5ccb:b0:144:5572:4aeb with SMTP id
et11-20020a0568705ccb00b0014455724aebmr1472226oab.186.1671222515925; Fri, 16
Dec 2022 12:28:35 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Fri, 16 Dec 2022 12:28:35 -0800 (PST)
In-Reply-To: <tnia66$3dq9e$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:28e0:c682:421c:7069;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:28e0:c682:421c:7069
References: <b6260f7b-fbeb-4549-8579-f12c76bc5b69n@googlegroups.com>
<tmtmlq$uo06$1@dont-email.me> <45ecc365-c1f0-4bd8-b92a-4e50209095c7n@googlegroups.com>
<kM1lL.20158$iU59.5539@fx14.iad> <tn2u7j$288n$1@gal.iecc.com>
<bwnlL.106$%os8.36@fx03.iad> <d3842b13-6457-4a7b-964d-ec0ce66447e2n@googlegroups.com>
<XuJlL.9383$MVg8.8632@fx12.iad> <tn9i9j$2g22f$1@dont-email.me>
<T44mL.71538$gGD7.48801@fx11.iad> <tnala2$2j5mv$1@dont-email.me>
<ffae19fc-caa4-47ce-b730-70389d9f8186n@googlegroups.com> <tnba86$2kho9$1@dont-email.me>
<6d6de22f-53be-4275-aee4-44f6581ff0a4n@googlegroups.com> <tnbvfc$2oj2d$1@dont-email.me>
<bc76d960-0863-49a8-8e72-0e44a684f4ben@googlegroups.com> <tndv79$2tjj5$1@dont-email.me>
<tneh34$v3a3$2@newsreader4.netcologne.de> <tnfsud$35ara$1@dont-email.me>
<tni4m0$11dpq$2@newsreader4.netcologne.de> <tni610$3ddoh$1@dont-email.me>
<faeef2b7-22ab-41c9-a4a6-69505a6106fcn@googlegroups.com> <tnia66$3dq9e$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <13df9d3e-9ec4-4a01-a331-854eae3f5a2bn@googlegroups.com>
Subject: Re: everything old is new again, Compare-and-branch vs PIC
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Fri, 16 Dec 2022 20:28:36 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 8001
 by: MitchAlsup - Fri, 16 Dec 2022 20:28 UTC

On Friday, December 16, 2022 at 11:34:01 AM UTC-6, BGB wrote:
> On 12/16/2022 10:43 AM, MitchAlsup wrote:
> > On Friday, December 16, 2022 at 10:23:00 AM UTC-6, BGB wrote:
> >> On 12/16/2022 10:00 AM, Thomas Koenig wrote:
> >>> BGB <cr8...@gmail.com> schrieb:
> >>>> On 12/15/2022 1:07 AM, Thomas Koenig wrote:
> >>>>> BGB <cr8...@gmail.com> schrieb:
> >>>>>
> >>>>> (argument list)
> >>>>>
> >>>>>> So, it looks like (looking at a few different programs):
> >>>>>> 4: ~79.2%
> >>>>>> 8: ~98.6%
> >>>>>> 15: ~99.9%
> >>>>>> 16: ~99.9%
> >>>>>> 18: 100%
> >>>>>
> >>>>> Did you ever take a look at LAPACK, or CLAPACK? Those are _long_
> >>>>> argument lists...
> >>>>>
> >>>>> For example, dgerfsx has 22 arguments (unless I miscounted) plus
> >>>>> two hidden character length arguments.
> >>>>
> >>>> None of my code has quite that many.
> >>>> The longest argument list currently is in my GLQuake port, mostly due to
> >>>> an 18 argument function being used in TKRA-GL.
> >>>>
> >>>> But, I guess one could debate if there are many codebases which deviate
> >>>> strongly from this, having a lot more long argument lists than short ones.
> >>>>
> >>>> Between Doom, ROTT, Quake, etc, specifics vary slightly, but the overall
> >>>> pattern remains pretty similar.
> >>>>
> >>>> So, it seems like:
> >>>> 8 will be sufficient "most of the time";
> >>>> 16 is slightly better;
> >>>> 24 or 32 would be needed to entirely eliminate the existence of stack
> >>>> arguments.
> >>>
> >>> You don't have experience with other people using your compiler,
> >>> I presume.
> >>>
> >>> If somebody puts an artificial limitation like that into a widely
> >>> used ABI or compiler, then somebody out there will run across that
> >>> limitation and post a bug report.
> >>>
> >>> Some people fuzz compilers as a hobby.
> >> There are no hard limit on the number of arguments in BGBCC.
> >>
> > In My 66000 ABI there is a limit of 8 register passed arguments (and results)
> > the rest are passed on the stack. An unconcerned programmer does not
> > need to even see that there is a limit. The performance aware programmer
> > will see higher performance with 8 or fewer arguments.
<
> The number of register arguments is limited by the ABI mode in question.
> The total maximum number of arguments is unbounded.
>
>
> I haven't yet settled on which ABI I will make the official ABI for XG2
> mode.
>
>
> While arguably "more register arguments is better", "more spill space is
> not better". Burning 256 bytes of the stack (rather than 128 bytes) for
> every non-leaf function seems to offset any gains from passing more
> arguments in registers (since, as noted, more than 8 is uncommon; at
> least for code using 64-bit pointers).
<
The amount of excess space on My 66000 stack is 0 bytes. The amount of
space in local_data_area is "whatever the compiler wants". The compiler
allocates 0 bytes that are not used.
<
As to "more is always better"; I am not so sure. With 8 registers used to pass
arguments, and 16 (including FP and SP) preserved registers, there are 8
freely used temporaries for leaf functions to "do stuff" without overhead.
If you increased the register arguments to 16 without addressing the free
temporaries, you end up having to save/restore some registers in order
to "do stuff", and based on your statistics, these account for only 1.4%
of subroutines.
<
>
> This almost makes a stronger case for not providing any spill space.
<
Which I do not.
> >>
> >> More, it is a case of avoiding stack arguments (entirely, if-possible)
> >> is better for performance in a strictly in-order machine.
> >>
> >> As for the ABI, it is sort of like:
> >> First 8 (or 16) arguments are passed in registers;
> >> Any remaining arguments are passed on the stack.
> >>
> >> There is also a spill space for the register arguments (in the 64-bit
> >> ABI), with the remaining arguments being after the spill space.
> > <
> > I worked out positions for the register and memory based arguments
> > such that the stack has "no excess space allocated" and "you can concatenate"
> > the register and memory spaces using ENTER--and indeed, this is how
> > varargs works.
<
> I wanted to go over to a "you can naively spill the registers to the
> stack and get back to a linear argument list like on x86" model.
<
While you can't do it naïvely, there is a straightforward way to achieve
this goal of a vector of arguments for varargs--and in My 66000 you
can achieve this at the cost of 0 extra instructions !
>
> The original ABI did not do this, so the "va_list" structure is more of
> a snapshot of all the argument registers followed by a pointer to the
> first non-register argument (as was needed for the original ABI).
>
It is even worse with multiple register files.
>
> As noted, the design for my ABI was somewhat influenced by the Windows
> X64 ABI (well, and also the Windows CE SH-4 ABI, from which it was also
> partially derived).
>
> There was also the Hitachi ABI, and GCC's SH-4 ABI, where ironically all
> were "similar but different", as even with the same ISA, seemingly no
> two parties can agree as to what exactly the C ABI rules should be...
>
>
> Would hope it would stay more consistent in my case, but seemingly I
> can't agree with myself as to what exactly the C ABI rules should be in
> some cases (hence why, annoyingly, the ABI has fragmented into
> sub-variants).
<
Auld lang syne ?

Re: everything old is new again, Compare-and-branch vs PIC

<tnj94q$3g4ga$1@dont-email.me>

  copy mid

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

  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: everything old is new again, Compare-and-branch vs PIC
Date: Fri, 16 Dec 2022 20:21:06 -0600
Organization: A noiseless patient Spider
Lines: 257
Message-ID: <tnj94q$3g4ga$1@dont-email.me>
References: <b6260f7b-fbeb-4549-8579-f12c76bc5b69n@googlegroups.com>
<tmtmlq$uo06$1@dont-email.me>
<45ecc365-c1f0-4bd8-b92a-4e50209095c7n@googlegroups.com>
<kM1lL.20158$iU59.5539@fx14.iad> <tn2u7j$288n$1@gal.iecc.com>
<bwnlL.106$%os8.36@fx03.iad>
<d3842b13-6457-4a7b-964d-ec0ce66447e2n@googlegroups.com>
<XuJlL.9383$MVg8.8632@fx12.iad> <tn9i9j$2g22f$1@dont-email.me>
<T44mL.71538$gGD7.48801@fx11.iad> <tnala2$2j5mv$1@dont-email.me>
<ffae19fc-caa4-47ce-b730-70389d9f8186n@googlegroups.com>
<tnba86$2kho9$1@dont-email.me>
<6d6de22f-53be-4275-aee4-44f6581ff0a4n@googlegroups.com>
<tnbvfc$2oj2d$1@dont-email.me>
<bc76d960-0863-49a8-8e72-0e44a684f4ben@googlegroups.com>
<tndv79$2tjj5$1@dont-email.me> <tneh34$v3a3$2@newsreader4.netcologne.de>
<tnfsud$35ara$1@dont-email.me> <tni4m0$11dpq$2@newsreader4.netcologne.de>
<tni610$3ddoh$1@dont-email.me>
<faeef2b7-22ab-41c9-a4a6-69505a6106fcn@googlegroups.com>
<tnia66$3dq9e$1@dont-email.me>
<13df9d3e-9ec4-4a01-a331-854eae3f5a2bn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 17 Dec 2022 02:22:18 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="5c367d0bde0003fcc6ce092943ec760e";
logging-data="3674634"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+xQB8eQEQg2/sVM5X2xp7K"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.6.0
Cancel-Lock: sha1:gmWBb2vbN1WzkfyvhQ/5UvSE5hU=
In-Reply-To: <13df9d3e-9ec4-4a01-a331-854eae3f5a2bn@googlegroups.com>
Content-Language: en-US
 by: BGB - Sat, 17 Dec 2022 02:21 UTC

On 12/16/2022 2:28 PM, MitchAlsup wrote:
> On Friday, December 16, 2022 at 11:34:01 AM UTC-6, BGB wrote:
>> On 12/16/2022 10:43 AM, MitchAlsup wrote:
>>> On Friday, December 16, 2022 at 10:23:00 AM UTC-6, BGB wrote:
>>>> On 12/16/2022 10:00 AM, Thomas Koenig wrote:
>>>>> BGB <cr8...@gmail.com> schrieb:
>>>>>> On 12/15/2022 1:07 AM, Thomas Koenig wrote:
>>>>>>> BGB <cr8...@gmail.com> schrieb:
>>>>>>>
>>>>>>> (argument list)
>>>>>>>
>>>>>>>> So, it looks like (looking at a few different programs):
>>>>>>>> 4: ~79.2%
>>>>>>>> 8: ~98.6%
>>>>>>>> 15: ~99.9%
>>>>>>>> 16: ~99.9%
>>>>>>>> 18: 100%
>>>>>>>
>>>>>>> Did you ever take a look at LAPACK, or CLAPACK? Those are _long_
>>>>>>> argument lists...
>>>>>>>
>>>>>>> For example, dgerfsx has 22 arguments (unless I miscounted) plus
>>>>>>> two hidden character length arguments.
>>>>>>
>>>>>> None of my code has quite that many.
>>>>>> The longest argument list currently is in my GLQuake port, mostly due to
>>>>>> an 18 argument function being used in TKRA-GL.
>>>>>>
>>>>>> But, I guess one could debate if there are many codebases which deviate
>>>>>> strongly from this, having a lot more long argument lists than short ones.
>>>>>>
>>>>>> Between Doom, ROTT, Quake, etc, specifics vary slightly, but the overall
>>>>>> pattern remains pretty similar.
>>>>>>
>>>>>> So, it seems like:
>>>>>> 8 will be sufficient "most of the time";
>>>>>> 16 is slightly better;
>>>>>> 24 or 32 would be needed to entirely eliminate the existence of stack
>>>>>> arguments.
>>>>>
>>>>> You don't have experience with other people using your compiler,
>>>>> I presume.
>>>>>
>>>>> If somebody puts an artificial limitation like that into a widely
>>>>> used ABI or compiler, then somebody out there will run across that
>>>>> limitation and post a bug report.
>>>>>
>>>>> Some people fuzz compilers as a hobby.
>>>> There are no hard limit on the number of arguments in BGBCC.
>>>>
>>> In My 66000 ABI there is a limit of 8 register passed arguments (and results)
>>> the rest are passed on the stack. An unconcerned programmer does not
>>> need to even see that there is a limit. The performance aware programmer
>>> will see higher performance with 8 or fewer arguments.
> <
>> The number of register arguments is limited by the ABI mode in question.
>> The total maximum number of arguments is unbounded.
>>
>>
>> I haven't yet settled on which ABI I will make the official ABI for XG2
>> mode.
>>
>>
>> While arguably "more register arguments is better", "more spill space is
>> not better". Burning 256 bytes of the stack (rather than 128 bytes) for
>> every non-leaf function seems to offset any gains from passing more
>> arguments in registers (since, as noted, more than 8 is uncommon; at
>> least for code using 64-bit pointers).
> <
> The amount of excess space on My 66000 stack is 0 bytes. The amount of
> space in local_data_area is "whatever the compiler wants". The compiler
> allocates 0 bytes that are not used.
> <
> As to "more is always better"; I am not so sure. With 8 registers used to pass
> arguments, and 16 (including FP and SP) preserved registers, there are 8
> freely used temporaries for leaf functions to "do stuff" without overhead.
> If you increased the register arguments to 16 without addressing the free
> temporaries, you end up having to save/restore some registers in order
> to "do stuff", and based on your statistics, these account for only 1.4%
> of subroutines.
> <

Probably true.

Though, should have been 128 vs 64, not 256 vs 128.

It would appear that 8 may be a better option than 16, even with 64 GPRs
(and ~ 30 usable scratch registers).

So, a small extra cost for 1.5% of functions (them needing to use stack
arguments past the first 8), may not be worth a relatively small cost
being paid by every other function (mostly in terms of bigger stack
frames reducing the effectiveness of the 9-bit load/store displacement).

This is since addressing is relative to the bottom of the stack, and
thus has to address over the callee's spill space and similar.

If the stack frame exceeds the range of a 9-bit displacement, this also
means a penalty for accessing any variables stored in the spill space,
since these may now require using a bigger displacement to cross the
stack frame (vs had they been stored along with the other local
variables and similar, in my case typically closer to the bottom of the
stack frame).

>>
>> This almost makes a stronger case for not providing any spill space.
> <
> Which I do not.

It varies a bit.

There seem to be two different camps for ABI design:

SysV style ABIs:
Typically no spill space;
Structures are passed by copying them in registers or on the stack;
(They often decompose structures into registers, ...)
...

Microsoft Style:
Typically provide a spill space,
usually equal to the number of register arguments;
Typically pass and return structures by reference;
...

I had noted that the official RISC-V ABI seems to follow SysV patterns.

MS seems to list a Machine ID for RISC-V in PE/COFF, but no ABI spec to
be found, so it is uncertain if they adopted the RISC-V ABI as-is or
have their own.

I have found exceptions to both patterns though:
SysV MIPS ABI has a spill space for arguments;
The MS ARMv8 ABI seems to follow SysV patterns;
( I am guessing they adopted ARM's ABI as-is?... )
...

I can note that the BJX2 ABI mostly follows patterns similar to the
Microsoft style ABIs.

Eg:
Spill space (in 64b/128b variants);
Structures passed by reference (if > 16B);
Struct return by copying to caller-supplied pointer (if > 16B);
...

>>>>
>>>> More, it is a case of avoiding stack arguments (entirely, if-possible)
>>>> is better for performance in a strictly in-order machine.
>>>>
>>>> As for the ABI, it is sort of like:
>>>> First 8 (or 16) arguments are passed in registers;
>>>> Any remaining arguments are passed on the stack.
>>>>
>>>> There is also a spill space for the register arguments (in the 64-bit
>>>> ABI), with the remaining arguments being after the spill space.
>>> <
>>> I worked out positions for the register and memory based arguments
>>> such that the stack has "no excess space allocated" and "you can concatenate"
>>> the register and memory spaces using ENTER--and indeed, this is how
>>> varargs works.
> <
>> I wanted to go over to a "you can naively spill the registers to the
>> stack and get back to a linear argument list like on x86" model.
> <
> While you can't do it naïvely, there is a straightforward way to achieve
> this goal of a vector of arguments for varargs--and in My 66000 you
> can achieve this at the cost of 0 extra instructions !

In the 8-arg case, it can be done with 4 MOV.X instructions.

>>
>> The original ABI did not do this, so the "va_list" structure is more of
>> a snapshot of all the argument registers followed by a pointer to the
>> first non-register argument (as was needed for the original ABI).
>>
> It is even worse with multiple register files.

Yeah.

>>
>> As noted, the design for my ABI was somewhat influenced by the Windows
>> X64 ABI (well, and also the Windows CE SH-4 ABI, from which it was also
>> partially derived).
>>
>> There was also the Hitachi ABI, and GCC's SH-4 ABI, where ironically all
>> were "similar but different", as even with the same ISA, seemingly no
>> two parties can agree as to what exactly the C ABI rules should be...
>>
>>
>> Would hope it would stay more consistent in my case, but seemingly I
>> can't agree with myself as to what exactly the C ABI rules should be in
>> some cases (hence why, annoyingly, the ABI has fragmented into
>> sub-variants).
> <
> Auld lang syne ?


Click here to read the complete article
Re: everything old is new again, Compare-and-branch vs PIC

<2284544e-4a9e-4577-9ec2-2b96416e1927n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:ad4:52e7:0:b0:4e1:bb55:1d8c with SMTP id p7-20020ad452e7000000b004e1bb551d8cmr1030812qvu.66.1671245893357;
Fri, 16 Dec 2022 18:58:13 -0800 (PST)
X-Received: by 2002:a05:6870:b94:b0:144:effa:8c0f with SMTP id
lg20-20020a0568700b9400b00144effa8c0fmr652528oab.167.1671245893144; Fri, 16
Dec 2022 18:58:13 -0800 (PST)
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, 16 Dec 2022 18:58:12 -0800 (PST)
In-Reply-To: <tnj94q$3g4ga$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:28e0:c682:421c:7069;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:28e0:c682:421c:7069
References: <b6260f7b-fbeb-4549-8579-f12c76bc5b69n@googlegroups.com>
<tmtmlq$uo06$1@dont-email.me> <45ecc365-c1f0-4bd8-b92a-4e50209095c7n@googlegroups.com>
<kM1lL.20158$iU59.5539@fx14.iad> <tn2u7j$288n$1@gal.iecc.com>
<bwnlL.106$%os8.36@fx03.iad> <d3842b13-6457-4a7b-964d-ec0ce66447e2n@googlegroups.com>
<XuJlL.9383$MVg8.8632@fx12.iad> <tn9i9j$2g22f$1@dont-email.me>
<T44mL.71538$gGD7.48801@fx11.iad> <tnala2$2j5mv$1@dont-email.me>
<ffae19fc-caa4-47ce-b730-70389d9f8186n@googlegroups.com> <tnba86$2kho9$1@dont-email.me>
<6d6de22f-53be-4275-aee4-44f6581ff0a4n@googlegroups.com> <tnbvfc$2oj2d$1@dont-email.me>
<bc76d960-0863-49a8-8e72-0e44a684f4ben@googlegroups.com> <tndv79$2tjj5$1@dont-email.me>
<tneh34$v3a3$2@newsreader4.netcologne.de> <tnfsud$35ara$1@dont-email.me>
<tni4m0$11dpq$2@newsreader4.netcologne.de> <tni610$3ddoh$1@dont-email.me>
<faeef2b7-22ab-41c9-a4a6-69505a6106fcn@googlegroups.com> <tnia66$3dq9e$1@dont-email.me>
<13df9d3e-9ec4-4a01-a331-854eae3f5a2bn@googlegroups.com> <tnj94q$3g4ga$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2284544e-4a9e-4577-9ec2-2b96416e1927n@googlegroups.com>
Subject: Re: everything old is new again, Compare-and-branch vs PIC
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Sat, 17 Dec 2022 02:58:13 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 4781
 by: MitchAlsup - Sat, 17 Dec 2022 02:58 UTC

On Friday, December 16, 2022 at 8:22:22 PM UTC-6, BGB wrote:
> On 12/16/2022 2:28 PM, MitchAlsup wrote:
>> There seem to be two different camps for ABI design:
>
> SysV style ABIs:
> Typically no spill space;
> Structures are passed by copying them in registers or on the stack;
> (They often decompose structures into registers, ...)
> ...
>
> Microsoft Style:
> Typically provide a spill space,
> usually equal to the number of register arguments;
> Typically pass and return structures by reference;
> ...
>
>
> I had noted that the official RISC-V ABI seems to follow SysV patterns.
<
MIPS has a spill space............And I see now that RISC-V has corrected that.......
>
snip
> > While you can't do it naïvely, there is a straightforward way to achieve
> > this goal of a vector of arguments for varargs--and in My 66000 you
> > can achieve this at the cost of 0 extra instructions !
<
> In the 8-arg case, it can be done with 4 MOV.X instructions.
<
Preserving some registers, and allocating a stack costs me 1 instruction.
<
ENTER R26,R0,#local_data_area_size
<
Pushing the register arguments, preserving some registers, and allocating
a stack still costs only 1 instruction !
<
ENTER R26,R9,#local_data_area_size
<
You do it in 4 more instructions, I do it in an already existing instruction.
>
>
> It seems though that in many cases, things are built around things that
> happened in the past, either their own lives, or by interpreting various
> texts and deriving rules from them, looking to various sources for
> precedent on which to base their decisions, ...
>
>
> But, when there is a line of development, then some patterns are likely
> to exist here. Like, if one tries to design some of their tech initially
> by trying to imitate stuff from, say, "Windows CE on a Sega Dreamcast",
> then things will tend to follow patterns.
>
> If one takes the ISA, and at first doubles, and then later doubles
> again, the number of CPU registers, the patterns may still hold.
>
> Say:
> R4..R7
> Became:
> R4..R7, R20..R23
> Becomes:
> R4..R7, R20..R23, R36..R39, R52..R55
<
This is why you have to get it right the first time.
>
> But, the stack pointer still remains awkwardly stuck at R15, as to move
> it basically causes everything else to fall apart.
>
Because they did not get it right the first time.
>

Re: everything old is new again, Compare-and-branch vs PIC

<tnjcto$3j6u4$1@dont-email.me>

  copy mid

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

  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: everything old is new again, Compare-and-branch vs PIC
Date: Fri, 16 Dec 2022 21:25:36 -0600
Organization: A noiseless patient Spider
Lines: 153
Message-ID: <tnjcto$3j6u4$1@dont-email.me>
References: <b6260f7b-fbeb-4549-8579-f12c76bc5b69n@googlegroups.com>
<kM1lL.20158$iU59.5539@fx14.iad> <tn2u7j$288n$1@gal.iecc.com>
<bwnlL.106$%os8.36@fx03.iad>
<d3842b13-6457-4a7b-964d-ec0ce66447e2n@googlegroups.com>
<XuJlL.9383$MVg8.8632@fx12.iad> <tn9i9j$2g22f$1@dont-email.me>
<T44mL.71538$gGD7.48801@fx11.iad> <tnala2$2j5mv$1@dont-email.me>
<ffae19fc-caa4-47ce-b730-70389d9f8186n@googlegroups.com>
<tnba86$2kho9$1@dont-email.me> <tni4fd$11dpq$1@newsreader4.netcologne.de>
<tD0nL.236093$GNG9.35152@fx18.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 17 Dec 2022 03:26:49 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="5c367d0bde0003fcc6ce092943ec760e";
logging-data="3775428"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18d6bG3d6v82TnOQ7wYLPxJ"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.6.0
Cancel-Lock: sha1:+xF7ZhKenoT8d//d+KrP//VDIRU=
In-Reply-To: <tD0nL.236093$GNG9.35152@fx18.iad>
Content-Language: en-US
 by: BGB - Sat, 17 Dec 2022 03:25 UTC

On 12/16/2022 10:01 AM, Scott Lurndal wrote:
> Thomas Koenig <tkoenig@netcologne.de> writes:
>> BGB <cr88192@gmail.com> schrieb:
>>
>>> Then again, I guess it was interesting to observe that some types of
>>> optimizations which help on BJX2 also help on x86-64, despite x86-64
>>> having not enough registers to actually make use of the optimization as
>>> expressed (x86-64 seems to be able to pretend as-if the stack
>>> spills/fills were registers).
>>
>> This is as old as optimizing compilers. The very first FORTRAN
>> compiler assumed that there was an infinite amount of index
>> registers, which it then later on assigned to the three that were
>> actually available.
>>

I was thinking more in the sense that it seems to behave as-if it could
load from memory into a register in 1 cycle, even if realistically this
should take ~ 4 cycles on x86-64.

Say, one x86-64, one can do a version of a piece of logic:
2 operations at a time, using 10 variables;
4 operations at a time, using 20 variables.

x86-64 has 16 registers, so one would expect the 10 variable version to
be faster than the 20 variable version. But, one may observe the 20
variable case is still faster.

Contrast, a lot of 90s era code seems to use small loops using as few
variables as possible to process one item at a time, which tends to be
slower (on both x86-64 and BJX2) than aggressively unrolling the loop
and doing a bunch of items in parallel (often using significantly more
working variables; and writing code that resembles ASM if written in C
syntax).

>>> Meanwhile, I am left needing to use lots of registers, and occasional
>>> optimizations which try to side-step a few (store then load) cases, then
>>> recently needing to fix a bug where one of these optimizations broke due
>>> to a type-handling issue in my compiler (was using the type of the value
>>> stored to an array, rather than the type of the value as loaded from the
>>> array).
>>
>> Did you actually look at optimizing register allocation algorithms?
>> http://web.cecs.pdx.edu/~mperkows/temp/register-allocation.pdf is one
>> of the first search results that Google (well, Startpage) returns.
>> You should really look into graph coloring.
>
> I'd recommend starting with the Dragon book, which discusses register
> allocation fairly extensively, in multiple contexts.

I had just sort of came up with something over time.

Might need to look into some more stuff...

In my compilers, I mostly used fairly simple/naive strategy:
Maintain a list of "live" variables;
If a variable is accessed, and not in the list, add it to list and load
it from memory (if used as a source variable);
If no free spots in the list, find something to evict (LRU style);
Write all non-statically-assigned dirty variables back to memory at the
end of the basic block (and set their entries back to empty).

So, variables will typically be loaded each time when they are first
used, with a blob of stack spills at the end of the block.

The demand-loaded variables often come with a 3-cycle or so penalty (to
avoid this requires loading them before they are used).

Though, not particularly optimal, attempts to improve on this have not
generally been successful (either making things worse, or causing the
program to break).

A lot of my JITs also used this strategy, just working on "traces".

Then, with a few options:
The N most-used variables get assigned to the first N spots in the list
for the entire function;
If we have more registers than variables (both locals and temporaries),
everything gets static-assigned.

Performance is generally better when more of the variables can be
static-assigned.

Say, if you have 30 callee-saved registers and 20 variables, well then,
every variable can get its own register for the scope of the function,
and the spill-and-fill disappears (at least for local variables and
similar).

Even if not perfect, it still seems better than the "-O0" or "/O0"
strategies in GCC and MSVC, which do everything as "Load; Load; Op; Store".

But, yeah, by "-O1" or "-O2" GCC's code generation tends to somewhat
beat my compiler on this front (or even MSVC's).

But, yeah, I have noted that other compilers tend to be more effective here.

The WEXifier can try to help (by trying to shuffle the instructions
around after-the-fact; in machine-code form), but its effectiveness is
in turn limited (and having lots of registers and giving every variable
its own register makes the WEXifier's job easier, vs trying to reuse
registers within the basic-block; but avoiding register reuse within a
block does increase register pressure slightly).

There are also high level transforms, like say:
foo->x = a;
foo->y = b;
...
c = foo->x + foo->y;
One might be tempted to try to transform the last expression to:
c = a + b;

But, a bunch of extra checks are needed to try to exclude cases where
this is not valid (such as a depended-on variable being modified, ...).

And, as noted, the 'foo->x' still needs to return the type of 'foo->x'
and not the type of 'a'.

This transform was generally being done in the front-end in this case
(where bugs here were changing the types "as seen by the C code").

This mapping was being done with a sort of lookup table operating mostly
at the level of local variables (and "reducing" expressions in terms of
AST nodes).

In a few of my past languages (namely the original BGBScript), a similar
strategy was also used for type-inference (before later switching
primarily to explicit declared types); and also for constant-propagation.

Say:
a=3;
b=4;
c=a+b;
And the compiler realizes it can rewrite the last expression to:
c=7;

This strategy was also generally limited to a single basic-block at a
time (the contents of the table being "forgotten" at the end of each block).

....

Re: everything old is new again, Compare-and-branch vs PIC

<tnjhhg$3jfse$1@dont-email.me>

  copy mid

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

  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: everything old is new again, Compare-and-branch vs PIC
Date: Fri, 16 Dec 2022 22:44:25 -0600
Organization: A noiseless patient Spider
Lines: 155
Message-ID: <tnjhhg$3jfse$1@dont-email.me>
References: <b6260f7b-fbeb-4549-8579-f12c76bc5b69n@googlegroups.com>
<kM1lL.20158$iU59.5539@fx14.iad> <tn2u7j$288n$1@gal.iecc.com>
<bwnlL.106$%os8.36@fx03.iad>
<d3842b13-6457-4a7b-964d-ec0ce66447e2n@googlegroups.com>
<XuJlL.9383$MVg8.8632@fx12.iad> <tn9i9j$2g22f$1@dont-email.me>
<T44mL.71538$gGD7.48801@fx11.iad> <tnala2$2j5mv$1@dont-email.me>
<ffae19fc-caa4-47ce-b730-70389d9f8186n@googlegroups.com>
<tnba86$2kho9$1@dont-email.me>
<6d6de22f-53be-4275-aee4-44f6581ff0a4n@googlegroups.com>
<tnbvfc$2oj2d$1@dont-email.me>
<bc76d960-0863-49a8-8e72-0e44a684f4ben@googlegroups.com>
<tndv79$2tjj5$1@dont-email.me> <tneh34$v3a3$2@newsreader4.netcologne.de>
<tnfsud$35ara$1@dont-email.me> <tni4m0$11dpq$2@newsreader4.netcologne.de>
<tni610$3ddoh$1@dont-email.me>
<faeef2b7-22ab-41c9-a4a6-69505a6106fcn@googlegroups.com>
<tnia66$3dq9e$1@dont-email.me>
<13df9d3e-9ec4-4a01-a331-854eae3f5a2bn@googlegroups.com>
<tnj94q$3g4ga$1@dont-email.me>
<2284544e-4a9e-4577-9ec2-2b96416e1927n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 17 Dec 2022 04:45:36 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="5c367d0bde0003fcc6ce092943ec760e";
logging-data="3784590"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+J0zBYZbiuCFi2qZINjCzK"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.6.0
Cancel-Lock: sha1:OvSwv0IryLCRDLKS71yk2szkQ3I=
Content-Language: en-US
In-Reply-To: <2284544e-4a9e-4577-9ec2-2b96416e1927n@googlegroups.com>
 by: BGB - Sat, 17 Dec 2022 04:44 UTC

On 12/16/2022 8:58 PM, MitchAlsup wrote:
> On Friday, December 16, 2022 at 8:22:22 PM UTC-6, BGB wrote:
>> On 12/16/2022 2:28 PM, MitchAlsup wrote:
>>> There seem to be two different camps for ABI design:
>>
>> SysV style ABIs:
>> Typically no spill space;
>> Structures are passed by copying them in registers or on the stack;
>> (They often decompose structures into registers, ...)
>> ...
>>
>> Microsoft Style:
>> Typically provide a spill space,
>> usually equal to the number of register arguments;
>> Typically pass and return structures by reference;
>> ...
>>
>>
>> I had noted that the official RISC-V ABI seems to follow SysV patterns.
> <
> MIPS has a spill space............And I see now that RISC-V has corrected that.......

But, not found any clear information as to why a spill space is either
good or bad (apart from the issue of not scaling up very well by putting
more strain on the displacement distance).

Effect on performance either way seems to be fairly small, though it
does seem to effect code density.

For things like trying to wrangle function argument lists across an RPC
mechanism, the spill-space makes things easier.

Some descriptions of the Windows X64 ABI also made a case for why
spill-space was a good thing.

I have ABI variants both with and without a spill-space.
Was using the "no spill space" variant for code built with
"sizeof(void*)==4".

>>
> snip
>>> While you can't do it naïvely, there is a straightforward way to achieve
>>> this goal of a vector of arguments for varargs--and in My 66000 you
>>> can achieve this at the cost of 0 extra instructions !
> <
>> In the 8-arg case, it can be done with 4 MOV.X instructions.
> <
> Preserving some registers, and allocating a stack costs me 1 instruction.
> <
> ENTER R26,R0,#local_data_area_size
> <
> Pushing the register arguments, preserving some registers, and allocating
> a stack still costs only 1 instruction !
> <
> ENTER R26,R9,#local_data_area_size
> <
> You do it in 4 more instructions, I do it in an already existing instruction.

I don't have fancy instructions here.

I have MOV.X and ADD and similar...

Say:
MOV LR, R18
MOV GBR, R19
ADD -128, SP
MOV.X R18, (SP, 112)
MOV.X R8, (SP, 64)
MOV.X R10, (SP, 80)
MOV.X R12, (SP, 96)
...

If I were doing it again, might want LR and GBR in GPR space, so that I
could use MOV.X to store and reload them directly.

>>
>>
>> It seems though that in many cases, things are built around things that
>> happened in the past, either their own lives, or by interpreting various
>> texts and deriving rules from them, looking to various sources for
>> precedent on which to base their decisions, ...
>>
>>
>> But, when there is a line of development, then some patterns are likely
>> to exist here. Like, if one tries to design some of their tech initially
>> by trying to imitate stuff from, say, "Windows CE on a Sega Dreamcast",
>> then things will tend to follow patterns.
>>
>> If one takes the ISA, and at first doubles, and then later doubles
>> again, the number of CPU registers, the patterns may still hold.
>>
>> Say:
>> R4..R7
>> Became:
>> R4..R7, R20..R23
>> Becomes:
>> R4..R7, R20..R23, R36..R39, R52..R55
> <
> This is why you have to get it right the first time.

Whole thing started out with 16 registers, then doubled it twice.
No obvious "better" option than to repeat the existing pattern 2 or 4 times.

The strategy does allow one to determine if a register is callee saved
fairly easily:
if(regID&8)
{ callee-saved }
else
{ scratch }

Except for a few special cases.

With argument registers following a pattern:
zz01zz

A lot of other ISA's will require using ad-hoc lookup tables here.

>>
>> But, the stack pointer still remains awkwardly stuck at R15, as to move
>> it basically causes everything else to fall apart.
>>
> Because they did not get it right the first time.
>>
>

Yeah, there are reasons a lot of my considered full-ISA redesigns had
things like, say:
R0=ZR/PC (ZR|PC depends on context)
R1=LR
R2=SP
R3=GBR

But, XG2 was not a sufficient redesign for me to consider this, so XG2
keeps using the existing BJX2 register map (it is essentially being
treated more like an alt-mode encoding scheme rather than an entirely
separate ISA).

Though, strictly speaking, there is not a whole lot left in XG2 (at the
level of encoding or semantics) that actually cares which register is
being used as the stack pointer (most of this was in the 16-bit ops with
hard-wired implicit registers, which are N/E in XG2 mode).

Though, in the near term, this is unlikely to change short of other
architectural changes.

....

Re: everything old is new again, Compare-and-branch vs PIC

<tnjjot$3jkdi$1@dont-email.me>

  copy mid

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

  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: everything old is new again, Compare-and-branch vs PIC
Date: Fri, 16 Dec 2022 23:22:30 -0600
Organization: A noiseless patient Spider
Lines: 65
Message-ID: <tnjjot$3jkdi$1@dont-email.me>
References: <b6260f7b-fbeb-4549-8579-f12c76bc5b69n@googlegroups.com>
<tmtmlq$uo06$1@dont-email.me>
<45ecc365-c1f0-4bd8-b92a-4e50209095c7n@googlegroups.com>
<kM1lL.20158$iU59.5539@fx14.iad> <tn2u7j$288n$1@gal.iecc.com>
<bwnlL.106$%os8.36@fx03.iad>
<d3842b13-6457-4a7b-964d-ec0ce66447e2n@googlegroups.com>
<XuJlL.9383$MVg8.8632@fx12.iad> <tn9i9j$2g22f$1@dont-email.me>
<T44mL.71538$gGD7.48801@fx11.iad> <tnala2$2j5mv$1@dont-email.me>
<ffae19fc-caa4-47ce-b730-70389d9f8186n@googlegroups.com>
<tnba86$2kho9$1@dont-email.me> <tni4fd$11dpq$1@newsreader4.netcologne.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 17 Dec 2022 05:23:41 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="5c367d0bde0003fcc6ce092943ec760e";
logging-data="3789234"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/7pxS4Cb7RA86RtVgCddXq"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.6.0
Cancel-Lock: sha1:qBoEf05JvcPyc1TiCLTnuBvxDdo=
Content-Language: en-US
In-Reply-To: <tni4fd$11dpq$1@newsreader4.netcologne.de>
 by: BGB - Sat, 17 Dec 2022 05:22 UTC

On 12/16/2022 9:56 AM, Thomas Koenig wrote:
> BGB <cr88192@gmail.com> schrieb:
>
>> Then again, I guess it was interesting to observe that some types of
>> optimizations which help on BJX2 also help on x86-64, despite x86-64
>> having not enough registers to actually make use of the optimization as
>> expressed (x86-64 seems to be able to pretend as-if the stack
>> spills/fills were registers).
>
> This is as old as optimizing compilers. The very first FORTRAN
> compiler assumed that there was an infinite amount of index
> registers, which it then later on assigned to the three that were
> actually available.
>
>> Meanwhile, I am left needing to use lots of registers, and occasional
>> optimizations which try to side-step a few (store then load) cases, then
>> recently needing to fix a bug where one of these optimizations broke due
>> to a type-handling issue in my compiler (was using the type of the value
>> stored to an array, rather than the type of the value as loaded from the
>> array).
>
> Did you actually look at optimizing register allocation algorithms?
> http://web.cecs.pdx.edu/~mperkows/temp/register-allocation.pdf is one
> of the first search results that Google (well, Startpage) returns.
> You should really look into graph coloring.

Looks some at the linked PDF.

Yeah, BGBCC doesn't do anything like this.

Only two levels:
Within a given basic-block;
Or, global for the whole function.

Would have to figure out how to try to glue on something like graph
coloring, seems like a more advanced type of optimization than most of
the stuff I had been doing...

And, well, the "maybe stupid" assumption that if one typically has more
registers in the ISA than local variables and temporaries in the
function, they can static-assign everything and mostly sweep the
register-allocation issues under the carpet.

Well, pros/cons...

There are also issues, like trying to weed out the sources that are
generating a bunch of spurious (and frivolous) RegReg MOVs (one can fix
them in one case, and find more frivolous MOVs somewhere else, or a
bunch of otherwise unnecessary sign or zero extension operations, ...).

Then again, I guess it remains as an open question of what performance
would look like if my optimizer didn't suck...

Then again, I guess no one is claiming that writing a "good quality" C
compiler is particularly fast or easy (getting something that "sorta
works" hacked together isn't too bad; getting it to generate decent
quality output and relatively bug-free is a whole different issue).

....

Re: everything old is new again, Compare-and-branch vs PIC

<ca4b34f5-9401-42a4-a1bf-ef7f8fe6b57dn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:ad4:43eb:0:b0:4bb:7ad8:deae with SMTP id f11-20020ad443eb000000b004bb7ad8deaemr71357044qvu.92.1671266985318;
Sat, 17 Dec 2022 00:49:45 -0800 (PST)
X-Received: by 2002:a05:6870:698b:b0:148:2c02:5323 with SMTP id
my11-20020a056870698b00b001482c025323mr1639370oab.298.1671266985083; Sat, 17
Dec 2022 00:49:45 -0800 (PST)
Path: i2pn2.org!i2pn.org!news.swapon.de!2.eu.feeder.erje.net!feeder.erje.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: Sat, 17 Dec 2022 00:49:44 -0800 (PST)
In-Reply-To: <tnjjot$3jkdi$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=99.251.79.92; posting-account=QId4bgoAAABV4s50talpu-qMcPp519Eb
NNTP-Posting-Host: 99.251.79.92
References: <b6260f7b-fbeb-4549-8579-f12c76bc5b69n@googlegroups.com>
<tmtmlq$uo06$1@dont-email.me> <45ecc365-c1f0-4bd8-b92a-4e50209095c7n@googlegroups.com>
<kM1lL.20158$iU59.5539@fx14.iad> <tn2u7j$288n$1@gal.iecc.com>
<bwnlL.106$%os8.36@fx03.iad> <d3842b13-6457-4a7b-964d-ec0ce66447e2n@googlegroups.com>
<XuJlL.9383$MVg8.8632@fx12.iad> <tn9i9j$2g22f$1@dont-email.me>
<T44mL.71538$gGD7.48801@fx11.iad> <tnala2$2j5mv$1@dont-email.me>
<ffae19fc-caa4-47ce-b730-70389d9f8186n@googlegroups.com> <tnba86$2kho9$1@dont-email.me>
<tni4fd$11dpq$1@newsreader4.netcologne.de> <tnjjot$3jkdi$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ca4b34f5-9401-42a4-a1bf-ef7f8fe6b57dn@googlegroups.com>
Subject: Re: everything old is new again, Compare-and-branch vs PIC
From: robfi...@gmail.com (robf...@gmail.com)
Injection-Date: Sat, 17 Dec 2022 08:49:45 +0000
Content-Type: text/plain; charset="UTF-8"
 by: robf...@gmail.com - Sat, 17 Dec 2022 08:49 UTC

On Saturday, December 17, 2022 at 12:23:44 AM UTC-5, BGB wrote:
> On 12/16/2022 9:56 AM, Thomas Koenig wrote:
> > BGB <cr8...@gmail.com> schrieb:
> >
> >> Then again, I guess it was interesting to observe that some types of
> >> optimizations which help on BJX2 also help on x86-64, despite x86-64
> >> having not enough registers to actually make use of the optimization as
> >> expressed (x86-64 seems to be able to pretend as-if the stack
> >> spills/fills were registers).
> >
> > This is as old as optimizing compilers. The very first FORTRAN
> > compiler assumed that there was an infinite amount of index
> > registers, which it then later on assigned to the three that were
> > actually available.
> >
> >> Meanwhile, I am left needing to use lots of registers, and occasional
> >> optimizations which try to side-step a few (store then load) cases, then
> >> recently needing to fix a bug where one of these optimizations broke due
> >> to a type-handling issue in my compiler (was using the type of the value
> >> stored to an array, rather than the type of the value as loaded from the
> >> array).
> >
> > Did you actually look at optimizing register allocation algorithms?
> > http://web.cecs.pdx.edu/~mperkows/temp/register-allocation.pdf is one
> > of the first search results that Google (well, Startpage) returns.
> > You should really look into graph coloring.
> Looks some at the linked PDF.
>
> Yeah, BGBCC doesn't do anything like this.
>
> Only two levels:
> Within a given basic-block;
> Or, global for the whole function.
>
> Would have to figure out how to try to glue on something like graph
> coloring, seems like a more advanced type of optimization than most of
> the stuff I had been doing...
>
>
> And, well, the "maybe stupid" assumption that if one typically has more
> registers in the ISA than local variables and temporaries in the
> function, they can static-assign everything and mostly sweep the
> register-allocation issues under the carpet.
>
> Well, pros/cons...
>
>
> There are also issues, like trying to weed out the sources that are
> generating a bunch of spurious (and frivolous) RegReg MOVs (one can fix
> them in one case, and find more frivolous MOVs somewhere else, or a
> bunch of otherwise unnecessary sign or zero extension operations, ...).
>
>
> Then again, I guess it remains as an open question of what performance
> would look like if my optimizer didn't suck...
>
>
> Then again, I guess no one is claiming that writing a "good quality" C
> compiler is particularly fast or easy (getting something that "sorta
> works" hacked together isn't too bad; getting it to generate decent
> quality output and relatively bug-free is a whole different issue).
>
>
> ...
Yes. I came to realize that compilers are quite an undertaking. I only work
on the compiler periodically now, preferring to use VBCC. Had a look at
GCC and LLVM.

Here is another link on color-graphing. I spent quite a bit of time reading and
re-reading this until I was able to come up with a yet to get working properly
color graphing allocator for my compiler. I think there are issues with register
spills and reloads. Then I found out that if there are enough registers > 16
maybe color graphing is not so necessary.

https://www.cs.utexas.edu/users/mckinley/380C/lecs/briggs-thesis-1992.pdf

I believe a linear scan allocator is another common allocator.

I have the code for the allocator in my Github account. It is quite complex,
written in c++.

The allocator I currently use simply counts register usages, giving more counts
for registers used in a loop. And prioritizes register allocations that way.

Re: everything old is new again, Compare-and-branch vs PIC

<c9ab3b1e-d500-4446-83a8-eb3818b84809n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:622a:91:b0:3a8:9c5:8698 with SMTP id o17-20020a05622a009100b003a809c58698mr1419336qtw.18.1671267526329;
Sat, 17 Dec 2022 00:58:46 -0800 (PST)
X-Received: by 2002:a9d:5913:0:b0:65b:ce9d:197e with SMTP id
t19-20020a9d5913000000b0065bce9d197emr38987854oth.167.1671267526073; Sat, 17
Dec 2022 00:58:46 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!feeder.erje.net!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Sat, 17 Dec 2022 00:58:45 -0800 (PST)
In-Reply-To: <ca4b34f5-9401-42a4-a1bf-ef7f8fe6b57dn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=99.251.79.92; posting-account=QId4bgoAAABV4s50talpu-qMcPp519Eb
NNTP-Posting-Host: 99.251.79.92
References: <b6260f7b-fbeb-4549-8579-f12c76bc5b69n@googlegroups.com>
<tmtmlq$uo06$1@dont-email.me> <45ecc365-c1f0-4bd8-b92a-4e50209095c7n@googlegroups.com>
<kM1lL.20158$iU59.5539@fx14.iad> <tn2u7j$288n$1@gal.iecc.com>
<bwnlL.106$%os8.36@fx03.iad> <d3842b13-6457-4a7b-964d-ec0ce66447e2n@googlegroups.com>
<XuJlL.9383$MVg8.8632@fx12.iad> <tn9i9j$2g22f$1@dont-email.me>
<T44mL.71538$gGD7.48801@fx11.iad> <tnala2$2j5mv$1@dont-email.me>
<ffae19fc-caa4-47ce-b730-70389d9f8186n@googlegroups.com> <tnba86$2kho9$1@dont-email.me>
<tni4fd$11dpq$1@newsreader4.netcologne.de> <tnjjot$3jkdi$1@dont-email.me> <ca4b34f5-9401-42a4-a1bf-ef7f8fe6b57dn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c9ab3b1e-d500-4446-83a8-eb3818b84809n@googlegroups.com>
Subject: Re: everything old is new again, Compare-and-branch vs PIC
From: robfi...@gmail.com (robf...@gmail.com)
Injection-Date: Sat, 17 Dec 2022 08:58:46 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 85
 by: robf...@gmail.com - Sat, 17 Dec 2022 08:58 UTC

On Saturday, December 17, 2022 at 3:49:46 AM UTC-5, robf...@gmail.com wrote:
> On Saturday, December 17, 2022 at 12:23:44 AM UTC-5, BGB wrote:
> > On 12/16/2022 9:56 AM, Thomas Koenig wrote:
> > > BGB <cr8...@gmail.com> schrieb:
> > >
> > >> Then again, I guess it was interesting to observe that some types of
> > >> optimizations which help on BJX2 also help on x86-64, despite x86-64
> > >> having not enough registers to actually make use of the optimization as
> > >> expressed (x86-64 seems to be able to pretend as-if the stack
> > >> spills/fills were registers).
> > >
> > > This is as old as optimizing compilers. The very first FORTRAN
> > > compiler assumed that there was an infinite amount of index
> > > registers, which it then later on assigned to the three that were
> > > actually available.
> > >
> > >> Meanwhile, I am left needing to use lots of registers, and occasional
> > >> optimizations which try to side-step a few (store then load) cases, then
> > >> recently needing to fix a bug where one of these optimizations broke due
> > >> to a type-handling issue in my compiler (was using the type of the value
> > >> stored to an array, rather than the type of the value as loaded from the
> > >> array).
> > >
> > > Did you actually look at optimizing register allocation algorithms?
> > > http://web.cecs.pdx.edu/~mperkows/temp/register-allocation.pdf is one
> > > of the first search results that Google (well, Startpage) returns.
> > > You should really look into graph coloring.
> > Looks some at the linked PDF.
> >
> > Yeah, BGBCC doesn't do anything like this.
> >
> > Only two levels:
> > Within a given basic-block;
> > Or, global for the whole function.
> >
> > Would have to figure out how to try to glue on something like graph
> > coloring, seems like a more advanced type of optimization than most of
> > the stuff I had been doing...
> >
> >
> > And, well, the "maybe stupid" assumption that if one typically has more
> > registers in the ISA than local variables and temporaries in the
> > function, they can static-assign everything and mostly sweep the
> > register-allocation issues under the carpet.
> >
> > Well, pros/cons...
> >
> >
> > There are also issues, like trying to weed out the sources that are
> > generating a bunch of spurious (and frivolous) RegReg MOVs (one can fix
> > them in one case, and find more frivolous MOVs somewhere else, or a
> > bunch of otherwise unnecessary sign or zero extension operations, ...).
> >
> >
> > Then again, I guess it remains as an open question of what performance
> > would look like if my optimizer didn't suck...
> >
> >
> > Then again, I guess no one is claiming that writing a "good quality" C
> > compiler is particularly fast or easy (getting something that "sorta
> > works" hacked together isn't too bad; getting it to generate decent
> > quality output and relatively bug-free is a whole different issue).
> >
> >
> > ...
> Yes. I came to realize that compilers are quite an undertaking. I only work
> on the compiler periodically now, preferring to use VBCC. Had a look at
> GCC and LLVM.
>
> Here is another link on color-graphing. I spent quite a bit of time reading and
> re-reading this until I was able to come up with a yet to get working properly
> color graphing allocator for my compiler. I think there are issues with register
> spills and reloads. Then I found out that if there are enough registers > 16
> maybe color graphing is not so necessary.
>
> https://www.cs.utexas.edu/users/mckinley/380C/lecs/briggs-thesis-1992.pdf
>
> I believe a linear scan allocator is another common allocator.
>
> I have the code for the allocator in my Github account. It is quite complex,
> written in c++.
>
> The allocator I currently use simply counts register usages, giving more counts
> for registers used in a loop. And prioritizes register allocations that way.

That should be expression usages.

Re: everything old is new again, Compare-and-branch vs PIC

<86r0wy2ib6.fsf@linuxsc.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: tr.17...@z991.linuxsc.com (Tim Rentsch)
Newsgroups: comp.arch
Subject: Re: everything old is new again, Compare-and-branch vs PIC
Date: Sat, 17 Dec 2022 06:53:01 -0800
Organization: A noiseless patient Spider
Lines: 37
Message-ID: <86r0wy2ib6.fsf@linuxsc.com>
References: <b6260f7b-fbeb-4549-8579-f12c76bc5b69n@googlegroups.com> <tmtmlq$uo06$1@dont-email.me> <45ecc365-c1f0-4bd8-b92a-4e50209095c7n@googlegroups.com> <kM1lL.20158$iU59.5539@fx14.iad> <tn2u7j$288n$1@gal.iecc.com> <bwnlL.106$%os8.36@fx03.iad> <d3842b13-6457-4a7b-964d-ec0ce66447e2n@googlegroups.com> <XuJlL.9383$MVg8.8632@fx12.iad> <tn9i9j$2g22f$1@dont-email.me> <T44mL.71538$gGD7.48801@fx11.iad> <tnala2$2j5mv$1@dont-email.me> <ffae19fc-caa4-47ce-b730-70389d9f8186n@googlegroups.com> <tnba86$2kho9$1@dont-email.me> <6d6de22f-53be-4275-aee4-44f6581ff0a4n@googlegroups.com> <86zgbo3eb3.fsf@linuxsc.com> <tnfeme$itl$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: reader01.eternal-september.org; posting-host="a7390d2b9babc69179e57407282135b6";
logging-data="3869254"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18vuw/z6xVJ6VdZn/cm3DF7qn5THFnnIO0="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:fzImUEwdibigrYUmt29oGXH1PQY=
sha1:UCxT3SgmPqAMqLgLB0g0sLkFXCY=
 by: Tim Rentsch - Sat, 17 Dec 2022 14:53 UTC

Terje Mathisen <terje.mathisen@tmsw.no> writes:

> Tim Rentsch wrote:
>
>> MitchAlsup <MitchAlsup@aol.com> writes:
>>
>> [...]
>>
>>> There was a recent poll on some site and 56% of Americans do not
>>> think that Arabic numerals should be taught in schools, too; and
>>> 15% don't have an opinion.
>>> https://www.snopes.com/fact-check/teaching-arabic-numerals/
>>> We are well on the way to Idiocracy.
>>
>> That isn't idiocy; it's illiteracy. Those aren't the same thing.
>> Don't make the mistake of thinking someone is stupid when all they
>> are is ignorant.
>
> I was going to agree with you, but realized that "willful ignorance"
> cannot be as easily (if ever?) forgiven.

My comment is about people who happen to be ignorant, not about
people who choose to remain ignorant.

Furthermore, it is still the case that one shouldn't _assume_ that
someone is stupid just because they are ignorant. If later
information shows signs of willful ignorance, the question of
intelligence can always be revisited (or even just visited).

Note by the way that most of the people responding to this survey
probably didn't choose to be ignorant of the essential fact that
our number symbols are indeed Arabic numerals. And it isn't
obvious that including that bit of knowledge in the educational
curriculum would yield any significant benefit. It's more
important to teach people how to think than to fill their heads
with zillions of miscellaneous facts (and it's disappointing that
this basic truth is not more widely recognized).

Re: everything old is new again, Compare-and-branch vs PIC

<86ilia2ftu.fsf@linuxsc.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: tr.17...@z991.linuxsc.com (Tim Rentsch)
Newsgroups: comp.arch
Subject: Re: everything old is new again, Compare-and-branch vs PIC
Date: Sat, 17 Dec 2022 07:46:37 -0800
Organization: A noiseless patient Spider
Lines: 32
Message-ID: <86ilia2ftu.fsf@linuxsc.com>
References: <b6260f7b-fbeb-4549-8579-f12c76bc5b69n@googlegroups.com> <d3842b13-6457-4a7b-964d-ec0ce66447e2n@googlegroups.com> <XuJlL.9383$MVg8.8632@fx12.iad> <tn9i9j$2g22f$1@dont-email.me> <T44mL.71538$gGD7.48801@fx11.iad> <tnala2$2j5mv$1@dont-email.me> <ffae19fc-caa4-47ce-b730-70389d9f8186n@googlegroups.com> <tnba86$2kho9$1@dont-email.me> <6d6de22f-53be-4275-aee4-44f6581ff0a4n@googlegroups.com> <tnbvfc$2oj2d$1@dont-email.me> <bc76d960-0863-49a8-8e72-0e44a684f4ben@googlegroups.com> <2022Dec15.111358@mips.complang.tuwien.ac.at> <tnfk0i$34fll$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: reader01.eternal-september.org; posting-host="a7390d2b9babc69179e57407282135b6";
logging-data="3881650"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+1RpA3Z6FxGEJJJ0DQKg3R5777KV2TmVQ="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:EOm4VDps92OVrBqZHkmje6EaQaA=
sha1:MWo7MEI+2DomSsk/cx0Xr5ITwKY=
 by: Tim Rentsch - Sat, 17 Dec 2022 15:46 UTC

BGB <cr88192@gmail.com> writes:

> On 12/15/2022 4:13 AM, Anton Ertl wrote:
>
>> MitchAlsup <MitchAlsup@aol.com> writes:
>>
>>> Had your base port been from LLVM instead of GCC this likely would not
>>> have happened.
>>> GCC is more of a K&R (anything goes) while LLVM is more of a C-done-right
>>> (ADA-style)
>>
>> On what evidence do you base this claim?
>>
>> And why would "C-done-right" be "ADA-style"? My take on C done right
>> is that a compiler maintains backwards compatibility with earlier
>> versions, while others think that C done right punishes the sinners
>> who write code that performs undefined behaviour as much as possible
>> by compiling it to unintended code (best even if there is no
>> performance advantage to that). I don't have Ada experience, but the
>> general image is compile-time errors and run-time errors; I would not
>> expect the latter from GCC or Clang.
>>
>> What I have experienced from Clang is that a common bit-rotation idiom
>> is compiled to 0 for rot(x,0) (for variable x) without compile-time or
>> run-time warning or error, because it exercises undefined behaviour
>> for a rotation count of 0, while gcc produced the intended behaviour.
>
> Yeah. Both GCC and LLVM are playing fast and loose with C semantics.

The construct in question is undefined behavior. You may not
like what GCC and LLVM do with it, but they are not in any
way shape or form violating C semantics.

Re: everything old is new again, Compare-and-branch vs PIC

<9f245614-3829-4482-9e89-2946937e210cn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:6214:192a:b0:4c7:4ec8:d616 with SMTP id es10-20020a056214192a00b004c74ec8d616mr23290235qvb.55.1671292400101;
Sat, 17 Dec 2022 07:53:20 -0800 (PST)
X-Received: by 2002:a05:6870:ebc3:b0:13c:97e9:5d40 with SMTP id
cr3-20020a056870ebc300b0013c97e95d40mr1099696oab.42.1671292399651; Sat, 17
Dec 2022 07:53:19 -0800 (PST)
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: Sat, 17 Dec 2022 07:53:19 -0800 (PST)
In-Reply-To: <tnjcto$3j6u4$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:f085:9c8:5c:6dd3;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:f085:9c8:5c:6dd3
References: <b6260f7b-fbeb-4549-8579-f12c76bc5b69n@googlegroups.com>
<kM1lL.20158$iU59.5539@fx14.iad> <tn2u7j$288n$1@gal.iecc.com>
<bwnlL.106$%os8.36@fx03.iad> <d3842b13-6457-4a7b-964d-ec0ce66447e2n@googlegroups.com>
<XuJlL.9383$MVg8.8632@fx12.iad> <tn9i9j$2g22f$1@dont-email.me>
<T44mL.71538$gGD7.48801@fx11.iad> <tnala2$2j5mv$1@dont-email.me>
<ffae19fc-caa4-47ce-b730-70389d9f8186n@googlegroups.com> <tnba86$2kho9$1@dont-email.me>
<tni4fd$11dpq$1@newsreader4.netcologne.de> <tD0nL.236093$GNG9.35152@fx18.iad> <tnjcto$3j6u4$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9f245614-3829-4482-9e89-2946937e210cn@googlegroups.com>
Subject: Re: everything old is new again, Compare-and-branch vs PIC
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Sat, 17 Dec 2022 15:53:20 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3990
 by: MitchAlsup - Sat, 17 Dec 2022 15:53 UTC

On Friday, December 16, 2022 at 9:26:52 PM UTC-6, BGB wrote:
> On 12/16/2022 10:01 AM, Scott Lurndal wrote:
> > Thomas Koenig <tko...@netcologne.de> writes:
> >> BGB <cr8...@gmail.com> schrieb:
> >>
> >>> Then again, I guess it was interesting to observe that some types of
> >>> optimizations which help on BJX2 also help on x86-64, despite x86-64
> >>> having not enough registers to actually make use of the optimization as
> >>> expressed (x86-64 seems to be able to pretend as-if the stack
> >>> spills/fills were registers).
> >>
> >> This is as old as optimizing compilers. The very first FORTRAN
> >> compiler assumed that there was an infinite amount of index
> >> registers, which it then later on assigned to the three that were
> >> actually available.
> >>
> I was thinking more in the sense that it seems to behave as-if it could
> load from memory into a register in 1 cycle, even if realistically this
> should take ~ 4 cycles on x86-64.
>
One can organize a pipeline such that inbound memory access appears
to take no cycles at all. Fetch-Decode-AGEN-LDAlign-Calculate-WriteBack.
Memory reference instructions are presented to the cache (or memory
pipeline in order) memory is accessed, aligned and then made available
to some calculation instruction as an operand, writeback can send the result
of the calculation into the cache (ST) as required.
<
I have called this the 360 pipeline <organization> in the past. One could call
it the LD-OP pipeline just as easily. The 360/91 pipeline is just an extreme
version (without cache).
<
On a machine such as Gould 32/<and> various interlocks were applied
between calculate and AGEN such that the correct AGENs were performed.
And, here, inbound memory references that hit in the cache actually do take
ZERO extra cycles.
>
> Say, one x86-64, one can do a version of a piece of logic:
> 2 operations at a time, using 10 variables;
> 4 operations at a time, using 20 variables.
>
> x86-64 has 16 registers, so one would expect the 10 variable version to
> be faster than the 20 variable version. But, one may observe the 20
> variable case is still faster.
<
The architecture of x86 is so fucked up at this point in time that budding
architects should avoid being influenced by any of its features.
>

Re: everything old is new again, Compare-and-branch vs PIC

<b8dc9472-06fa-4d79-8946-7b586ad33b40n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:620a:1905:b0:6fa:6636:a7b0 with SMTP id bj5-20020a05620a190500b006fa6636a7b0mr66997596qkb.55.1671292780291;
Sat, 17 Dec 2022 07:59:40 -0800 (PST)
X-Received: by 2002:a05:6808:3086:b0:35e:d7c2:bd39 with SMTP id
bl6-20020a056808308600b0035ed7c2bd39mr622129oib.261.1671292779877; Sat, 17
Dec 2022 07:59:39 -0800 (PST)
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: Sat, 17 Dec 2022 07:59:39 -0800 (PST)
In-Reply-To: <tnjhhg$3jfse$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:f085:9c8:5c:6dd3;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:f085:9c8:5c:6dd3
References: <b6260f7b-fbeb-4549-8579-f12c76bc5b69n@googlegroups.com>
<kM1lL.20158$iU59.5539@fx14.iad> <tn2u7j$288n$1@gal.iecc.com>
<bwnlL.106$%os8.36@fx03.iad> <d3842b13-6457-4a7b-964d-ec0ce66447e2n@googlegroups.com>
<XuJlL.9383$MVg8.8632@fx12.iad> <tn9i9j$2g22f$1@dont-email.me>
<T44mL.71538$gGD7.48801@fx11.iad> <tnala2$2j5mv$1@dont-email.me>
<ffae19fc-caa4-47ce-b730-70389d9f8186n@googlegroups.com> <tnba86$2kho9$1@dont-email.me>
<6d6de22f-53be-4275-aee4-44f6581ff0a4n@googlegroups.com> <tnbvfc$2oj2d$1@dont-email.me>
<bc76d960-0863-49a8-8e72-0e44a684f4ben@googlegroups.com> <tndv79$2tjj5$1@dont-email.me>
<tneh34$v3a3$2@newsreader4.netcologne.de> <tnfsud$35ara$1@dont-email.me>
<tni4m0$11dpq$2@newsreader4.netcologne.de> <tni610$3ddoh$1@dont-email.me>
<faeef2b7-22ab-41c9-a4a6-69505a6106fcn@googlegroups.com> <tnia66$3dq9e$1@dont-email.me>
<13df9d3e-9ec4-4a01-a331-854eae3f5a2bn@googlegroups.com> <tnj94q$3g4ga$1@dont-email.me>
<2284544e-4a9e-4577-9ec2-2b96416e1927n@googlegroups.com> <tnjhhg$3jfse$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b8dc9472-06fa-4d79-8946-7b586ad33b40n@googlegroups.com>
Subject: Re: everything old is new again, Compare-and-branch vs PIC
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Sat, 17 Dec 2022 15:59:40 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 100
 by: MitchAlsup - Sat, 17 Dec 2022 15:59 UTC

On Friday, December 16, 2022 at 10:45:39 PM UTC-6, BGB wrote:
> On 12/16/2022 8:58 PM, MitchAlsup wrote:
> > On Friday, December 16, 2022 at 8:22:22 PM UTC-6, BGB wrote:
> >> On 12/16/2022 2:28 PM, MitchAlsup wrote:
> >>> There seem to be two different camps for ABI design:
> >>
> >> SysV style ABIs:
> >> Typically no spill space;
> >> Structures are passed by copying them in registers or on the stack;
> >> (They often decompose structures into registers, ...)
> >> ...
> >>
> >> Microsoft Style:
> >> Typically provide a spill space,
> >> usually equal to the number of register arguments;
> >> Typically pass and return structures by reference;
> >> ...
> >>
> >>
> >> I had noted that the official RISC-V ABI seems to follow SysV patterns..
> > <
> > MIPS has a spill space............And I see now that RISC-V has corrected that.......
> But, not found any clear information as to why a spill space is either
> good or bad (apart from the issue of not scaling up very well by putting
> more strain on the displacement distance).
>
> Effect on performance either way seems to be fairly small, though it
> does seem to effect code density.
>
> For things like trying to wrangle function argument lists across an RPC
> mechanism, the spill-space makes things easier.
>
> Some descriptions of the Windows X64 ABI also made a case for why
> spill-space was a good thing.
>
>
> I have ABI variants both with and without a spill-space.
> Was using the "no spill space" variant for code built with
> "sizeof(void*)==4".
> >>
> > snip
> >>> While you can't do it naïvely, there is a straightforward way to achieve
> >>> this goal of a vector of arguments for varargs--and in My 66000 you
> >>> can achieve this at the cost of 0 extra instructions !
> > <
> >> In the 8-arg case, it can be done with 4 MOV.X instructions.
> > <
> > Preserving some registers, and allocating a stack costs me 1 instruction.
> > <
> > ENTER R26,R0,#local_data_area_size
> > <
> > Pushing the register arguments, preserving some registers, and allocating
> > a stack still costs only 1 instruction !
> > <
> > ENTER R26,R9,#local_data_area_size
> > <
> > You do it in 4 more instructions, I do it in an already existing instruction.
> I don't have fancy instructions here.
<
In my best Ivan voice: "Fix it" !
> snip
> > <
> > This is why you have to get it right the first time.
> Whole thing started out with 16 registers, then doubled it twice.
> No obvious "better" option than to repeat the existing pattern 2 or 4 times.
<
So, you admit you got it wrong the first time, and now you are patching and
patching.......
>
> The strategy does allow one to determine if a register is callee saved
> fairly easily:
> if(regID&8)
> { callee-saved }
> else
> { scratch }
<
if(regID & 16)
{ preserved }
else
{ argument or temporary }
<
It is also easier to remember that R16..R32 are all preserved than R8..R15 and
R24..R32 (for the human)
>
> Except for a few special cases.
<
No special cases for me......
>

Re: everything old is new again, Compare-and-branch vs PIC

<tnl0f5$3n0bg$1@dont-email.me>

  copy mid

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

  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: everything old is new again, Compare-and-branch vs PIC
Date: Sat, 17 Dec 2022 12:06:29 -0600
Organization: A noiseless patient Spider
Lines: 101
Message-ID: <tnl0f5$3n0bg$1@dont-email.me>
References: <b6260f7b-fbeb-4549-8579-f12c76bc5b69n@googlegroups.com>
<kM1lL.20158$iU59.5539@fx14.iad> <tn2u7j$288n$1@gal.iecc.com>
<bwnlL.106$%os8.36@fx03.iad>
<d3842b13-6457-4a7b-964d-ec0ce66447e2n@googlegroups.com>
<XuJlL.9383$MVg8.8632@fx12.iad> <tn9i9j$2g22f$1@dont-email.me>
<T44mL.71538$gGD7.48801@fx11.iad> <tnala2$2j5mv$1@dont-email.me>
<ffae19fc-caa4-47ce-b730-70389d9f8186n@googlegroups.com>
<tnba86$2kho9$1@dont-email.me> <tni4fd$11dpq$1@newsreader4.netcologne.de>
<tD0nL.236093$GNG9.35152@fx18.iad> <tnjcto$3j6u4$1@dont-email.me>
<9f245614-3829-4482-9e89-2946937e210cn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 17 Dec 2022 18:06:29 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="5c367d0bde0003fcc6ce092943ec760e";
logging-data="3899760"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Ytoyom7R/2oigFaq+Fzo2"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.6.0
Cancel-Lock: sha1:LvKmJ+oQklMV0diS0mnsLM05hsg=
Content-Language: en-US
In-Reply-To: <9f245614-3829-4482-9e89-2946937e210cn@googlegroups.com>
 by: BGB - Sat, 17 Dec 2022 18:06 UTC

On 12/17/2022 9:53 AM, MitchAlsup wrote:
> On Friday, December 16, 2022 at 9:26:52 PM UTC-6, BGB wrote:
>> On 12/16/2022 10:01 AM, Scott Lurndal wrote:
>>> Thomas Koenig <tko...@netcologne.de> writes:
>>>> BGB <cr8...@gmail.com> schrieb:
>>>>
>>>>> Then again, I guess it was interesting to observe that some types of
>>>>> optimizations which help on BJX2 also help on x86-64, despite x86-64
>>>>> having not enough registers to actually make use of the optimization as
>>>>> expressed (x86-64 seems to be able to pretend as-if the stack
>>>>> spills/fills were registers).
>>>>
>>>> This is as old as optimizing compilers. The very first FORTRAN
>>>> compiler assumed that there was an infinite amount of index
>>>> registers, which it then later on assigned to the three that were
>>>> actually available.
>>>>
>> I was thinking more in the sense that it seems to behave as-if it could
>> load from memory into a register in 1 cycle, even if realistically this
>> should take ~ 4 cycles on x86-64.
>>
> One can organize a pipeline such that inbound memory access appears
> to take no cycles at all. Fetch-Decode-AGEN-LDAlign-Calculate-WriteBack.
> Memory reference instructions are presented to the cache (or memory
> pipeline in order) memory is accessed, aligned and then made available
> to some calculation instruction as an operand, writeback can send the result
> of the calculation into the cache (ST) as required.
> <
> I have called this the 360 pipeline <organization> in the past. One could call
> it the LD-OP pipeline just as easily. The 360/91 pipeline is just an extreme
> version (without cache).
> <
> On a machine such as Gould 32/<and> various interlocks were applied
> between calculate and AGEN such that the correct AGENs were performed.
> And, here, inbound memory references that hit in the cache actually do take
> ZERO extra cycles.

IIRC, had read somewhere before that many x86's had handled things like:
ADD EAX, [ECX]
By breaking them into multiple uOps, one for the Load and another for
the Op, and then using a more RISC-like pipeline internally.

This does not seem true at least for the Ryzen.

For Piledriver, would have been more believable, as performance-related
behavior did seem pretty close to what I would expect (theoretically)
from a 3-wide in-order superscalar.

But, Ryzen seems to have changed something, and got a pretty big speedup
here (the estimated model would be something like a 4-wide superscalar
where nearly every operation takes ~ 1 clock cycle).

For some tasks (mostly for stuff written in ASM) have beaten my Ryzen in
terms of work per clock-cycle, mostly because a lot of tasks seem to fit
my ISA design better than they fit into x86-64 / SSE.

Partly this is due to things like 3R ops, ability to load FP values as
immediate, or even "simple things" like less awkward vector shuffles, ...

For C code, or Dhrystone, it is a different matter. Seem to be taking
roughly twice as many instructions for each run through Dhrystone if
compared with GCC + RISC-V.

Where everything is going? I don't know.

>>
>> Say, one x86-64, one can do a version of a piece of logic:
>> 2 operations at a time, using 10 variables;
>> 4 operations at a time, using 20 variables.
>>
>> x86-64 has 16 registers, so one would expect the 10 variable version to
>> be faster than the 20 variable version. But, one may observe the 20
>> variable case is still faster.
> <
> The architecture of x86 is so fucked up at this point in time that budding
> architects should avoid being influenced by any of its features.

Probably true.

Also tested, and it seems like (sadly) my "make ISA variant that
natively does 64 GPRs, enable 64 GPRs everywhere" strategy doesn't seem
to be working out as well as I had hoped.

In particularly it has a hump where, say:
Selectively enable R32..R63, slight code-size reduction and speed increase;
Enable R32..R63 for every function, binary size gets bigger, performance
gets worse.

It appears the issue with this strategy isn't just about the encoding
orthogonality (since using R32..R63 should no longer be as much of an
issue with XG2).

I suspect the added overhead of saving/restoring more registers in the
prolog/epilog sequences is offsetting the gains in many cases.

Re: numerology, was everything old is new again, Compare-and-branch vs PIC

<tnl2f3$jvb$1@gal.iecc.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!news.iecc.com!.POSTED.news.iecc.com!not-for-mail
From: joh...@taugh.com (John Levine)
Newsgroups: comp.arch
Subject: Re: numerology, was everything old is new again, Compare-and-branch vs PIC
Date: Sat, 17 Dec 2022 18:40:35 -0000 (UTC)
Organization: Taughannock Networks
Message-ID: <tnl2f3$jvb$1@gal.iecc.com>
References: <b6260f7b-fbeb-4549-8579-f12c76bc5b69n@googlegroups.com> <86zgbo3eb3.fsf@linuxsc.com> <tnfeme$itl$1@gioia.aioe.org> <86r0wy2ib6.fsf@linuxsc.com>
Injection-Date: Sat, 17 Dec 2022 18:40:35 -0000 (UTC)
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970";
logging-data="20459"; mail-complaints-to="abuse@iecc.com"
In-Reply-To: <b6260f7b-fbeb-4549-8579-f12c76bc5b69n@googlegroups.com> <86zgbo3eb3.fsf@linuxsc.com> <tnfeme$itl$1@gioia.aioe.org> <86r0wy2ib6.fsf@linuxsc.com>
Cleverness: some
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: johnl@iecc.com (John Levine)
 by: John Levine - Sat, 17 Dec 2022 18:40 UTC

According to Tim Rentsch <tr.17687@z991.linuxsc.com>:
>>>> There was a recent poll on some site and 56% of Americans do not
>>>> think that Arabic numerals should be taught in schools, too; and
>>>> 15% don't have an opinion. ...

>Note by the way that most of the people responding to this survey
>probably didn't choose to be ignorant of the essential fact that
>our number symbols are indeed Arabic numerals.

They are and they aren't. While we call our familar digits Arabic
numerals, there is a quite different set of Arabic digits used in
written Arabic. You can see them in this code chart, U+0660 to U+0669:

https://en.wikipedia.org/wiki/Arabic_(Unicode_block)

I was in Abu Dhabi for a conference a few years ago and indeed the
numbers on the speed limit signs used those digits.

While I agree it's pretty lame that apparently a majority of Americans
don't know that we call our digits Arabic numerals, I can have a fair
amount of sympathy that there's no need to teach the Arabic digits
that Arabs currently use.

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

Re: numerology, was everything old is new again, Compare-and-branch vs PIC

<ecfe937f-443a-44fa-8966-40905ea03cd7n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a0c:bf4f:0:b0:4c6:bcdd:3162 with SMTP id b15-20020a0cbf4f000000b004c6bcdd3162mr67731121qvj.15.1671302893892;
Sat, 17 Dec 2022 10:48:13 -0800 (PST)
X-Received: by 2002:a9d:184:0:b0:66e:c864:fcb1 with SMTP id
e4-20020a9d0184000000b0066ec864fcb1mr9397113ote.31.1671302893625; Sat, 17 Dec
2022 10:48:13 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Sat, 17 Dec 2022 10:48:13 -0800 (PST)
In-Reply-To: <tnl2f3$jvb$1@gal.iecc.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:f085:9c8:5c:6dd3;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:f085:9c8:5c:6dd3
References: <b6260f7b-fbeb-4549-8579-f12c76bc5b69n@googlegroups.com>
<86zgbo3eb3.fsf@linuxsc.com> <tnfeme$itl$1@gioia.aioe.org>
<86r0wy2ib6.fsf@linuxsc.com> <tnl2f3$jvb$1@gal.iecc.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ecfe937f-443a-44fa-8966-40905ea03cd7n@googlegroups.com>
Subject: Re: numerology, was everything old is new again, Compare-and-branch
vs PIC
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Sat, 17 Dec 2022 18:48:13 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2884
 by: MitchAlsup - Sat, 17 Dec 2022 18:48 UTC

On Saturday, December 17, 2022 at 12:40:38 PM UTC-6, John Levine wrote:
> According to Tim Rentsch <tr.1...@z991.linuxsc.com>:
> >>>> There was a recent poll on some site and 56% of Americans do not
> >>>> think that Arabic numerals should be taught in schools, too; and
> >>>> 15% don't have an opinion. ...
<
> >Note by the way that most of the people responding to this survey
> >probably didn't choose to be ignorant of the essential fact that
> >our number symbols are indeed Arabic numerals.
<
I was taught in 3,4,5 th grades that the 0..9 digits we used were Arabic
numerals. So, at least for my generation, you could not get out of grade
school without being told this fact. Most quickly forgot....................sigh
<
> They are and they aren't. While we call our familar digits Arabic
> numerals, there is a quite different set of Arabic digits used in
> written Arabic. You can see them in this code chart, U+0660 to U+0669:
>
> https://en.wikipedia.org/wiki/Arabic_(Unicode_block)
>
> I was in Abu Dhabi for a conference a few years ago and indeed the
> numbers on the speed limit signs used those digits.
>
> While I agree it's pretty lame that apparently a majority of Americans
> don't know that we call our digits Arabic numerals, I can have a fair
> amount of sympathy that there's no need to teach the Arabic digits
> that Arabs currently use.
>
> --
> Regards,
> John Levine, jo...@taugh.com, Primary Perpetrator of "The Internet for Dummies",
> Please consider the environment before reading this e-mail. https://jl.ly

Re: everything old is new again, Compare-and-branch vs PIC

<tnl42e$3nd04$1@dont-email.me>

  copy mid

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

  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: everything old is new again, Compare-and-branch vs PIC
Date: Sat, 17 Dec 2022 13:07:57 -0600
Organization: A noiseless patient Spider
Lines: 174
Message-ID: <tnl42e$3nd04$1@dont-email.me>
References: <b6260f7b-fbeb-4549-8579-f12c76bc5b69n@googlegroups.com>
<tmtmlq$uo06$1@dont-email.me>
<45ecc365-c1f0-4bd8-b92a-4e50209095c7n@googlegroups.com>
<kM1lL.20158$iU59.5539@fx14.iad> <tn2u7j$288n$1@gal.iecc.com>
<bwnlL.106$%os8.36@fx03.iad>
<d3842b13-6457-4a7b-964d-ec0ce66447e2n@googlegroups.com>
<XuJlL.9383$MVg8.8632@fx12.iad> <tn9i9j$2g22f$1@dont-email.me>
<T44mL.71538$gGD7.48801@fx11.iad> <tnala2$2j5mv$1@dont-email.me>
<ffae19fc-caa4-47ce-b730-70389d9f8186n@googlegroups.com>
<tnba86$2kho9$1@dont-email.me> <tni4fd$11dpq$1@newsreader4.netcologne.de>
<tnjjot$3jkdi$1@dont-email.me>
<ca4b34f5-9401-42a4-a1bf-ef7f8fe6b57dn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 17 Dec 2022 19:07:59 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="5c367d0bde0003fcc6ce092943ec760e";
logging-data="3912708"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/spKvIQfk5MW7KxZ6XXC++"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.6.0
Cancel-Lock: sha1:uVR3sgPno9Q2F39gbMzkNrMlZ1M=
Content-Language: en-US
In-Reply-To: <ca4b34f5-9401-42a4-a1bf-ef7f8fe6b57dn@googlegroups.com>
 by: BGB - Sat, 17 Dec 2022 19:07 UTC

On 12/17/2022 2:49 AM, robf...@gmail.com wrote:
> On Saturday, December 17, 2022 at 12:23:44 AM UTC-5, BGB wrote:
>> On 12/16/2022 9:56 AM, Thomas Koenig wrote:
>>> BGB <cr8...@gmail.com> schrieb:
>>>
>>>> Then again, I guess it was interesting to observe that some types of
>>>> optimizations which help on BJX2 also help on x86-64, despite x86-64
>>>> having not enough registers to actually make use of the optimization as
>>>> expressed (x86-64 seems to be able to pretend as-if the stack
>>>> spills/fills were registers).
>>>
>>> This is as old as optimizing compilers. The very first FORTRAN
>>> compiler assumed that there was an infinite amount of index
>>> registers, which it then later on assigned to the three that were
>>> actually available.
>>>
>>>> Meanwhile, I am left needing to use lots of registers, and occasional
>>>> optimizations which try to side-step a few (store then load) cases, then
>>>> recently needing to fix a bug where one of these optimizations broke due
>>>> to a type-handling issue in my compiler (was using the type of the value
>>>> stored to an array, rather than the type of the value as loaded from the
>>>> array).
>>>
>>> Did you actually look at optimizing register allocation algorithms?
>>> http://web.cecs.pdx.edu/~mperkows/temp/register-allocation.pdf is one
>>> of the first search results that Google (well, Startpage) returns.
>>> You should really look into graph coloring.
>> Looks some at the linked PDF.
>>
>> Yeah, BGBCC doesn't do anything like this.
>>
>> Only two levels:
>> Within a given basic-block;
>> Or, global for the whole function.
>>
>> Would have to figure out how to try to glue on something like graph
>> coloring, seems like a more advanced type of optimization than most of
>> the stuff I had been doing...
>>
>>
>> And, well, the "maybe stupid" assumption that if one typically has more
>> registers in the ISA than local variables and temporaries in the
>> function, they can static-assign everything and mostly sweep the
>> register-allocation issues under the carpet.
>>
>> Well, pros/cons...
>>
>>
>> There are also issues, like trying to weed out the sources that are
>> generating a bunch of spurious (and frivolous) RegReg MOVs (one can fix
>> them in one case, and find more frivolous MOVs somewhere else, or a
>> bunch of otherwise unnecessary sign or zero extension operations, ...).
>>
>>
>> Then again, I guess it remains as an open question of what performance
>> would look like if my optimizer didn't suck...
>>
>>
>> Then again, I guess no one is claiming that writing a "good quality" C
>> compiler is particularly fast or easy (getting something that "sorta
>> works" hacked together isn't too bad; getting it to generate decent
>> quality output and relatively bug-free is a whole different issue).
>>
>>
>> ...
> Yes. I came to realize that compilers are quite an undertaking. I only work
> on the compiler periodically now, preferring to use VBCC. Had a look at
> GCC and LLVM.
>

OK. Had not heard of or looked at VBCC.

As noted, I am using BGBCC for my project, which was written by me,
originally back in the late 2000s (when I was still taking college
classes, still early 20s at the time).

First version kinda "really sucked" and didn't go much beyond fairly
trivial test programs (at the time it was mostly beyond my debugging
skills).

Also this first version was trying to generate x86 code directly from
the stack IR, which was a bad idea. It wasn't until the 2010s that most
of my VM projects would switch over to translating from a stack model to
a 3AC IR, and then either interpreting or JIT'ing based on this (the 3AC
model giving a big speedup over trying to run a stack-machine model
directly).

> Here is another link on color-graphing. I spent quite a bit of time reading and
> re-reading this until I was able to come up with a yet to get working properly
> color graphing allocator for my compiler. I think there are issues with register
> spills and reloads. Then I found out that if there are enough registers > 16
> maybe color graphing is not so necessary.
>
> https://www.cs.utexas.edu/users/mckinley/380C/lecs/briggs-thesis-1992.pdf
>
> I believe a linear scan allocator is another common allocator.
>
> I have the code for the allocator in my Github account. It is quite complex,
> written in c++.
>
> The allocator I currently use simply counts register usages, giving more counts
> for registers used in a loop. And prioritizes register allocations that way.

Similar in my case.

In the "frame layout" step, it goes and looks at all the IR ops, counts
usage count, with a 1+x^2 multiplier based on loop nesting level
(recorded in the IL/IR for each label).

So:
a=0; //multiplier = 1 (level=0)
for(i=0; i<10; i++)
{
b=2; //multiplier = 2 (level=1)
for(j=0; j<10; j++)
{
c=3; //multiplier = 5 (level=2)
}
}

The variables in the function are ranked based on their total counts,
with the "top N" statically assigned to variables.

The N is variable here, where N has a theoretical hard-limit (based on
the number of available registers, minus a certain minimum).

Subtracted minimum is, say:
4 if no SIMD ops;
7 if SIMD ops.

Basically, need to keep at least enough registers free to be able to
load the working values for a 3R operation (else the compiler may end up
backed into a corner where it is unable to allocate dynamic registers
for things, and has no option other than to abort).

As noted:
R8..R14, Limit=3 or 0 (*)
R8..R14, R24..R31: Limit=11 or 8.
R8..R14, R24..R31, R40..R47, R55..R63: Limit=27 or 24.

With the limit being increased for leaf functions (where one can also
allocate variables into scratch registers).

*: For 16 GPR machines, it may make sense to use only dynamic
allocation. This is what my code-generators on x86-64 and ARM had
typically done (works well enough on x86, but my attempts to generate
code for ARM have tended to result in performance that is "decidedly
awful").

The value for N is determined based on finding the point where the sum
of the current and preceding variables crosses 1/16 of the total count
for all variables (*).

Except where the hard-limit is greater than the total variables, where
it then sets N to the to the number of variables in the function.

*: I am looking at my code, but the logic of how it works is not making
sense to me at the moment (seems suspect).

Intuitively would have made more sense to compare the sum of
current-and-preceding against the sum of all future variables, say:
if(current>((total-current)*magicScale)) { N=i; break; }

Presumably I knew what I was doing at the time, but seems like for
whatever reason, the logic escapes me at the moment.

Re: everything old is new again, Compare-and-branch vs PIC

<tnl5i8$3ngo6$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: paaroncl...@gmail.com (Paul A. Clayton)
Newsgroups: comp.arch
Subject: Re: everything old is new again, Compare-and-branch vs PIC
Date: Sat, 17 Dec 2022 14:33:27 -0500
Organization: A noiseless patient Spider
Lines: 54
Message-ID: <tnl5i8$3ngo6$1@dont-email.me>
References: <b6260f7b-fbeb-4549-8579-f12c76bc5b69n@googlegroups.com>
<kM1lL.20158$iU59.5539@fx14.iad> <tn2u7j$288n$1@gal.iecc.com>
<bwnlL.106$%os8.36@fx03.iad>
<d3842b13-6457-4a7b-964d-ec0ce66447e2n@googlegroups.com>
<XuJlL.9383$MVg8.8632@fx12.iad> <tn9i9j$2g22f$1@dont-email.me>
<T44mL.71538$gGD7.48801@fx11.iad> <tnala2$2j5mv$1@dont-email.me>
<ffae19fc-caa4-47ce-b730-70389d9f8186n@googlegroups.com>
<tnba86$2kho9$1@dont-email.me> <tni4fd$11dpq$1@newsreader4.netcologne.de>
<tD0nL.236093$GNG9.35152@fx18.iad> <tnjcto$3j6u4$1@dont-email.me>
<9f245614-3829-4482-9e89-2946937e210cn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 17 Dec 2022 19:33:28 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="8ce3a816fc037f589dbf7bcebac79e1f";
logging-data="3916550"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/bAtlkuXg7kXVz/fvYiQoBoCPz8MvVC1M="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.0
Cancel-Lock: sha1:muIaXAqDtY6T5AQVsaEipgRsPEg=
In-Reply-To: <9f245614-3829-4482-9e89-2946937e210cn@googlegroups.com>
 by: Paul A. Clayton - Sat, 17 Dec 2022 19:33 UTC

MitchAlsup wrote:
[snip]
> One can organize a pipeline such that inbound memory access appears
> to take no cycles at all. Fetch-Decode-AGEN-LDAlign-Calculate-WriteBack.
> Memory reference instructions are presented to the cache (or memory
> pipeline in order) memory is accessed, aligned and then made available
> to some calculation instruction as an operand, writeback can send the result
> of the calculation into the cache (ST) as required.

Of course, that does not apply to loaded values used for
addressing other values in memory (pointers and indexes).

For some special cases one can avoid/defer address generation by
addressing the cache by the offset (this even allows hoisting the
load operation ahead of register read). E.g., Knapsack cache
(indexed by offset from global pointer), signature cache (object
base pointer address is base of cache), or possibly stack cache
(most proposals do use address generation but one could avoid that
at the cost of utilization, e.g., inverting offsets for every
other stack frame would allow two (possibly partial) frames to be
trivially addressed in a direct-mapped stack cache).

(Special casing base address value access to provide the least
significant bits — even excluding three or more least significant
bits if objects, stack, etc. pointers have 8+ byte alignment —
which might shave a little latency at the cost of area and power.)

Summed-address memory is another technique for reducing cache
access latency. (Of course, Itanium provided only post-increment
loads, so address generation did not add latency — not that such
is an example of a good design choice.)

ORing (or XORing) the offset with the base address has been
proposed, but that seems likely to be a poor choice.

(Interestingly, Intel already penalized carry-out past a certain
point in address generation — or so I seem to recall reading.)

> I have called this the 360 pipeline <organization> in the past. One could call
> it the LD-OP pipeline just as easily. The 360/91 pipeline is just an extreme
> version (without cache).

The term I read (which applies generally to delaying some
operations relative to others) is "skewed pipeline".

> On a machine such as Gould 32/<and> various interlocks were applied
> between calculate and AGEN such that the correct AGENs were performed.
> And, here, inbound memory references that hit in the cache actually do take
> ZERO extra cycles.

While the specific trick of skewed-pipelining is probably simple
enough to be reinvented, it still seems sad that so much
cleverness of the past is not remembered (documented for easy
reference).

Re: everything old is new again, Compare-and-branch vs PIC

<tnl5j6$3ngo6$2@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: paaroncl...@gmail.com (Paul A. Clayton)
Newsgroups: comp.arch
Subject: Re: everything old is new again, Compare-and-branch vs PIC
Date: Sat, 17 Dec 2022 14:33:58 -0500
Organization: A noiseless patient Spider
Lines: 95
Message-ID: <tnl5j6$3ngo6$2@dont-email.me>
References: <b6260f7b-fbeb-4549-8579-f12c76bc5b69n@googlegroups.com>
<tmtmlq$uo06$1@dont-email.me>
<45ecc365-c1f0-4bd8-b92a-4e50209095c7n@googlegroups.com>
<kM1lL.20158$iU59.5539@fx14.iad> <tn2u7j$288n$1@gal.iecc.com>
<bwnlL.106$%os8.36@fx03.iad>
<d3842b13-6457-4a7b-964d-ec0ce66447e2n@googlegroups.com>
<XuJlL.9383$MVg8.8632@fx12.iad> <tn9i9j$2g22f$1@dont-email.me>
<T44mL.71538$gGD7.48801@fx11.iad> <tnala2$2j5mv$1@dont-email.me>
<ffae19fc-caa4-47ce-b730-70389d9f8186n@googlegroups.com>
<2022Dec15.154325@mips.complang.tuwien.ac.at>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 17 Dec 2022 19:33:58 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="8ce3a816fc037f589dbf7bcebac79e1f";
logging-data="3916550"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18sKykrCcnNaDLFQvv61ErdFz3xqlZhuW4="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.0
Cancel-Lock: sha1:+J6T64l0HAzzAWUt+jlmfKiQ/Rk=
X-Mozilla-News-Host: news://news.eternal-september.org
In-Reply-To: <2022Dec15.154325@mips.complang.tuwien.ac.at>
 by: Paul A. Clayton - Sat, 17 Dec 2022 19:33 UTC

Anton Ertl wrote:
[snip]
> If you want a delay-1-cycle instruction, this should be possible even
> in an OoO machine: when that instruction is processed, the clock is
> not gated through to the rest of the execution engine for one cycle.
> Of course, with an OoO engine, you cannot really predict which
> instructions are affected by the additional cycle. The question is:
> Why would anyone use such an instruction?

MIPS defined a superscalar nop. MIPS64™ Architecture For
Programmers, Volume II: The MIPS64™ Instruction Set, Revision 2.00
(June 9, 2003) descripes Superscalar No Operation (SSNOP) thus:

Purpose:
Break superscalar issue on a superscalar processor.

Description:
SSNOP is the assembly idiom used to denote superscalar no
operation. The actual instruction is interpreted by the hardware
as SLL r0, r0, 1.

This instruction alters the instruction issue behavior on a
superscalar processor by forcing the SSNOP instruction to single-
issue. The processor must then end the current instruction issue
between the instruction previous to the SSNOP and the SSNOP. The
SSNOP then issues alone in the next issue slot.

On a single-issue processor, this instruction is a NOP that takes
an issue slot.

....

Programming Notes:
SSNOP is intended for use primarily to allow the programmer
control over CP0 hazards by converting instructions into cycles in
a superscalar processor. For example, to insert at least two
cycles between an MTC0 and an ERET, one would use the following
sequence:

mtc0
ssnop
ssnop
eret
x,y

Based on the normal issues rules of the processor, the MTC0 issues
in cycle T. Because the SSNOP instructions must issue alone, they
may issue no earlier than cycle T+1 and cycle T+2, respectively.
Finally, the ERET issues no earlier than cycle T+3. Note that
although the instruction after an SSNOP may issue no earlier than
the cycle after the SSNOP is issued, that instruction may issue
later. This is because other implementation-dependent issue rules
may apply that prevent an issue in the next cycle. Processors
should not introduce any unnecessary delay in issuing SSNOP
instructions.

A less code bloating alternative was introduced later: Execution
Hazard Barrier (EHB):

Purpose:
To stop instruction execution until all execution hazards have
been cleared.

Description:
EHB is the assembly idiom used to denote execution hazard barrier.
The actual instruction is interpreted by the hardware as SLL r0,
r0, 3.

This instruction alters the instruction issue behavior on a
pipelined processor by stopping execution until all execution
hazards have been cleared. Other than those that might be created
as a consequence of setting StatusCU0, there are no execution
hazards visible to an unprivileged program running in User Mode.
All execution hazards created by previous instructions are cleared
for instructions executed immediately following the EHB, even if
the EHB is executed in the delay slot of a branch or jump. The EHB
instruction does not clear instruction hazards - such hazards are
cleared by the JALR.HB, JR.HB, and ERET instructions.

....

Programming Notes:
In MIPS64 Release 2 implementations, this instruction resolves all
execution hazards. On a superscalar processor, EHB has alters the
instruction issue behavior in a manner identical to SSNOP. For
backward compatibility with Release 1 implementations, the last of
a sequence of SSNOPs can be replaced by an EHB. In Release 1
implementations, the EHB will be treated as an SSNOP, thereby
preserving the semantics of the sequence. In Release 2
implementations, replacing the final SSNOP with an EHB should have
no performance effect because a properly sizedsequence of SSNOPs
will have already cleared the hazard. As EHB becomes the standard
in MIPS implementations, the previous SSNOPs can be removed,
leaving only the EHB.

Re: everything old is new again, Compare-and-branch vs PIC

<tnl61v$3ni0o$1@dont-email.me>

  copy mid

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

  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: everything old is new again, Compare-and-branch vs PIC
Date: Sat, 17 Dec 2022 13:41:50 -0600
Organization: A noiseless patient Spider
Lines: 96
Message-ID: <tnl61v$3ni0o$1@dont-email.me>
References: <b6260f7b-fbeb-4549-8579-f12c76bc5b69n@googlegroups.com>
<tmtmlq$uo06$1@dont-email.me>
<45ecc365-c1f0-4bd8-b92a-4e50209095c7n@googlegroups.com>
<kM1lL.20158$iU59.5539@fx14.iad> <tn2u7j$288n$1@gal.iecc.com>
<bwnlL.106$%os8.36@fx03.iad>
<d3842b13-6457-4a7b-964d-ec0ce66447e2n@googlegroups.com>
<XuJlL.9383$MVg8.8632@fx12.iad> <tn9i9j$2g22f$1@dont-email.me>
<T44mL.71538$gGD7.48801@fx11.iad> <tnala2$2j5mv$1@dont-email.me>
<ffae19fc-caa4-47ce-b730-70389d9f8186n@googlegroups.com>
<tnba86$2kho9$1@dont-email.me>
<6d6de22f-53be-4275-aee4-44f6581ff0a4n@googlegroups.com>
<86zgbo3eb3.fsf@linuxsc.com> <tnfeme$itl$1@gioia.aioe.org>
<86r0wy2ib6.fsf@linuxsc.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 17 Dec 2022 19:41:53 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="5c367d0bde0003fcc6ce092943ec760e";
logging-data="3917848"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19zZttunpTaQ2vR2quO+d6Y"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.6.0
Cancel-Lock: sha1:uBFi2TjiBbek1raLEp0onL7W0Bk=
In-Reply-To: <86r0wy2ib6.fsf@linuxsc.com>
Content-Language: en-US
 by: BGB - Sat, 17 Dec 2022 19:41 UTC

On 12/17/2022 8:53 AM, Tim Rentsch wrote:
> Terje Mathisen <terje.mathisen@tmsw.no> writes:
>
>> Tim Rentsch wrote:
>>
>>> MitchAlsup <MitchAlsup@aol.com> writes:
>>>
>>> [...]
>>>
>>>> There was a recent poll on some site and 56% of Americans do not
>>>> think that Arabic numerals should be taught in schools, too; and
>>>> 15% don't have an opinion.
>>>> https://www.snopes.com/fact-check/teaching-arabic-numerals/
>>>> We are well on the way to Idiocracy.
>>>
>>> That isn't idiocy; it's illiteracy. Those aren't the same thing.
>>> Don't make the mistake of thinking someone is stupid when all they
>>> are is ignorant.
>>
>> I was going to agree with you, but realized that "willful ignorance"
>> cannot be as easily (if ever?) forgiven.
>
> My comment is about people who happen to be ignorant, not about
> people who choose to remain ignorant.
>
> Furthermore, it is still the case that one shouldn't _assume_ that
> someone is stupid just because they are ignorant. If later
> information shows signs of willful ignorance, the question of
> intelligence can always be revisited (or even just visited).
>

And then there is also...

Whatever, exactly, is going on in the minds of YECs (Young Earth
Creationists).
Like, all the sort of extreme contortions they go through, to try to
make the world (and the universe as a whole) try to fit into a 6K year
timeline...

Like, this can be ruled out mostly on the basis of plausibility.

Well, then again, there are also groups set on the idea that there was
once a technologically advanced civilization among the Native Americans,
but that they had a war and (somehow forgot?) and reverted back to a
hunter/gatherer lifestyle.

....

> Note by the way that most of the people responding to this survey
> probably didn't choose to be ignorant of the essential fact that
> our number symbols are indeed Arabic numerals. And it isn't
> obvious that including that bit of knowledge in the educational
> curriculum would yield any significant benefit. It's more
> important to teach people how to think than to fill their heads
> with zillions of miscellaneous facts (and it's disappointing that
> this basic truth is not more widely recognized).

Yeah.

School system is seemingly more about making people do busywork,
memorize random trivia, and then accept the superiority of being a "busy
worker bee" for the corporate overlords, than anything else...

I was left as someone who had generally far too much anxiety to really
put much effort into all the meaningless busywork, and had doubts about
the "inherent goodness" of a world based on the control of a smallish
number of large corporations.

Had also sort of believed at the time that society was probably going to
collapse relatively soon anyways.

Granted, the "2008 financial crisis" happened a few years after I got
out of high-school, but this wasn't quite the level of collapse I had
imagined. Even as such, things still don't look entirely stable (say,
what will people do if/when inflation goes out of control and the USD
becomes essentially worthless?...).

Though, the shake-up could either lead to:
Many corporations die off;
The "overlord" situation gets worse, if those who remain largely take
over many of the roles traditionally held by the US government (their
ability to retain authority or control in many areas being less certain
in the case of a full economic collapse).

Like, say, what if much of the western US is no longer "US" per se, but
instead mostly split up between areas ruled over by Apple and
Microsoft?... ( Well, say, with UT/NV/AZ/... becoming part of an LDS
theocracy? ... ).

....

Re: everything old is new again, Compare-and-branch vs PIC

<18cb1108-9fc0-4d4c-b6e7-bdc7583b15b9n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:ac8:545a:0:b0:3a8:16b:e8e0 with SMTP id d26-20020ac8545a000000b003a8016be8e0mr1051472qtq.132.1671311293358;
Sat, 17 Dec 2022 13:08:13 -0800 (PST)
X-Received: by 2002:a05:6870:2f05:b0:132:6f79:9ffb with SMTP id
qj5-20020a0568702f0500b001326f799ffbmr1437682oab.61.1671311293155; Sat, 17
Dec 2022 13:08:13 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Sat, 17 Dec 2022 13:08:12 -0800 (PST)
In-Reply-To: <tnl5i8$3ngo6$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:f085:9c8:5c:6dd3;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:f085:9c8:5c:6dd3
References: <b6260f7b-fbeb-4549-8579-f12c76bc5b69n@googlegroups.com>
<kM1lL.20158$iU59.5539@fx14.iad> <tn2u7j$288n$1@gal.iecc.com>
<bwnlL.106$%os8.36@fx03.iad> <d3842b13-6457-4a7b-964d-ec0ce66447e2n@googlegroups.com>
<XuJlL.9383$MVg8.8632@fx12.iad> <tn9i9j$2g22f$1@dont-email.me>
<T44mL.71538$gGD7.48801@fx11.iad> <tnala2$2j5mv$1@dont-email.me>
<ffae19fc-caa4-47ce-b730-70389d9f8186n@googlegroups.com> <tnba86$2kho9$1@dont-email.me>
<tni4fd$11dpq$1@newsreader4.netcologne.de> <tD0nL.236093$GNG9.35152@fx18.iad>
<tnjcto$3j6u4$1@dont-email.me> <9f245614-3829-4482-9e89-2946937e210cn@googlegroups.com>
<tnl5i8$3ngo6$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <18cb1108-9fc0-4d4c-b6e7-bdc7583b15b9n@googlegroups.com>
Subject: Re: everything old is new again, Compare-and-branch vs PIC
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Sat, 17 Dec 2022 21:08:13 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 5021
 by: MitchAlsup - Sat, 17 Dec 2022 21:08 UTC

On Saturday, December 17, 2022 at 1:33:31 PM UTC-6, Paul A. Clayton wrote:
> MitchAlsup wrote:
> [snip]
> > One can organize a pipeline such that inbound memory access appears
> > to take no cycles at all. Fetch-Decode-AGEN-LDAlign-Calculate-WriteBack..
> > Memory reference instructions are presented to the cache (or memory
> > pipeline in order) memory is accessed, aligned and then made available
> > to some calculation instruction as an operand, writeback can send the result
> > of the calculation into the cache (ST) as required.
> Of course, that does not apply to loaded values used for
> addressing other values in memory (pointers and indexes).
>
> For some special cases one can avoid/defer address generation by
> addressing the cache by the offset (this even allows hoisting the
> load operation ahead of register read). E.g., Knapsack cache
> (indexed by offset from global pointer), signature cache (object
> base pointer address is base of cache), or possibly stack cache
> (most proposals do use address generation but one could avoid that
> at the cost of utilization, e.g., inverting offsets for every
> other stack frame would allow two (possibly partial) frames to be
> trivially addressed in a direct-mapped stack cache).
>
> (Special casing base address value access to provide the least
> significant bits — even excluding three or more least significant
> bits if objects, stack, etc. pointers have 8+ byte alignment —
> which might shave a little latency at the cost of area and power.)
>
> Summed-address memory is another technique for reducing cache
> access latency. (Of course, Itanium provided only post-increment
> loads, so address generation did not add latency — not that such
> is an example of a good design choice.)
>
> ORing (or XORing) the offset with the base address has been
> proposed, but that seems likely to be a poor choice.
>
> (Interestingly, Intel already penalized carry-out past a certain
> point in address generation — or so I seem to recall reading.)
> > I have called this the 360 pipeline <organization> in the past. One could call
> > it the LD-OP pipeline just as easily. The 360/91 pipeline is just an extreme
> > version (without cache).
> The term I read (which applies generally to delaying some
> operations relative to others) is "skewed pipeline".
> > On a machine such as Gould 32/<and> various interlocks were applied
> > between calculate and AGEN such that the correct AGENs were performed.
> > And, here, inbound memory references that hit in the cache actually do take
> > ZERO extra cycles.
<
> While the specific trick of skewed-pipelining is probably simple
> enough to be reinvented, it still seems sad that so much
> cleverness of the past is not remembered (documented for easy
> reference).
<
The real shame is that none of the new trainees to bother to look the old
stuff up.
<
Those who do not remember history are doomed to repeat it.
<
Apparently this holds double for Computer Science.................

Re: everything old is new again, Compare-and-branch vs PIC

<tnle9g$3onv0$1@dont-email.me>

  copy mid

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

  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: everything old is new again, Compare-and-branch vs PIC
Date: Sat, 17 Dec 2022 16:02:24 -0600
Organization: A noiseless patient Spider
Lines: 44
Message-ID: <tnle9g$3onv0$1@dont-email.me>
References: <b6260f7b-fbeb-4549-8579-f12c76bc5b69n@googlegroups.com>
<d3842b13-6457-4a7b-964d-ec0ce66447e2n@googlegroups.com>
<XuJlL.9383$MVg8.8632@fx12.iad> <tn9i9j$2g22f$1@dont-email.me>
<T44mL.71538$gGD7.48801@fx11.iad> <tnala2$2j5mv$1@dont-email.me>
<ffae19fc-caa4-47ce-b730-70389d9f8186n@googlegroups.com>
<tnba86$2kho9$1@dont-email.me>
<6d6de22f-53be-4275-aee4-44f6581ff0a4n@googlegroups.com>
<tnbvfc$2oj2d$1@dont-email.me>
<bc76d960-0863-49a8-8e72-0e44a684f4ben@googlegroups.com>
<2022Dec15.111358@mips.complang.tuwien.ac.at> <tnfk0i$34fll$1@dont-email.me>
<86ilia2ftu.fsf@linuxsc.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 17 Dec 2022 22:02:25 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="5c367d0bde0003fcc6ce092943ec760e";
logging-data="3956704"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Jjf+pL57aym7TTxQVTuPn"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.6.0
Cancel-Lock: sha1:c3E4VT0NHztzetYKFMD6zp+0Dkw=
Content-Language: en-US
In-Reply-To: <86ilia2ftu.fsf@linuxsc.com>
 by: BGB - Sat, 17 Dec 2022 22:02 UTC

On 12/17/2022 9:46 AM, Tim Rentsch wrote:
> BGB <cr88192@gmail.com> writes:
>
>> On 12/15/2022 4:13 AM, Anton Ertl wrote:
>>
>>> MitchAlsup <MitchAlsup@aol.com> writes:
>>>
>>>> Had your base port been from LLVM instead of GCC this likely would not
>>>> have happened.
>>>> GCC is more of a K&R (anything goes) while LLVM is more of a C-done-right
>>>> (ADA-style)
>>>
>>> On what evidence do you base this claim?
>>>
>>> And why would "C-done-right" be "ADA-style"? My take on C done right
>>> is that a compiler maintains backwards compatibility with earlier
>>> versions, while others think that C done right punishes the sinners
>>> who write code that performs undefined behaviour as much as possible
>>> by compiling it to unintended code (best even if there is no
>>> performance advantage to that). I don't have Ada experience, but the
>>> general image is compile-time errors and run-time errors; I would not
>>> expect the latter from GCC or Clang.
>>>
>>> What I have experienced from Clang is that a common bit-rotation idiom
>>> is compiled to 0 for rot(x,0) (for variable x) without compile-time or
>>> run-time warning or error, because it exercises undefined behaviour
>>> for a rotation count of 0, while gcc produced the intended behaviour.
>>
>> Yeah. Both GCC and LLVM are playing fast and loose with C semantics.
>
> The construct in question is undefined behavior. You may not
> like what GCC and LLVM do with it, but they are not in any
> way shape or form violating C semantics.

Saying something is "undefined behavior" is kind of a weak argument IMO
when it has otherwise "perfectly reasonable" behavior that "most older
compilers supported, and most C code from that era accepted as canonical".

Undefined Behavior more makes sense for the programmer to take note of,
when there might be implementation differences between compilers.
Compilers treating UB as license to do whatever, is not ideal, except in
cases where the depended on semantics are "clearly unreasonable".

Re: everything old is new again, Compare-and-branch vs PIC

<0a755964-4c09-4d63-a546-7a42883461b3n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:ad4:5288:0:b0:4c7:5f27:7966 with SMTP id v8-20020ad45288000000b004c75f277966mr20151481qvr.44.1671315198907;
Sat, 17 Dec 2022 14:13:18 -0800 (PST)
X-Received: by 2002:a05:6870:5ccb:b0:144:5572:4aeb with SMTP id
et11-20020a0568705ccb00b0014455724aebmr1790203oab.186.1671315198708; Sat, 17
Dec 2022 14:13:18 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Sat, 17 Dec 2022 14:13:18 -0800 (PST)
In-Reply-To: <tnle9g$3onv0$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=99.251.79.92; posting-account=QId4bgoAAABV4s50talpu-qMcPp519Eb
NNTP-Posting-Host: 99.251.79.92
References: <b6260f7b-fbeb-4549-8579-f12c76bc5b69n@googlegroups.com>
<d3842b13-6457-4a7b-964d-ec0ce66447e2n@googlegroups.com> <XuJlL.9383$MVg8.8632@fx12.iad>
<tn9i9j$2g22f$1@dont-email.me> <T44mL.71538$gGD7.48801@fx11.iad>
<tnala2$2j5mv$1@dont-email.me> <ffae19fc-caa4-47ce-b730-70389d9f8186n@googlegroups.com>
<tnba86$2kho9$1@dont-email.me> <6d6de22f-53be-4275-aee4-44f6581ff0a4n@googlegroups.com>
<tnbvfc$2oj2d$1@dont-email.me> <bc76d960-0863-49a8-8e72-0e44a684f4ben@googlegroups.com>
<2022Dec15.111358@mips.complang.tuwien.ac.at> <tnfk0i$34fll$1@dont-email.me>
<86ilia2ftu.fsf@linuxsc.com> <tnle9g$3onv0$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0a755964-4c09-4d63-a546-7a42883461b3n@googlegroups.com>
Subject: Re: everything old is new again, Compare-and-branch vs PIC
From: robfi...@gmail.com (robf...@gmail.com)
Injection-Date: Sat, 17 Dec 2022 22:13:18 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2250
 by: robf...@gmail.com - Sat, 17 Dec 2022 22:13 UTC

>The real shame is that none of the new trainees to bother to look the old
>stuff up.
><
>Those who do not remember history are doomed to repeat it.
><
It is ego I think. Maybe lacking humility? It takes a bit to recognize that
maybe someone else could have done a better job than oneself. Personally,
I like to find out if someone else has done the thing I am after, then just
copy the ideas as a starting point. Trying to be innovative. The world is
bigger than just me.

Even those who do remember history are also likely doomed to repeat it.

Re: everything old is new again, Compare-and-branch vs PIC

<tnmn2a$14cmo$1@newsreader4.netcologne.de>

  copy mid

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

  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-cb-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoe...@netcologne.de (Thomas Koenig)
Newsgroups: comp.arch
Subject: Re: everything old is new again, Compare-and-branch vs PIC
Date: Sun, 18 Dec 2022 09:38:18 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <tnmn2a$14cmo$1@newsreader4.netcologne.de>
References: <b6260f7b-fbeb-4549-8579-f12c76bc5b69n@googlegroups.com>
<d3842b13-6457-4a7b-964d-ec0ce66447e2n@googlegroups.com>
<XuJlL.9383$MVg8.8632@fx12.iad> <tn9i9j$2g22f$1@dont-email.me>
<T44mL.71538$gGD7.48801@fx11.iad> <tnala2$2j5mv$1@dont-email.me>
<ffae19fc-caa4-47ce-b730-70389d9f8186n@googlegroups.com>
<tnba86$2kho9$1@dont-email.me>
<6d6de22f-53be-4275-aee4-44f6581ff0a4n@googlegroups.com>
<tnbvfc$2oj2d$1@dont-email.me>
<bc76d960-0863-49a8-8e72-0e44a684f4ben@googlegroups.com>
<2022Dec15.111358@mips.complang.tuwien.ac.at>
<tnfk0i$34fll$1@dont-email.me> <86ilia2ftu.fsf@linuxsc.com>
<tnle9g$3onv0$1@dont-email.me>
Injection-Date: Sun, 18 Dec 2022 09:38:18 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2a0a-a540-cb-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2a0a:a540:cb:0:7285:c2ff:fe6c:992d";
logging-data="1192664"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Sun, 18 Dec 2022 09:38 UTC

BGB <cr88192@gmail.com> schrieb:
> On 12/17/2022 9:46 AM, Tim Rentsch wrote:

>> The construct in question is undefined behavior. You may not
>> like what GCC and LLVM do with it, but they are not in any
>> way shape or form violating C semantics.
>
> Saying something is "undefined behavior" is kind of a weak argument IMO
> when it has otherwise "perfectly reasonable" behavior that "most older
> compilers supported, and most C code from that era accepted as canonical".

I don't suppose you have ever written code to a specification, have you?

A specification, in this case the C standard, is binding on both sides:
The compiler writer has to adhere to it (or else it's a compiler bug),
and the user has to adhere to it (or else it's a bug in the program).

The C standard allows extensions. You can rely on these _for
that particular compiler and version_ if, and only if, they are
described in the compiler's documentation. For example, a compiler
may document that int has two's complement, and is four bytes long.

If it is _not_ described in the compiler's documentation and given
as "undefined behavior" by the standard, well... undefined behavior
is what you get, which means that anything can happen.

> Undefined Behavior more makes sense for the programmer to take note of,
> when there might be implementation differences between compilers.
> Compilers treating UB as license to do whatever, is not ideal, except in
> cases where the depended on semantics are "clearly unreasonable".

Again, try to understand what a specification is.

Re: everything old is new again, Compare-and-branch vs PIC

<tnn44k$3viub$3@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.arch
Subject: Re: everything old is new again, Compare-and-branch vs PIC
Date: Sun, 18 Dec 2022 14:21:24 +0100
Organization: A noiseless patient Spider
Lines: 55
Message-ID: <tnn44k$3viub$3@dont-email.me>
References: <b6260f7b-fbeb-4549-8579-f12c76bc5b69n@googlegroups.com>
<tmtmlq$uo06$1@dont-email.me>
<45ecc365-c1f0-4bd8-b92a-4e50209095c7n@googlegroups.com>
<kM1lL.20158$iU59.5539@fx14.iad> <tn2u7j$288n$1@gal.iecc.com>
<bwnlL.106$%os8.36@fx03.iad>
<d3842b13-6457-4a7b-964d-ec0ce66447e2n@googlegroups.com>
<XuJlL.9383$MVg8.8632@fx12.iad> <tn9i9j$2g22f$1@dont-email.me>
<T44mL.71538$gGD7.48801@fx11.iad> <tnala2$2j5mv$1@dont-email.me>
<ffae19fc-caa4-47ce-b730-70389d9f8186n@googlegroups.com>
<tnba86$2kho9$1@dont-email.me>
<6d6de22f-53be-4275-aee4-44f6581ff0a4n@googlegroups.com>
<86zgbo3eb3.fsf@linuxsc.com> <tnfeme$itl$1@gioia.aioe.org>
<86r0wy2ib6.fsf@linuxsc.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 18 Dec 2022 13:21:24 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="11d3cfcddec61435f19ff9fab0acc96a";
logging-data="4180939"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/KNL6G8+naje/vJlWtHeTIXExyyQHkrPY="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.2.2
Cancel-Lock: sha1:eVREF8tKZ4a/Bq9d4pwqbouw++A=
In-Reply-To: <86r0wy2ib6.fsf@linuxsc.com>
Content-Language: en-GB
 by: David Brown - Sun, 18 Dec 2022 13:21 UTC

On 17/12/2022 15:53, Tim Rentsch wrote:
> Terje Mathisen <terje.mathisen@tmsw.no> writes:
>
>> Tim Rentsch wrote:
>>
>>> MitchAlsup <MitchAlsup@aol.com> writes:
>>>
>>> [...]
>>>
>>>> There was a recent poll on some site and 56% of Americans do not
>>>> think that Arabic numerals should be taught in schools, too; and
>>>> 15% don't have an opinion.
>>>> https://www.snopes.com/fact-check/teaching-arabic-numerals/
>>>> We are well on the way to Idiocracy.
>>>
>>> That isn't idiocy; it's illiteracy. Those aren't the same thing.
>>> Don't make the mistake of thinking someone is stupid when all they
>>> are is ignorant.
>>
>> I was going to agree with you, but realized that "willful ignorance"
>> cannot be as easily (if ever?) forgiven.
>
> My comment is about people who happen to be ignorant, not about
> people who choose to remain ignorant.
>
> Furthermore, it is still the case that one shouldn't _assume_ that
> someone is stupid just because they are ignorant. If later
> information shows signs of willful ignorance, the question of
> intelligence can always be revisited (or even just visited).
>
> Note by the way that most of the people responding to this survey
> probably didn't choose to be ignorant of the essential fact that
> our number symbols are indeed Arabic numerals. And it isn't
> obvious that including that bit of knowledge in the educational
> curriculum would yield any significant benefit. It's more
> important to teach people how to think than to fill their heads
> with zillions of miscellaneous facts (and it's disappointing that
> this basic truth is not more widely recognized).

To my mind, the key issue is not whether people do or do not know that
the normal digit system in the West is known as "Arabic numerals".
(Though I do think it is a useful thing to know, at least as a
distinction from "Roman numerals".)

The important point is that people are holding opinions, and sharing
opinions, on a topic they know nothing about. Instead of answering "I
don't know" when they don't know what "Arabic numerals" are, they jump
to a conclusion that is based at least partially on prejudice.

It's easy to fix ignorance - just teach people. It is a lot harder to
fix the long-ingrained lack of critical thinking and self-awareness that
has been idolised as "the right to your opinion" in modern times, and
has then been amplified by social media.

Re: everything old is new again, Compare-and-branch vs PIC

<tnnc3i$amv$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: sfu...@alumni.cmu.edu.invalid (Stephen Fuld)
Newsgroups: comp.arch
Subject: Re: everything old is new again, Compare-and-branch vs PIC
Date: Sun, 18 Dec 2022 07:37:22 -0800
Organization: A noiseless patient Spider
Lines: 57
Message-ID: <tnnc3i$amv$1@dont-email.me>
References: <b6260f7b-fbeb-4549-8579-f12c76bc5b69n@googlegroups.com>
<d3842b13-6457-4a7b-964d-ec0ce66447e2n@googlegroups.com>
<XuJlL.9383$MVg8.8632@fx12.iad> <tn9i9j$2g22f$1@dont-email.me>
<T44mL.71538$gGD7.48801@fx11.iad> <tnala2$2j5mv$1@dont-email.me>
<ffae19fc-caa4-47ce-b730-70389d9f8186n@googlegroups.com>
<tnba86$2kho9$1@dont-email.me>
<6d6de22f-53be-4275-aee4-44f6581ff0a4n@googlegroups.com>
<tnbvfc$2oj2d$1@dont-email.me>
<bc76d960-0863-49a8-8e72-0e44a684f4ben@googlegroups.com>
<2022Dec15.111358@mips.complang.tuwien.ac.at> <tnfk0i$34fll$1@dont-email.me>
<86ilia2ftu.fsf@linuxsc.com> <tnle9g$3onv0$1@dont-email.me>
<tnmn2a$14cmo$1@newsreader4.netcologne.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 18 Dec 2022 15:37:22 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="ef5ac411d53ee55021fecd59bc1d68c7";
logging-data="10975"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18FjsSbSsXgBgNDggHKAllWZ2Z59G1xnKI="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.6.0
Cancel-Lock: sha1:IoiCCMS4iVPbX1/FP/S4n3klmHY=
Content-Language: en-US
In-Reply-To: <tnmn2a$14cmo$1@newsreader4.netcologne.de>
 by: Stephen Fuld - Sun, 18 Dec 2022 15:37 UTC

On 12/18/2022 1:38 AM, Thomas Koenig wrote:
> BGB <cr88192@gmail.com> schrieb:
>> On 12/17/2022 9:46 AM, Tim Rentsch wrote:
>
>>> The construct in question is undefined behavior. You may not
>>> like what GCC and LLVM do with it, but they are not in any
>>> way shape or form violating C semantics.
>>
>> Saying something is "undefined behavior" is kind of a weak argument IMO
>> when it has otherwise "perfectly reasonable" behavior that "most older
>> compilers supported, and most C code from that era accepted as canonical".
>
> I don't suppose you have ever written code to a specification, have you?
>
> A specification, in this case the C standard, is binding on both sides:
> The compiler writer has to adhere to it (or else it's a compiler bug),
> and the user has to adhere to it (or else it's a bug in the program).
>
> The C standard allows extensions. You can rely on these _for
> that particular compiler and version_ if, and only if, they are
> described in the compiler's documentation. For example, a compiler
> may document that int has two's complement, and is four bytes long.
>
> If it is _not_ described in the compiler's documentation and given
> as "undefined behavior" by the standard, well... undefined behavior
> is what you get, which means that anything can happen.
>
>> Undefined Behavior more makes sense for the programmer to take note of,
>> when there might be implementation differences between compilers.
>> Compilers treating UB as license to do whatever, is not ideal, except in
>> cases where the depended on semantics are "clearly unreasonable".
>
> Again, try to understand what a specification is.

I think it may be useful in this discussion to differentiate between
behavior that is documented in the specification as "undefined", and
behavior that is not documented in the specification at all, but a
particular compiler may implement in a particular way. Let's call the
latter "undocumented" to make the difference clear.

If a user relies on some behavior that is documented as undefined, then,
to me, he has no valid complaints if it changes, and the implementer is
not at fault.

On the other hand, if a user relies on some undocumented behavior, then,
to me, there is some responsibility on the part of the
specification/compiler writers to clarify the situation. If only one
interpretation is common, then it should be documented in the
spec/compiler documentation. In the case where multiple behaviors are
used, the documentation should make it clear which is being used.

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


devel / comp.arch / Re: everything old is new again, Compare-and-branch vs PIC

Pages:123456789101112131415161718192021222324
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor