🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.arch
Article #612

Re: vector length CSR?

#612
From: Robert Finch
Date: Mon, 09 Nov 2026 12:03
91 lines
6175 bytes
On 2026-11-09 1:13 a.m., Anton Ertl wrote:
> Lawrence =?iso-8859-13?q?D=FFOliveiro?= <ldo@nz.invalid> writes:
>> RISC-V is going against the prevailing fashion on this. Most other CPU
>> architectures in common use implement loads of SIMD instructions with
>> fixed vector lengths that are typically quite short: e.g. 4 or 8
>> elements. The reason why you need loads of different instructions is
>> because you want to cover all the possible combinations of operand
>> types that a programmer might find useful.
>>
>> The RISC-V designers quite rightly criticize this combinatorial
>> explosion of instruction variants as going completely against the
>> whole idea of a *reduced* instruction set computer (which is what
>> "RISC" is supposed to stand for).
> 
> Given that Patterson (who coined the term RISC) never gave a
> definition of RISC, how can one say that the combinatorial explosion
> is right or wrong?
> 
> John Mashey gave criteria for determining the RISC-ness of an
> intruction set
> <https://userpages.umbc.edu/~vijay/mashey.on.risc.html>, and I found
> his arguments convincing (although I do not agree fully with all of
> his criteria, in particular, not 3a-c, and 5a and consequently 5b).
> The number of instructions is not one of the criteria he gave.
> 
> In particular, if we look at AVX and AVX-512 instructions,
> 
> 1) The gather and scatter instructions are against RISC criteria
>     (Mashey criterion 4b), and on Skylake are slow, and already have
>     resulted in the Downfall vulnerability.
> 
> 2) The load-and-operate variants of the instructions are against
>     Mashey's criterion 4a, and while other criteria (in particular
>     3a-3c) are not satisfied by all CPUs that are typically seen as
>     RISC, this criterion has been satisfied by all of them.  One can
>     see the bad effects of the load-and-operate variants as well as the
>     bad effects of making the destination operand one of the sources
>     (not a Mashey criterion) in the FMA3 instructions, which come in
>     132, 213, and 231 variants depending on which source operand should
>     be overwritten and which should be in memory.
> 
> 3) AVX and AVX-512 are part of AMD64, so naturally they do not satisfy
>     criteria 3a and 3b.
> 
> If you leave away the gather-and-scatter instructions, and the
> load-and-operate variants, and encode the rest to fit in 32 bits (and
> leave room for the integer instruction set:-), and reduce the offset
> of load/store instructions to make this possible, AVX-512 still has
> hundreds, maybe thousands of instructions thanks to the combination of
> operations, types, lane (element) sizes, operation width, but
> satisfies Masheys criteria.
> 
> The RISC-V designers may want to add the number of instructions as
> another criterion, but I think they would be wrong.  The advantages of
> the RISC principles do not hinge on the number of instructions.
> 
> If they want to encode some of the "combinatorial explosion" stuff in
> registers that are implicitly used by the SIMD instructions, that's
> actually against the trend in at least some of the RISCs, in
> particular MIPS (with hi and lo as the exception that proves the rule)
> and Alpha, and RISC-V without the vector stuff, to avoid implicit (and
> thus single-instance) registers; this rule has shown its value in
> particular when OoO was introduced (no need to rename the condition
> codes).
> 
> One might have several registers containing the type and widths, and
> refer to them in the instruction, and this would reduce the problems
> of this approach a little.  But a problem remains: Implementors want
> to know the registers that the instruction operates on in the renamer,
> and the type that they work on when entering the schedulers (not every
> microarchitecture has just one scheduler that covers everything), so
> these informations need to be provided at the front end, and
> instructions that change these registers need to be executed at the
> front end, subverting OoO implementations.
> 
> There is a reason why we have encoded the instruction type and width
> into scalar instructions, and this reason does not go away when it
> comes to vector instructions.  And just because this good practice
> inreases the instruction count, does not make it a bad practice, even
> if the result is a combinatorial explosion.
> 
> - anton

Thanks, John Mashey's criteria is somewhat biblical. It looks like I 
start working on the next version of Qupls as the current version has 
some flaws. The operand size should be spec'd as part of the 
instruction. Got to avoid a level of indirection by using registers to 
specify things. It would be going a bit backwards to an earlier version 
that had just 32 visible regs, but also 32 vector regs.

Technical Details
Message-ID: <11cscr1$17673$1@dont-email.me>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
References: <11cpqih$acf5$1@dont-email.me> <11cr2g5$q796$2@dont-email.me> <2026Nov9.071302@mips.complang.tuwien.ac.at>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: Robert Finch <robfi680@gmail.com>
Newsgroups: comp.arch
Subject: Re: vector length CSR?
Date: Mon, 9 Nov 2026 07:03:43 -0500
Organization: A noiseless patient Spider
Lines: 91
Message-ID: <11cscr1$17673$1@dont-email.me>
References: <11cpqih$acf5$1@dont-email.me> <11cr2g5$q796$2@dont-email.me>
 <2026Nov9.071302@mips.complang.tuwien.ac.at>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 09 Nov 2026 12:03:46 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="1284323"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX18XFo+k5oMJTbp49t26vBH3t7aG5YHIwfM="; posting-host="8d142e80b045612c9ce8c854af1487a2"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:F51gwN9UHhbT8CughTS/ysFUhaw= sha256:2KLpOBCRCH8eaU2m0fqbXdmRgOF/3J+STTIYomCREig=
	sha1:cqyoY9WD1GXdmDhLG/djjjqu5dw= sha256:S8Knwsk5MU90IIFeFqZt++f9oQUgNd358TJajJABJU4=
In-Reply-To: <2026Nov9.071302@mips.complang.tuwien.ac.at>
Content-Language: en-US