🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.arch
Article #613

Re: vector length CSR?

#613
From: Stephen Fuld
Date: Mon, 09 Nov 2026 17:08
118 lines
6220 bytes
On 11/8/2026 3:17 PM, George Neuner wrote:
> On Sun, 8 Nov 2026 10:03:01 -0500, Robert Finch <robfi680@gmail.com>
> wrote:

Big snip

>> Vectors are supported using the GPR register
>> file by hiding the issuing of multiple instructions behind the scenes
>> and relying on parallelism in the OoO design.

Good.

>> How vectors are supported in Qupls may need re-thinking. 

Agreed.

big snip


> Note that I'm primarily a software person.  And I don't know anything
> about your particular design.  My own musings follow. Feel free to
> ignore them as I only can consider the problem from the POV of using
> the CPU.

I am in the same position.

> I understand that you want to stream vectors through your CPU, using
> your general registers to do the processing.  Sounds similar to what
> Mitch is trying to achieve with his "My 66000".
Yes, although he is talking about various "configuration" registers for 
things like vector length, element size, etc. which My 66000's VVM 
doesn't need.


> Depending on how many sources (args) per instruction, and whether you
> have only reg->reg or memory loadops, and whether you have full length
> instruction constants, it seems that vector operations are going to
> require 1 to 3 registers per element.
> [If you can fix the number of registers per element, that will help.]
> 
> Regardless of how many registers (or names) you have, undoubtedly
> there will be vectors that are too long to handle without looping, and
> there will be vectors whose lengths are not integer multiples of
> however many elements an iteration can do in parallel.
> [You always can fall back on 1 element per iteration.]

All issues that simply go away with VVM.  Or at least "go away" for the 
programmer.  The hardware must still handle them, though.


> The question is how smart you want your CPU to be.

Yes.  I don't know how much "smarts" VVM requires in the hardware.



> With vector lengths known at compile time, the compiler can unroll the
> loop to figure out how many iterations of N elements, and handle
> remaining (< N) elements separately. This requires no vector specific
> smarts in your CPU.
> 
> 
> If you want to do the moral equivalent of unrolling at runtime ...
> well that's another thing altogether.  I confess that I don't fully
> understand what Mitch is doing, and from your comments above I get the
> idea that you really don't yet know how you want to handle it.


While I don't understand the details or how complex the hardware is 
behind the scenes, but from a programmer's point of view, VVM is very 
simple, in fact I would argue simpler than than all those SIMD 
instructions, extra reconfiguration registers, etc.

The steps in writing code for VVM which would replace a sequence of SIMD 
instructions are ISTM, the following:

	Pretend you have no "special" instructions and are going to write a 
"traditional" loop to process whatever vectors you have in the way you 
need to to solve your problem.

	Write a sequence of "ordinary" scalar instructions to essentially 
process one element of the vectors you are dealing with. This is the 
"guts" of the processing that is conceptually in the innermost loop over 
the vectors you are processing and would replace the sequence of SIMD 
instructions.  There are a few restrictions to what instructions you can 
use, e.g. no jumps, but you can use predicated instructions, a limit on 
the number of instructions.

	Put a LOOP instruction after the last instruction you wrote above. 
This includes the loop termination conditions.

	Lastly, and this includes the only part that is has something 
conceptually different from a simple scaler loop, add a VEC instruction 
at the beginning of the sequence.  The different part is that this 
instruction includes information about which registers are needed to be 
"correct" after the loop terminates.


The hardware does it magic.  No need for you, the programmer, to worry 
about special length registers, element packing (just load bytes, half 
words, words or double words as required) how to break down processing 
into "chunks" the size of SIMD registers, no mask registers, etc.

 From a programmer's  POV, once you "get it", it is much simpler than 
the SIMD approach (no new instructions to learn, a lot less to have to 
think about), and has the advantage of not requiring rethinking the code 
for the next iteration of SIMD instructions.

I can't speak to the hardware complexity of the implementation.  Perhaps 
that is a limiting factor.  But barring that, and the mental effort 
required to "reorient" your thinking, I don't see why any new clean 
sheet design would use SIMD instructions.  Perhaps someone can explain 
why it should.


-- 
  - Stephen Fuld
(e-mail address disguised to prevent spam)
Technical Details
Message-ID: <11csull$1ef6e$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: <11cpqih$acf5$1@dont-email.me> <sgu0flpndaqltpdbft40fghmi7vk78q2hs@4ax.com> <11cq2v7$dh5b$1@dont-email.me> <8jk1fl182pskj3fsmp4ju6qf420pgl0htg@4ax.com>

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: Stephen Fuld <sfuld@alumni.cmu.edu.invalid>
Newsgroups: comp.arch
Subject: Re: vector length CSR?
Date: Mon, 9 Nov 2026 09:08:03 -0800
Organization: A noiseless patient Spider
Lines: 118
Message-ID: <11csull$1ef6e$1@dont-email.me>
References: <11cpqih$acf5$1@dont-email.me>
 <sgu0flpndaqltpdbft40fghmi7vk78q2hs@4ax.com> <11cq2v7$dh5b$1@dont-email.me>
 <8jk1fl182pskj3fsmp4ju6qf420pgl0htg@4ax.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 09 Nov 2026 17:08:06 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="1522894"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19bsy0RTSo5y5be6PIWrJJJHuP3VprUVs0="; posting-host="a7bb48c8c1bc225d643611b270d02081"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:7f/X6AWe7h9YMSf1EOAtjipE1mw= sha256:uDfHrvId1lY00s4dzKCYB3iBEQeYhmZBtzvrbJVP2m4=
	sha1:l5UGpVwQhNbM5ga7fAbRb7o9Zlw= sha256:gSWreSR+znme6UcGnXpDj9HzJwjoz5Pp/VEBO6LsUi0=
In-Reply-To: <8jk1fl182pskj3fsmp4ju6qf420pgl0htg@4ax.com>
Content-Language: en-US