🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.arch
Article #808

Re: Concertina IV Again?

#808
From: Thomas Koenig
Date: Thu, 19 Nov 2026 10:30
70 lines
3495 bytes
John Savard <quadibloc@invalid.com> schrieb:
> On Tue, 17 Nov 2026 20:55:29 GMT, MitchAlsup
><user5857@newsgrouper.org.invalid> wrote:
>
>>My bet is that you end up wanting more pointers (base registers) than
>>index registers--simply because modern code points at a lot of things
>>but indexes few.
>
> That's a good point. And, indeed, if I have a pointer, to use it I
> would store it in a base register.
>
> Presumably, I would store it in a base register with a 12-bit
> displacement, since the displacement is just going to be zero anyways.

Not when you access member of a struct.

> Except that I found room, along with relative addressing and Array
> Mode addressing, for register indirect addressing. So I can already
> use not only all 32 regular integer registers, but all 128 registers
> in the extended integer register bank, as pointers.
>
> Pointers being taken care of, I can worry about more index
> registers... _if_ there's any need for them.

  for (int i=0; i<n; i++)
    a[i] = b[i] + c[i];

saves you a few instructins with index registers.  This is code on
aarch64:

my_add:
        cbz     x3, .L1
        mov     w4, 0
.L3:
        ldr     d31, [x0, x4, lsl 3]
        ldr     d30, [x1, x4, lsl 3]
        fadd    d30, d31, d30
        str     d30, [x2, x4, lsl 3]
        add     x4, x4, 1
        cmp     x3, x4
        bne     .L3
.L1:
        ret

so it uses x3 as index register for all three accesses.  And this is
RISC-V:

my_add:
        beq     a3,zero,.L1
        slli    a3,a3,3
        add     a3,a0,a3
.L3:
        fld     fa5,0(a0)
        fld     fa4,0(a1)
        addi    a0,a0,8
        addi    a1,a1,8
        fadd.d  fa5,fa5,fa4
        addi    a2,a2,8
        fsd     fa5,-8(a2)
        bne     a0,a3,.L3
.L1:
        ret

It has no indexed addressing, so it needs three add instructions for all
three pointer accesses.

-- 
This USENET posting was made without artificial intelligence,
artificial impertinence, artificial arrogance, artificial stupidity,
artificial flavorings or artificial colorants.
Technical Details
Message-ID: <11dmj4u$258j4$1@dont-email.me>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
References: <6af629a7.27886218@news.eternal-september.org> <1794532970-5857@newsgrouper.org> <6afbcf18.68729046@news.eternal-september.org> <11dgvrm$78c1$1@dont-email.me> <6afc6aa5.516750@news.eternal-september.org> <6afc81b2.6417328@news.eternal-september.org> <6afc9eef.13902343@news.eternal-september.org> <1794948929-5857@newsgrouper.org> <6afce17f.30942703@news.eternal-september.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: Thomas Koenig <tkoenig@netcologne.de>
Newsgroups: comp.arch
Subject: Re: Concertina IV Again?
Date: Thu, 19 Nov 2026 10:30:54 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 70
Message-ID: <11dmj4u$258j4$1@dont-email.me>
References: <6af629a7.27886218@news.eternal-september.org>
 <1794532970-5857@newsgrouper.org>
 <6afbcf18.68729046@news.eternal-september.org>
 <11dgvrm$78c1$1@dont-email.me> <6afc6aa5.516750@news.eternal-september.org>
 <6afc81b2.6417328@news.eternal-september.org>
 <6afc9eef.13902343@news.eternal-september.org>
 <1794948929-5857@newsgrouper.org>
 <6afce17f.30942703@news.eternal-september.org>
Injection-Date: Thu, 19 Nov 2026 10:30:54 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="2269796"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX18ozTQn3OBZyM4C+9HzCfwsVmYZL02qn1A="; posting-host="0ad3151e3bbdab8598ee465797a16a02"
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:CuhW63zePp6f3Bjrt0ZRlN48l9I= sha256:WNGjubvLflSuUTskjCuyLRr+Q8RenyRsv6bvkr7bS3s=
	sha1:GOOE1IYcKzBbwOqPyAA0dtddEFQ= sha256:EmHxWrfHHZYuB97fdqHRQvYlK/RvDEmwzqSUE0F98hY=