🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

179 total messages Page 2 of 4 Started by Robert Finch Sun, 08 Nov 2026 12:39
Page 2 of 4 • 179 total messages
Re: CISC are not "unreduced"
#650
Author: Stefan Monnier
Date: Wed, 11 Nov 2026 15:23
24 lines
2547 bytes
MitchAlsup [2026-11-11 00:38:19] wrote:
> Stefan Monnier <monnier@iro.umontreal.ca> posted:
>> Indeed.  And one of the motivations behind the CISC evolution was the
>> famed "semantic gap", which pushed towards rather fewer instructions
>> that are more flexible, regular, and powerful.
>> 
>> The million instructions of AES don't feel very CISCy to me.
>
> Nor does a million instructions of AES feel very RISCy to me.

Yeah, if we take CISC as motivated by the desire to provide an assembly
language that is comfortable for humans, we can also take RISC as
motivated by the desire to provide an assembly language that's
convenient for compilers (which would rather not need to worry about
tradeoffs between using LD+ADD+ST vs using some fancy addressing mode
on ADD).

From that point of view, AES is neither CISCy nor RISCy because it's
convenient only for the CPU implementors.

[ In contrast, vVM is definitely RISCy from that standpoint.  ]


=== Stefan
Re: vector length CSR?
#648
Author: Michael S
Date: Wed, 11 Nov 2026 20:47
36 lines
2721 bytes
On Tue, 10 Nov 2026 22:02:12 -0000 (UTC)
John Levine <johnl@taugh.com> wrote:

> It appears that Anton Ertl <anton@mips.complang.tuwien.ac.at> said:
> >There used to be memory-to-memory vector machines, and there used to
> >be vector machines with vector registers, like the Cray-1.   
> 
> There still are.  zSeries has 16 vector registers and an impressively
> overimplemented set of vector ops including integers, IEEE floats,
> strings, and packed decimal.
> 
> It's not clear who this is for, but presumably there are customers
> that wanted them enough to add them.
> 

I would think that current zSeries vector registers and an engine they
feed belong to the same school of thought as Intel/AMD AVX512 or
Fujitsu A64Fx and their SPARC CPUs with fx suffix or IBM's own
scalar/vector facility on POWER. That is quite different school from
CRAY-1 or CRAY-YMP.
The difference is size of 'beats'.
Intel/AMD/Fujitsu/POWER and I suppose modern zSeries have beats=1 or 2.
Rarely 4, typically only on low end implementations.
On CRAY 'beats' was from 64 to 16.

IMHO, as long as one has cache beats > 8 is a very bad idea.


Of course, most zSeries also has outer-product accelerator, which is
completely different cattle of fish - not very useful for things that
do not resemble matrix multiplication, but very very useful for things
that do resemble it.



Re: vector length CSR?
#649
Author: BGB
Date: Wed, 11 Nov 2026 21:20
103 lines
5441 bytes
On 11/10/2026 6:34 PM, MitchAlsup wrote:
> anton@mips.complang.tuwien.ac.at (Anton Ertl) posted:
> 
>> /ERROR "unexpected byte sequence starting at index 590: '\xC3'" while decoding/:
>>
>> MitchAlsup <user5857@newsgrouper.org.invalid> writes:
>>> anton@mips.complang.tuwien.ac.at (Anton Ertl) posted:
>>>> Mashey (and IIRC also Patterson) also discuss the technical background
>>>> behind the commonalities in RISCs, so while you may consider the way
>>>> that the criteria were derived to be circular, they are not
>>>> accidental.
>>>
>>> Don't leave out Mark Horowitz
>>
>> Duckduckgo does not give me any papers, or web pages about RISC
>> definition when I ask it for "Mark Horowitz RISC", unlike for "John
>> Mashey RISC".  Do you have a specific paper or web page in mind?
> 
> "Architectural Tradeoffs in the Design of MIPS-X" Horowitz and Chow
>   
>>> Given {signed, Unsigned}×{Byte, halfword, word, doubleword} one has
>>> 8 integer ADDs,
>>
>> SPARC and Power have only one add instruction.  With a load-store
>> architecture, you need only one, the full-width one.
> 
> If you like LLVM compilers having to constrain ADD results with
> SEXT/ZEXT, sure, and you also don't get integer overflow performed
> properly (assuming you want it done at all).
> 
> LLVM takes the (somewhat convoluted) vision that a result in a
> register is range limited to the exact value-set as one stored
> in memory.
> 

That is "safe", and mostly matches C.

One trick though in a compiler is to flag intermediate values for cases 
where they may be out of range, and then lazily enforce range if the 
variable is used in a way where this matters.

Say, adding two char or short variables may produce a temporarily 
out-of-range result, but this can be ignored if it is being immediately 
stored to memory, but the compiler needs to add-in the sign/zero 
extension if it then goes into an arithmetic operation or would flow out 
of the current basic block.


Otherwise one would need some rarely-used 8 and 16 bit ADD variants.

Sign and zero extension ops for the common sizes is a solid "nice to 
have" though (using a pair of shifts kinda sucks).


>>                                                        Only with
>> load-and-add instructions, you need to specify the width in the
>> addition, and whether you want the loaded value to be sign-extended or
>> zero-extended (although I think most have only one variant of every
>> length).  You also then have to ask yourself if you want to perform
>> the addition to the full width of the register, or just the width of
>> the loaded value, and sign- or zero-extend the result.  I see no good
>> reason to add only to the width of the loaded value, but that's how
>> AMD64 works.
> 
> Any language that requires the register-allocated variable to be range
> constrained exactly like those residing in memory has that property.
>   

This is a place where pure RISC-V kinda sucks:
  int x, y, z;
  ...
  z=x+y;  //fine, ADDW so all is good.
  ...


But:
   unsigned int ux, uy, uz;
   ...
   uz=ux+uy;  //worse.
   ...
Standard ABI makes this operation cheaper than it would have been 
otherwise, but in a stupid way that makes more problems than it solves.

Then:
   short sx, sy, sz;
   ...
   sz=sx+sy;  //well, crap.
   ...
This case is going to kinda suck in RV.


>> The nice thing about load/store architectures is that you can separate
>> these concerns.
> 
> There are side effects wrt HLLs that are not addresses with that view point.
>   
>> Have all 7 variants of loads (lbu lbs lsu lss lmu lms ll), four
>> variants of store (sb ss sm sl), do addition at full width, and have
>> various zero- and sign-extending instructions in the cases where they
>> are needed (usually not in connection with addition).
>>
>> - anton
Re: vector length CSR?
#651
Author: Michael S
Date: Wed, 11 Nov 2026 22:14
39 lines
3253 bytes
On Wed, 11 Nov 2026 09:37:08 GMT
anton@mips.complang.tuwien.ac.at (Anton Ertl) wrote:

> Stefan Monnier <monnier@iro.umontreal.ca> writes:
> >> My impression is that VVM can only do what memory-to-memory vector
> >> machines could do, but does not have a good story for those tasks
> >> where the vector/SIMD registers are used several times.  
> >
> >Presumably caches could be used to get comparable results.  
> 
> Let's take Zen6 (because its capabilities have just been reported on
> <https://chipsandcheese.com/p/amds-zen-6-family-feeding-the-beast>):
> 
> It can do 2 512-bit FMAs per cycle, each consuming 3 512-bit inputs
> and generating 1 512-bit output, and, e.g. matrix multiplication can
> get a good utilization from these units.
> 
> So in the worst case, if you need all the inputs from caches and
> outputs to caches, you would need to be able to perform 6 512-bit
> loads and 2 512-bit stores per cycle.  The actual Zen6 can perform 2
> 512-bit loads and (?) 1 512-bit store per cycle (and it's unclear from
> the graphics whether the 2 loads and 1 store can happen in the same
> cycle).
> 
> It may be possible to reduce the number of needed load or store ports
> a little for matrix multiplication in VVM, e.g., by computing the sum
> of several multiplications before storing, and/or by performing
> multiplications of a vector with a scalar (SAXPY-style).  Fortunately,
> matrix multiplication provides lots of freedoms in rearranging the
> computation.  Nevertheless, I would be surprised if one could achieve
> the same FPU/LSU ratio with VVM as one can achieve with AVX-512.
> 
> - anton

I will be impressed if (for matmul) Mitch demonstrates 1/3rd of
performance per clock of server-grade Intel's or Zen5 AMD.
Especially for single precision.

Re: RISC vs CISC
#652
Author: Lawrence D’Oliveiro
Date: Wed, 11 Nov 2026 22:23
11 lines
1933 bytes
On Wed, 11 Nov 2026 14:37:02 -0600, BGB wrote:

> And people keep over-relying on optimizing designs for the SPEC
> benchmark, rather than across larger and more varied codebases (that
> would ideally not cost money to access).

Being able to run a Linux kernel seems like a good benchmark to
include these days: a typical build takes a few million lines of
source, and real-world performance is critical across a wide range of
software applications and hardware setups, given how popular Linux has
become.
Re: vector length CSR?
#653
Author: Anton Ertl
Date: Wed, 11 Nov 2026 22:28
87 lines
4919 bytes
MitchAlsup <user5857@newsgrouper.org.invalid> writes:
>anton@mips.complang.tuwien.ac.at (Anton Ertl) posted:
>> SPARC and Power have only one add instruction.  With a load-store
>> architecture, you need only one, the full-width one.
>
>If you like LLVM compilers having to constrain ADD results with
>SEXT/ZEXT, sure, and you also don't get integer overflow performed
>properly (assuming you want it done at all).

Actually, it's easier to determine overflow of, e.g., half-width
addition, if you use full-width addition to do it: If the result of,
e.g., d=a+b+c does not have the same values for bits 31..63, there has
been an overflow.  It's a checking analogon of sign extension.  And
the cool thing is that it only checks the end result, not intermediate
operations.

But if you think it's reasonable to trap on an immediate overflow even
if the end result is in range, nobody forbids doing the check after
every step.  Or, if you prefer flags, have flags not just for
full-width overflow, but also for half-width overflow, for
quarter-width overflow, and for byte overflow.

>LLVM takes the (somewhat convoluted) vision that a result in a
>register is range limited to the exact value-set as one stored
>in memory.

Let's test that theory:

int foo(int a, int b, int c)
{
  return a+b+c;
}

Use clang-19 on a Power9 machine to compile this, and disassemble the
result:

clang -O3 -c xxx.c && objdump -d xxx.o

Here's the disassembly of foo():

0000000000000000 <foo>:
   0:   14 1a 64 7c     add     r3,r4,r3
   4:   14 2a 63 7c     add     r3,r3,r5
   8:   b4 07 63 7c     extsw   r3,r3
   c:   20 00 80 4e     blr

I get the same result when foo() is defined as:

int foo(int a, int b, int c)
{
  int d=a+b;
  return d+c;
}

Nope, no sign-extending every result in a register.  Only the end
result is sign-extended, because the ABI of Power demands sign
extension for signed ints.  With current C coding practices, using
don't-care extension when returning ints might be possible, but in the
1990s when the Power 64-bit ABI was designed, there were enough
function calls without or with wrong prototypes that requiring
sign-extension for signed ints resulted in significantly less
breakage.

>>                                                       Only with
>> load-and-add instructions, you need to specify the width in the
>> addition, and whether you want the loaded value to be sign-extended or
>> zero-extended (although I think most have only one variant of every
>> length).  You also then have to ask yourself if you want to perform
>> the addition to the full width of the register, or just the width of
>> the loaded value, and sign- or zero-extend the result.  I see no good
>> reason to add only to the width of the loaded value, but that's how
>> AMD64 works.
>
>Any language that requires the register-allocated variable to be range
>constrained exactly like those residing in memory has that property.

Apart from assembly languages, I don't know any languages that have
any requirements for "register-allocated variable".  As for the
requirement for variables in general, they usually do not specify what
the bits beyond the bits needed to represent the type should look
like.  ABIs do, but they are all over the place, and only relevant at
call boundaries.

- anton
-- 
'Anyone trying for "industrial quality" ISA should avoid undefined behavior.'
  Mitch Alsup, <c17fcd89-f024-40e7-a594-88a85ac10d20o@googlegroups.com>
Re: vector length CSR?
#699
Author: Paul Clayton
Date: Thu, 12 Nov 2026 01:50
25 lines
2801 bytes
On 11/10/26 4:15 PM, Anton Ertl wrote:
[snip]
> Have all 7 variants of loads (lbu lbs lsu lss lmu lms ll), four
> variants of store (sb ss sm sl), do addition at full width, and have
> various zero- and sign-extending instructions in the cases where they
> are needed (usually not in connection with addition).

Side comment: With seven variants of store, one could check for
information loss in truncating. Doing such in software might
require more than one extra instruction (though one could
provide a trap on "outside container" instruction and perhaps
generalize the operation to fit other useful tests that rarely
fail). (Using a branch instruction would waste instruction space
to provide the offset, so trapping [for what is probably a fatal
error] seems better, to me.)

Of course, one might then argue that non-trapping variants might
be desired (if disabling those traps with a mode was too coarse-
grained) to avoid having to explicitly truncate the value before
storing.

I do not think such information loss (sub-word overflow
detection) is considered important enough to use three more
major opcodes. Even My 66000, which has some emphasis on
security, does not (as I recall) check for improper truncation.
Re: CISC are not "unreduced"
#654
Author: MitchAlsup
Date: Thu, 12 Nov 2026 02:32
75 lines
3963 bytes
BGB <cr88192@gmail.com> posted:

> On 11/10/2026 11:08 AM, Stefan Monnier wrote:
> > David Brown [2026-11-10 10:31:47] wrote:
> >> It is also, I think, helpful to consider RISC as the "opposite" of
> >> CISC - and Complex Instruction Set Computer cannot really be
> >> interpreted as meaning anything other than that the instructions are
> >> "complex".  By comparison, with RISC the /instructions/ are "reduced".
> > 
> > Indeed.  And one of the motivations behind the CISC evolution was the
> > famed "semantic gap", which pushed towards rather fewer instructions
> > that are more flexible, regular, and powerful.
> > 
> 
> I can note that one goal I pushed for in my ISA design was to reduce 
> executed instruction counts without raising the level of abstraction
> or having complex logic.

For my part, My 66000 was restricted to not add more than 1 gate of delay 
per cycle to any stage of the pipeline.
 
> Though, this mostly ends up creating a pressure towards a larger GPR 
> space and having the ability to encode larger immediate and displacement 
> fields and similar for the cases where spills were common.

I did not find that, given that I waste no registers for immediates or
displacements.
 
> Also the LUI+ADDI scheme used by RISC-V, while very effective as a 
> fallback case for a 32-bit machine, falls on its face for 64-bit 
> machines. Also the design of the ISA starts to fall on its face the 
> moment one has a struct or similar that is larger than 2K.
> 
> So:
>    LUI+ADD+LW/SW => Sucks...
> Well, and:
>    SLL+ADD+LW/SW => Also sucks.
> ...

And the only thing that always works is:

     MEM   Rd,[Rbase,Rindex<<scale,#displacement{32 or 64}]

You can access anything anywhere in a 64-bit VAS in 1 instruction--
including transferring control through GOT.

-------------------
> And, like, if one were doing a lot of work with JPEG or similar, a case 
> could be made for things like YUV -> RGB converters and similar. 
> Nevermind the specific version of YUV.
> 
> Some of my stuff used an approximation, say:
>    Y=(4*G+3*R+B)/8; U=(B-Y)/2+128; V=(R-Y)/2+128;
> 
> Which while not an exact match for the standard color spaces, is "close 
> enough". If mashing the result into RGB555 it may not really matter. 
> Could be realized relatively affordably in a hardware implementation.
> 
> Well, and say:
>    Y=(9*G+5*R+2*B)/16;
>    ...
> Would be more accurate, but slightly less cheap to convert back to RGB 
> (even if, yes, these factors still allow the multiplications to be done 
> via a LEA instruction or similar; it results in the reverse-side Green 
> conversion no longer being a plain shift).
> 
> Say:
>    G=(8*Y-3*R-B)>>2;
> Vs:
>    G=((16*Y-5*R-2*B)*57)>>9;

My point on all of this is to find a way to avoid approximations and
get the well defined math done cheaply.
 
Re: CISC are not "unreduced"
#655
Author: Andy Valencia
Date: Thu, 12 Nov 2026 03:53
15 lines
1847 bytes
Stefan Monnier <monnier@iro.umontreal.ca> writes:
> Yeah, if we take CISC as motivated by the desire to provide an assembly
> language that is comfortable for humans, we can also take RISC as
> motivated by the desire to provide an assembly language that's
> convenient for compilers (which would rather not need to worry about
> tradeoffs between using LD+ADD+ST vs using some fancy addressing mode
> on ADD).

That said, MIPS was a remarkably comfortable instruction set in which
to hand-write assembly.

Andy Valencia
Home page: https://www.vsta.org/andy/
To contact me: https://www.vsta.org/contact/andy.html
No AI was used in the composition of this message
Re: vector length CSR?
#656
Author: Anton Ertl
Date: Thu, 12 Nov 2026 05:55
30 lines
2542 bytes
John Levine <johnl@taugh.com> writes:
>It appears that Anton Ertl <anton@mips.complang.tuwien.ac.at> said:
>There still are.  zSeries has 16 vector registers and an impressively
>overimplemented set of vector ops including integers, IEEE floats,
>strings, and packed decimal.

Any relation to the vector facility of the 3090 model 9021/9121?

I see on
<https://en.wikipedia.org/wiki/Z/Architecture#Vector_facility> that
the z13 (from 2015) introduced a vector facility with "32 vector
registers, each 128 bits wide".  Have they introduced long vectors in
addition?  About the vector facility of the z13 Wikipedia says:

|The older vector processor facility first introduced from the IBM 3090
|and also supported in the ES/9000 is not supported in z/Architecture.

>It's not clear who this is for, but presumably there are customers
>that wanted them enough to add them.

One idea might be that auto-vectorization was becoming widespread in
2015 (with gcc and LLVM doing it), probably with exaggerated
expectations concerning its efficacy.  So a reason for adding these
instructions might be FOMO on the side of the s390x architects and/or
their customers.

- anton
-- 
'Anyone trying for "industrial quality" ISA should avoid undefined behavior.'
  Mitch Alsup, <c17fcd89-f024-40e7-a594-88a85ac10d20o@googlegroups.com>
Re: CISC are not "unreduced"
#658
Author: Anton Ertl
Date: Thu, 12 Nov 2026 06:21
89 lines
5872 bytes
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>Yeah, if we take CISC as motivated by the desire to provide an assembly
>language that is comfortable for humans, we can also take RISC as
>motivated by the desire to provide an assembly language that's
>convenient for compilers (which would rather not need to worry about
>tradeoffs between using LD+ADD+ST vs using some fancy addressing mode
>on ADD).

The fancy addressing mode is the same whether you use it with a LD, a
ST, or an ADD.

Compilers actually have no problem using that addressing mode,
especially in an architecture like VAX: When the variable resides in a
register, use a register, when it's in memory, use the appropriate
addressing mode.

It's just that with the 16 registers of S/360 and a compiler that
allocates variables into registers, most accesses are to registers.

And the more fancy addressing modes are not difficult for the
compiler, either (optimality is more difficult, but for trees has been
reached with tree-parsing, as used in burg or iburg).  But these
addressing modes are not used much, not by compilers, nor by humans
(IIRC the IBM 801 group looked at existing S/370 code), because the
corresponding access patterns are not used much.

The IBM 801 group included hardware and compiler people, so they were
aware of what compilers could do, and also what hardware would run
fast, and when they aimed to achieve a very fast machine, they created
at RISC.

The Berkeley RISC projects included no compiler people, and they just
wanted to avoid the complexities of architectures like VAX, and also
arrived at RISC (but with register windows).

The Stanford MIPS projects included compiler people, so they worked on
designing an architecture that leaned on compilers, in particular
including architectural load-delay slots.

One famous example of a CISC instruction is the VAX CALL instruction,
famous for its slowness.  Compilers had no problem generating it.  It
just was faster to use something based on BSR.  But I think that the
compiler that used BSR for better speed instead also used a different
calling convention that did not have all the features of the VAX CALL,
which gave cross-language support for various tools such as debuggers.

We have learned how to do such tools with the more efficient calling
conventions we use now, but that does cost a lot of complexity in the
tools: Generating and using DWARF information etc.  Ok, DWARF is not
just about calling conventions, but it might be interesting to
consider how much simpler debugging information would be with VAX
CALLs.

In any case, the minimum configuration for a VAX apparently was 128KB
(one memory controller with the minimum amount of memory), so having
one CALL instruction with a calling convention that made it easy to
write a cross-language debugger was a benefit that the VAX architects
considered worth the performance cost.  They also provided BSR, if
speed was more important than debugability (probably for helper
routines).

>From that point of view, AES is neither CISCy nor RISCy because it's
>convenient only for the CPU implementors.

AES instructions are not particularly convenient for CPU implementors,
probably on the contrary, because they need hardware that is not
useful for anything else.  But they are useful for the performance of
the typical application mix.  They tend to be used in libraries, using
asm statements or (equivalently) intrinsics.  Could a compiler
generate them?  It could use pattern-matching to recognize one or a
few ways of coding AES.  But I doubt that anybody has done that.  Why
waste development budget (and later compile-time budget) on such
pattern-matching, when it's easier for the programmer to write down
the asm statements/intrinsics than the code in the base language?

Likewise, the famed POLY instruction of VAX is there for library use,
in particular for implementing transcendental functions, not because
it's something that programmers used often in raw form.

>[ In contrast, vVM is definitely RISCy from that standpoint.  ]

VVM is a microarchitectural mechanism, so architectural concepts like
RISC and CISC are inappropriate for that.  You may want to discuss the
VEC and LOOP instructions of MY 66000.

- anton
-- 
'Anyone trying for "industrial quality" ISA should avoid undefined behavior.'
  Mitch Alsup, <c17fcd89-f024-40e7-a594-88a85ac10d20o@googlegroups.com>
Re: vector length CSR?
#657
Author: Thomas Koenig
Date: Thu, 12 Nov 2026 06:53
45 lines
2783 bytes
Stephen Fuld <sfuld@alumni.cmu.edu.invalid> schrieb:

> It seems the 
> advantage of an SIMD approach is the large set of addressable registers 
> that can be used to keep data readily available for future use.

Plus, you can do wide permutes, and it can also help with reduction.
Having mask for reducing operations also helps (or a length field).

There is one other thing that VVM does not do natively: Reductions
on commutative operators.  Consider the implementation of a simple
SUM intrinsic of FORTRAN.  If you write the assembly equivalent of

  s = 0;
  for (long int i=0; i<n; i++)
    s = s + a[i];

then VVM will add a loop-carried dependency.  For faster code
on long arrays one can unroll the loop, like

  tmp[0] = 0;
  tmp[1] = 0;
  tmp[2] = 0;
  tmp[3] = 0;
  n_end = (n / 4) * 4;
  for (long int i = 0; i < n_nend; i++)
    {
      tmp[0] = tmp[0] + a[i];
      tmp[1] = tmp[1] + a[i+1];
      tmp[2] = tmp[2] + a[i+2];
      tmp[3] = tmp[3] + a[i+3];
    }
  for (long int i = 0; i < n % 4; i++)
    tmp[i] = tmp[i] + a[i+n_end];

  s = tmp[0] + tmp[1] + tmp[2] + tmp[3];

(hope I got this right) but if that is needed, one might as well
use an SIMD register - it is as complex, and register pressure is,
of course, much higher if you use general-purpose registers.

-- 
This USENET posting was made without artificial intelligence,
artificial impertinence, artificial arrogance, artificial stupidity,
artificial flavorings or artificial colorants.
Re: vector length CSR?
#659
Author: Anton Ertl
Date: Thu, 12 Nov 2026 08:21
77 lines
3693 bytes
Thomas Koenig <tkoenig@netcologne.de> writes:
>Stephen Fuld <sfuld@alumni.cmu.edu.invalid> schrieb:
>
>> It seems the 
>> advantage of an SIMD approach is the large set of addressable registers 
>> that can be used to keep data readily available for future use.
>
>Plus, you can do wide permutes, and it can also help with reduction.
>Having mask for reducing operations also helps (or a length field).
>
>There is one other thing that VVM does not do natively: Reductions
>on commutative operators.

Associativity is key (and FP addition and multiplication are mostly
commutative, but not associative).

>Consider the implementation of a simple
>SUM intrinsic of FORTRAN.  If you write the assembly equivalent of
>
>  s = 0;
>  for (long int i=0; i<n; i++)
>    s = s + a[i];
>
>then VVM will add a loop-carried dependency.  For faster code
>on long arrays one can unroll the loop, like
>
>  tmp[0] = 0;
>  tmp[1] = 0;
>  tmp[2] = 0;
>  tmp[3] = 0;
>  n_end = (n / 4) * 4;
>  for (long int i = 0; i < n_nend; i++)
>    {
>      tmp[0] = tmp[0] + a[i];
>      tmp[1] = tmp[1] + a[i+1];
>      tmp[2] = tmp[2] + a[i+2];
>      tmp[3] = tmp[3] + a[i+3];
>    }
>  for (long int i = 0; i < n % 4; i++)
>    tmp[i] = tmp[i] + a[i+n_end];
>
>  s = tmp[0] + tmp[1] + tmp[2] + tmp[3];
>
>(hope I got this right)

You confused yourself with trying to use an increment by 1 (why?).
Better do the loop as follows:

long i;
for (i = 0; i < n+1-4; i+=4) {
  ... unrolled body ...
}
for (; i<n; i++) {
  ... plain body ...
}

Another option for the unrolled body would be:

  tmp = a[i]+b[i]+c[i]+d[i];
  r = r + tmp;

This variant does not require commutativity, but still associativity,
and it has the same loop-carried latency (on an OoO CPU).

But with SIMD, doing parallel adds like you did is a good idea, and
you can also implement my idea in addition (or unroll more) to perform
as many SIMD operations per loop-carried latency as the hardware has
resources for.  What I have seen from gcc and/or clang is that they
use more unrolling.

AFAIK VVM will not auto-vectorize your code, so reduction is another
case for which VVM does not have a story AFAICS.

- anton
-- 
'Anyone trying for "industrial quality" ISA should avoid undefined behavior.'
  Mitch Alsup, <c17fcd89-f024-40e7-a594-88a85ac10d20o@googlegroups.com>
Re: CISC are not "unreduced"
#667
Author: Stefan Monnier
Date: Thu, 12 Nov 2026 15:35
16 lines
2163 bytes
Anton Ertl [2026-11-11 09:57:30] wrote:
> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>>The million instructions of AES don't feel very CISCy to me.
> Not sure what you mean by that.

You have to read the above sentence in its context, i.e. preceded by:

>> Indeed.  And one of the motivations behind the CISC evolution was the
>> famed "semantic gap", which pushed towards rather fewer instructions
>> that are more flexible, regular, and powerful.

So what I meant by that is that the AES instructions don't help to
bridge the semantic gap.


=== Stefan
Re: vector length CSR?
#660
Author: John Levine
Date: Thu, 12 Nov 2026 17:36
29 lines
2519 bytes
According to Anton Ertl <anton@mips.complang.tuwien.ac.at>:
>John Levine <johnl@taugh.com> writes:
>>It appears that Anton Ertl <anton@mips.complang.tuwien.ac.at> said:
>>There still are.  zSeries has 16 vector registers and an impressively
>>overimplemented set of vector ops including integers, IEEE floats,
>>strings, and packed decimal.
>
>Any relation to the vector facility of the 3090 model 9021/9121?

As far as I can tell, no.  The 3090 had 16 vector registers each of
which could hold 128 elements: integer, float, or by pairing registers,
double.  The z has 16 registers which can hold all sorts of stuff.

>>It's not clear who this is for, but presumably there are customers
>>that wanted them enough to add them.
>
>One idea might be that auto-vectorization was becoming widespread in
>2015 (with gcc and LLVM doing it), probably with exaggerated
>expectations concerning its efficacy.  So a reason for adding these
>instructions might be FOMO on the side of the s390x architects and/or
>their customers.

Possibly, or they may have had some specific applications where they
wanted to do a whole lot of decimal arithmetic or string searches.

-- 
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: CISC are not "unreduced"
#661
Author: MitchAlsup
Date: Thu, 12 Nov 2026 19:19
53 lines
3675 bytes
anton@mips.complang.tuwien.ac.at (Anton Ertl) posted:

> Stefan Monnier <monnier@iro.umontreal.ca> writes:
> >Yeah, if we take CISC as motivated by the desire to provide an assembly
> >language that is comfortable for humans, we can also take RISC as
> >motivated by the desire to provide an assembly language that's
> >convenient for compilers (which would rather not need to worry about
> >tradeoffs between using LD+ADD+ST vs using some fancy addressing mode
> >on ADD).
> 
> The fancy addressing mode is the same whether you use it with a LD, a
> ST, or an ADD.
> 
> Compilers actually have no problem using that addressing mode,
> especially in an architecture like VAX: When the variable resides in a
> register, use a register, when it's in memory, use the appropriate
> addressing mode.
> 
> It's just that with the 16 registers of S/360 and a compiler that
> allocates variables into registers, most accesses are to registers.
> 
> And the more fancy addressing modes are not difficult for the
> compiler, either (optimality is more difficult, but for trees has been
> reached with tree-parsing, as used in burg or iburg).  But these
> addressing modes are not used much, not by compilers, nor by humans
> (IIRC the IBM 801 group looked at existing S/370 code), because the
> corresponding access patterns are not used much.

CMU circa 1985, there was a master's thesis called "Maximal Munching
Method" where someone wrote a tree-walker that attempted to match
as big a tree segment as possible in targeting VAX addressing modes.
The compiler produced good fast code (for that era).

The problem was that there was a ">" instead of a "<" in the tree
analyzer: so, the compiler actually used VAX ISA to produce RISC-like
code sequences.
---------------
> Likewise, the famed POLY instruction of VAX is there for library use,
> in particular for implementing transcendental functions, not because
> it's something that programmers used often in raw form.

Performing a series of FMAC steps in the FMAC unit is straightforward--
feeding the polynomial evaluation a series of coefficients is not--
unless those coefficients are stored in ROM in the FMAC unit itself.
Thus, My 66000 transcendentals.
 
> >[ In contrast, vVM is definitely RISCy from that standpoint.  ]
> 
> VVM is a microarchitectural mechanism, so architectural concepts like
> RISC and CISC are inappropriate for that.  You may want to discuss the
> VEC and LOOP instructions of MY 66000.
> 
> - anton
Re: vector length CSR?
#662
Author: EricP
Date: Thu, 12 Nov 2026 19:35
46 lines
3111 bytes
On 2026-Nov-12 12:36, John Levine wrote:
> According to Anton Ertl <anton@mips.complang.tuwien.ac.at>:
>> John Levine <johnl@taugh.com> writes:
>>> It appears that Anton Ertl <anton@mips.complang.tuwien.ac.at> said:
>>> There still are.  zSeries has 16 vector registers and an impressively
>>> overimplemented set of vector ops including integers, IEEE floats,
>>> strings, and packed decimal.
>>
>> Any relation to the vector facility of the 3090 model 9021/9121?
> 
> As far as I can tell, no.  The 3090 had 16 vector registers each of
> which could hold 128 elements: integer, float, or by pairing registers,
> double.  The z has 16 registers which can hold all sorts of stuff.
> 
>>> It's not clear who this is for, but presumably there are customers
>>> that wanted them enough to add them.
>>
>> One idea might be that auto-vectorization was becoming widespread in
>> 2015 (with gcc and LLVM doing it), probably with exaggerated
>> expectations concerning its efficacy.  So a reason for adding these
>> instructions might be FOMO on the side of the s390x architects and/or
>> their customers.
> 
> Possibly, or they may have had some specific applications where they
> wanted to do a whole lot of decimal arithmetic or string searches.
> 

Floating Point Systems had been selling attached "array processors"
for PDP-11, VAX-780 and IBM systems since 1976 and colloborated with
DEC in 1987 attaching to the VAX 8200, 8500, 87/8800.
https://en.wikipedia.org/wiki/Floating_Point_Systems
https://en.wikipedia.org/wiki/Floating_Point_Systems#Collaboration_with_Digital
https://en.wikipedia.org/wiki/FPS_AP-120B

The 3090 announced its vector unit on 1-Oct-1985
to replace "discontinued 3838 array processor".
https://en.wikipedia.org/wiki/IBM_3090#Vector_facility
https://en.wikipedia.org/wiki/Vector_processor#IBM_370_Vector_facility

DEC started designed their own vector unit in 1986 for the VAX 9000
https://en.wikipedia.org/wiki/VAX_9000#Vector_processor

It might have been that IBM and DEC looked at the money FPS
was taking in and decided that they wanted a piece of that action.

Re: vector length CSR?
#663
Author: EricP
Date: Thu, 12 Nov 2026 20:06
51 lines
3448 bytes
On 2026-Nov-10 04:03, Anton Ertl wrote:
> EricP <ThatWouldBeTelling@thevillage.com> writes:
>> I'm not sure what I'm thinking as this idea is very un-baked
>> but maybe the Mill's belt concept could be useful.
>>
>> Instead of treating the register file as 32 32-byte SIMD registers,
>> what if it was a 1024 byte belt. A variable byte length LDV Load Vector
>> copies a memory vector onto the belt such that element[0] lands in belt[0].
>> Source operands use a 10 bit belt byte offset,
>> and dynamic vector length of up to 32 bytes.
>>
>> Internally its implemented as a circular buffer,
>> with byte alignment shifters to right-align (little endian)
>> the source operands as they are read for each operation.
>>
>> There is no renaming because the belt output inherently
>> rotates the the whole belt. Internally that would just be
>> an byte vector alignment shifter applied to the destination.
> 
> The disadvantage of a belt is that stuff vanishes from the belt (or
> you have to preserve it by regularly copying from the end of the belt
> to the beginning, so you do not get the advantage of a vector
> register, that you can reuse its content as often as you like without
> additional costs (useful, e.g., in matrix multiplication).
> 
> IIRC there are vector instruction sets (maybe even RVV?) that
> can have more shorter or fewer longer vector registers.
> 
> - anton

Just playing around with this belt idea a bit more...

Yes it needs other registers. So say it has
32 scalar 64-bit registers that can hold integer or float values,
plus a 32 slot belt with 64-bit values,
plus 32 vector registers of 8kB each, each with a byte count,
and the vectors can be interpreted as 1, 2, 4 or 8 byte elements.

Each vector instruction can source its operands from scalar, belt,
or vector registers. If it is a vector register then it is implied
that the current vector loop counter is the index to the element.
The result output goes to belt[0] or belt[1:0] if 128 bit result.
To save a belt value it must be copied to scalar, or vector register
at the current index, or recycled to belt[0], or to memory.

So the belt becomes the equivalent of a forwarding network for
vector calculation temporaries that don't need to be saved.

Not sure where I'm headed with this... just thinking out loud.

Re: vector length CSR?
#664
Author: Robert Finch
Date: Thu, 12 Nov 2026 20:43
71 lines
4922 bytes
On 2026-11-12 3:06 p.m., EricP wrote:
> On 2026-Nov-10 04:03, Anton Ertl wrote:
>> EricP <ThatWouldBeTelling@thevillage.com> writes:
>>> I'm not sure what I'm thinking as this idea is very un-baked
>>> but maybe the Mill's belt concept could be useful.
>>>
>>> Instead of treating the register file as 32 32-byte SIMD registers,
>>> what if it was a 1024 byte belt. A variable byte length LDV Load Vector
>>> copies a memory vector onto the belt such that element[0] lands in 
>>> belt[0].
>>> Source operands use a 10 bit belt byte offset,
>>> and dynamic vector length of up to 32 bytes.
>>>
>>> Internally its implemented as a circular buffer,
>>> with byte alignment shifters to right-align (little endian)
>>> the source operands as they are read for each operation.
>>>
>>> There is no renaming because the belt output inherently
>>> rotates the the whole belt. Internally that would just be
>>> an byte vector alignment shifter applied to the destination.
>>
>> The disadvantage of a belt is that stuff vanishes from the belt (or
>> you have to preserve it by regularly copying from the end of the belt
>> to the beginning, so you do not get the advantage of a vector
>> register, that you can reuse its content as often as you like without
>> additional costs (useful, e.g., in matrix multiplication).
>>
>> IIRC there are vector instruction sets (maybe even RVV?) that
>> can have more shorter or fewer longer vector registers.
>>
>> - anton
> 
> Just playing around with this belt idea a bit more...
> 
> Yes it needs other registers. So say it has
> 32 scalar 64-bit registers that can hold integer or float values,
> plus a 32 slot belt with 64-bit values,
> plus 32 vector registers of 8kB each, each with a byte count,
> and the vectors can be interpreted as 1, 2, 4 or 8 byte elements.
> 
> Each vector instruction can source its operands from scalar, belt,
> or vector registers. If it is a vector register then it is implied
> that the current vector loop counter is the index to the element.
> The result output goes to belt[0] or belt[1:0] if 128 bit result.
> To save a belt value it must be copied to scalar, or vector register
> at the current index, or recycled to belt[0], or to memory.
> 
> So the belt becomes the equivalent of a forwarding network for
> vector calculation temporaries that don't need to be saved.
> 
> Not sure where I'm headed with this... just thinking out loud.
> 
> 
IDK how the belt works. Sounds like a familiar architecture with a 
conveyor belt of operands bolted on? When does the belt advance? At one 
point I was trying to re-organize the re-order buffer like a belt. 
Queueing at one end and committing at the other. The idea was to use a 
shift register for the re-order buffer.

Thinking about the dichotomy of vector registers versus integer and 
float-point ones. Why do vector registers accept either float or integer 
values while the integer and floating-point register files are kept 
separate?

I bin planning on just using a single massive physical register file for 
everything. Just changing the logical register tags to fake separate 
register files. But there is going to be separate register files 
viewable in the ISA. IDK if to have separate register files for vector 
integers and vector floats though. Why not add even more separate 
register files for decimal-floats and posits too?
Re: CISC are not "unreduced"
#665
Author: Robert Finch
Date: Thu, 12 Nov 2026 20:49
57 lines
4383 bytes
On 2026-11-12 2:19 p.m., MitchAlsup wrote:
> anton@mips.complang.tuwien.ac.at (Anton Ertl) posted:
> 
>> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>>> Yeah, if we take CISC as motivated by the desire to provide an assembly
>>> language that is comfortable for humans, we can also take RISC as
>>> motivated by the desire to provide an assembly language that's
>>> convenient for compilers (which would rather not need to worry about
>>> tradeoffs between using LD+ADD+ST vs using some fancy addressing mode
>>> on ADD).
>>
>> The fancy addressing mode is the same whether you use it with a LD, a
>> ST, or an ADD.
>>
>> Compilers actually have no problem using that addressing mode,
>> especially in an architecture like VAX: When the variable resides in a
>> register, use a register, when it's in memory, use the appropriate
>> addressing mode.
>>
>> It's just that with the 16 registers of S/360 and a compiler that
>> allocates variables into registers, most accesses are to registers.
>>
>> And the more fancy addressing modes are not difficult for the
>> compiler, either (optimality is more difficult, but for trees has been
>> reached with tree-parsing, as used in burg or iburg).  But these
>> addressing modes are not used much, not by compilers, nor by humans
>> (IIRC the IBM 801 group looked at existing S/370 code), because the
>> corresponding access patterns are not used much.
> 
> CMU circa 1985, there was a master's thesis called "Maximal Munching
> Method" where someone wrote a tree-walker that attempted to match
> as big a tree segment as possible in targeting VAX addressing modes.
> The compiler produced good fast code (for that era).
> 
> The problem was that there was a ">" instead of a "<" in the tree
> analyzer: so, the compiler actually used VAX ISA to produce RISC-like
> code sequences.
> ---------------
>> Likewise, the famed POLY instruction of VAX is there for library use,
>> in particular for implementing transcendental functions, not because
>> it's something that programmers used often in raw form.
> 
> Performing a series of FMAC steps in the FMAC unit is straightforward--
> feeding the polynomial evaluation a series of coefficients is not--
> unless those coefficients are stored in ROM in the FMAC unit itself.
> Thus, My 66000 transcendentals.
>
Why cannot the polynomical coefficients be passed in registers?

>>> [ In contrast, vVM is definitely RISCy from that standpoint.  ]
>>
>> VVM is a microarchitectural mechanism, so architectural concepts like
>> RISC and CISC are inappropriate for that.  You may want to discuss the
>> VEC and LOOP instructions of MY 66000.
>>
>> - anton
Re: vector length CSR?
#668
Author: John Levine
Date: Thu, 12 Nov 2026 22:05
34 lines
2637 bytes
According to EricP  <ThatWouldBeTelling@thevillage.com>:
>Floating Point Systems had been selling attached "array processors"
>for PDP-11, VAX-780 and IBM systems since 1976 and colloborated with
>DEC in 1987 attaching to the VAX 8200, 8500, 87/8800.
>https://en.wikipedia.org/wiki/Floating_Point_Systems

They were fast, but extremely difficult to program because you had to work
out all the paralellism by hand.  Trying to program FPS got Josh Fisher
thinking about trace scheduling which led to Multiflow and later Itanium.

>The 3090 announced its vector unit on 1-Oct-1985
>to replace "discontinued 3838 array processor".
>https://en.wikipedia.org/wiki/IBM_3090#Vector_facility

Here's the manual for it.

https://bitsavers.org/pdf/ibm/3090/GG24-3058-0_IBM_3090_Vector_Facility_Technical_Reference_198607.pdf

>DEC started designed their own vector unit in 1986 for the VAX 9000
>https://en.wikipedia.org/wiki/VAX_9000#Vector_processor
>
>It might have been that IBM and DEC looked at the money FPS
>was taking in and decided that they wanted a piece of that action.

Perhaps but I don't get the impression FPS made that much money. In the early
1990s Cray Research bought them and subsequent machines were clusters of SPARC
or Intel i860 chips, quite different from the coprocessors.



-- 
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: CISC are not "unreduced"
#682
Author: Stefan Monnier
Date: Fri, 13 Nov 2026 00:04
67 lines
4599 bytes
Anton Ertl [2026-11-12 06:21:21] wrote:
> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>>Yeah, if we take CISC as motivated by the desire to provide an assembly
>>language that is comfortable for humans, we can also take RISC as
>>motivated by the desire to provide an assembly language that's
>>convenient for compilers (which would rather not need to worry about
>>tradeoffs between using LD+ADD+ST vs using some fancy addressing mode
>>on ADD).
> The fancy addressing mode is the same whether you use it with a LD, a
> ST, or an ADD.

That's beside the point.  With a load/store architecture you don't need
to choose between using the ADD-with-addressing mode or using explicit
loads and stores.  Makes life simpler for the compiler.

> Compilers actually have no problem using that addressing mode,
> especially in an architecture like VAX: When the variable resides in a
> register, use a register, when it's in memory, use the appropriate
> addressing mode.

What if explicit loads and stores are faster/slower?
And how is the answer affected by subsequent operations accessing the
same memory location?

> (optimality is more difficult, but for trees has been
> reached with tree-parsing, as used in burg or iburg).

And this is useful for CISC but much less so for RISC, so you can use
a simpler compiler for RISC instruction sets.

> But these addressing modes are not used much, not by compilers,

Exactly.

> We have learned how to do such tools with the more efficient calling
> conventions we use now, but that does cost a lot of complexity in the
> tools: Generating and using DWARF information etc.  Ok, DWARF is not
> just about calling conventions, but it might be interesting to
> consider how much simpler debugging information would be with VAX
> CALLs.

That's a good point.  AFAICT this has not been taken into account in the
RISC designs.  🙁

>> From that point of view, AES is neither CISCy nor RISCy because it's
>> convenient only for the CPU implementors.
> AES instructions are not particularly convenient for CPU implementors,
> probably on the contrary, because they need hardware that is not
> useful for anything else.

AFAIK, AES was designed specifically to give access to that extra
hardware.  More specifically, manufacturers were eager to add more FPUs
and the question they faced was how to make that hardware available to
the programmer.
IOW it's "more hardware" that caused AES rather than the other way around.

And AFAICT, AES is a fairly naive/simple way (for the CPU implementor)
to give access to that hardware.

>> [ In contrast, vVM is definitely RISCy from that standpoint.  ]
> vVM is a microarchitectural mechanism,

Is it?  I use it as a way to refer to the design of VEC+LOOP (which is
so designed as to allow a particular micro-architecture).


=== Stefan
Re: vector length CSR?
#669
Author: MitchAlsup
Date: Fri, 13 Nov 2026 01:17
39 lines
2787 bytes
Robert Finch <robfi680@gmail.com> posted:

> On 2026-11-12 3:06 p.m., EricP wrote:
> > On 2026-Nov-10 04:03, Anton Ertl wrote:
> >> EricP <ThatWouldBeTelling@thevillage.com> writes:
---------------------
> IDK how the belt works. Sounds like a familiar architecture with a 
> conveyor belt of operands bolted on? When does the belt advance? 

Every time a result is produced.

>                                                             At one 
> point I was trying to re-organize the re-order buffer like a belt. 
> Queueing at one end and committing at the other. The idea was to use a 
> shift register for the re-order buffer.

Like a belt but belt is SW controlled (move back to front so the
result can be used again.)
 
> Thinking about the dichotomy of vector registers versus integer and 
> float-point ones. Why do vector registers accept either float or integer 
> values while the integer and floating-point register files are kept 
> separate?

I never found the distinction to be useful--especially when one puts
Ints in FP and needs all the {ALU, Shifts, Logical} instructions in
FP FUs.
 
> I bin planning on just using a single massive physical register file for 
> everything. Just changing the logical register tags to fake separate 
> register files. But there is going to be separate register files 
> viewable in the ISA. IDK if to have separate register files for vector 
> integers and vector floats though. Why not add even more separate 
> register files for decimal-floats and posits too?

In <gross> effect, separate RFs only allow for more writes/unit-time;
but only when both files are in simultaneous use. Read ports can be
provided by duplication.
> 
Re: CISC are not "unreduced"
#670
Author: MitchAlsup
Date: Fri, 13 Nov 2026 01:18
24 lines
2163 bytes
Robert Finch <robfi680@gmail.com> posted:

> On 2026-11-12 2:19 p.m., MitchAlsup wrote:
> > anton@mips.complang.tuwien.ac.at (Anton Ertl) posted:
> > 
> >> Stefan Monnier <monnier@iro.umontreal.ca> writes:
-----------------------
> > Performing a series of FMAC steps in the FMAC unit is straightforward--
> > feeding the polynomial evaluation a series of coefficients is not--
> > unless those coefficients are stored in ROM in the FMAC unit itself.
> > Thus, My 66000 transcendentals.
> >
> Why cannot the polynomical coefficients be passed in registers?

Are you going to make a RS-entry with 9 Src2 operands ???
 
> >>> [ In contrast, vVM is definitely RISCy from that standpoint.  ]
> >>
> >> VVM is a microarchitectural mechanism, so architectural concepts like
> >> RISC and CISC are inappropriate for that.  You may want to discuss the
> >> VEC and LOOP instructions of MY 66000.
> >>
> >> - anton
> 
Re: vector length CSR?
#672
Author: MitchAlsup
Date: Fri, 13 Nov 2026 01:26
39 lines
2630 bytes
John Levine <johnl@taugh.com> posted:

> According to EricP  <ThatWouldBeTelling@thevillage.com>:
> >Floating Point Systems had been selling attached "array processors"
> >for PDP-11, VAX-780 and IBM systems since 1976 and colloborated with
> >DEC in 1987 attaching to the VAX 8200, 8500, 87/8800.
> >https://en.wikipedia.org/wiki/Floating_Point_Systems
> 
> They were fast, but extremely difficult to program because you had to work
> out all the paralellism by hand.  Trying to program FPS got Josh Fisher
> thinking about trace scheduling which led to Multiflow and later Itanium.

So, 4 strikes against him !?!
 
> >The 3090 announced its vector unit on 1-Oct-1985
> >to replace "discontinued 3838 array processor".
> >https://en.wikipedia.org/wiki/IBM_3090#Vector_facility
> 
> Here's the manual for it.
> 
> https://bitsavers.org/pdf/ibm/3090/GG24-3058-0_IBM_3090_Vector_Facility_Technical_Reference_198607.pdf
> 
> >DEC started designed their own vector unit in 1986 for the VAX 9000
> >https://en.wikipedia.org/wiki/VAX_9000#Vector_processor
> >
> >It might have been that IBM and DEC looked at the money FPS
> >was taking in and decided that they wanted a piece of that action.
> 
> Perhaps but I don't get the impression FPS made that much money. In the early
> 1990s Cray Research bought them and subsequent machines were clusters of SPARC
> or Intel i860 chips, quite different from the coprocessors.
> 
I helped install a FPS system at the Air station in/near Cincinnati
in 1983-4 attached to a S.E.L. 32/67 that provided the control of
an F14 cockpit on a 14 ft. boom that could simulate a real 2.5Gs
{powered by 100 HP hydraulic motor} all manipulated by the FPS
application.
> 
> 
Re: vector length CSR?
#674
Author: EricP
Date: Fri, 13 Nov 2026 02:42
53 lines
2726 bytes
On 2026-Nov-12 17:05, John Levine wrote:
> According to EricP  <ThatWouldBeTelling@thevillage.com>:
>> The 3090 announced its vector unit on 1-Oct-1985
>> to replace "discontinued 3838 array processor".
>> https://en.wikipedia.org/wiki/IBM_3090#Vector_facility
> 
> Here's the manual for it.
> 
> https://bitsavers.org/pdf/ibm/3090/GG24-3058-0_IBM_3090_Vector_Facility_Technical_Reference_198607.pdf

Wikipedia mentions an earlier array processor, the 3838

https://www.bitsavers.org/pdf/ibm/3838/Array_Processor_Status_Report_Jan76.pdf

"HARDWARE
   1 MEGABYTE BULK STORE (24K POINTS, 1M-PURCHASE)
   24/48 BIT FRACTION
ARITHMATIC ELEMENT
   2 ADDERS
   1 MULTIPLIER
   HIGHLY PIPELINED
   100 NS CYCLE
   2-1000 WORD WORKING STORES
   MICROPROGRAMMED
   SHORT/LONG PRECISION
   No ERROR CHECKING
CONTROL PROCESSOR
   2 MICRO SECOND CYCLE
   CONTROLS DATA TRANSFERS
     HOST TO BULK STORE (3M B/S)
     BULK STORE TO WORKING STORE (40M B/S)
   PROVIDES OVERLAP
370 CHANNEL INTERFACE

It mentions an earlier array processor, the 2938, note the date of 1966

https://www.bitsavers.org/pdf/ibm/2938/Functional_Objectives_for_an_Array_Processor_Nov66.pdf

"August 1967
THE 2938 ARRAY PROCESSOR

The 2938 Array Processor is a peripheral processor for attachment to
System/360 Models 44, 65, and 75.
...
The arithmetic unit of the 2938 is a multiplication and addition unit which
performs the operation Z = U*X +- Y. The unit operates on System/360
short-operand floating-point data only.
...
the combined multiply and add time is effectively 200 nanoseconds,
whereas the total time for a particular set of U, X I and Y to pass
through the arithmetic unit to form the resultant Z is approximately
800 nanoseconds."
Re: CISC are not "unreduced"
#675
Author: Robert Finch
Date: Fri, 13 Nov 2026 03:14
38 lines
3102 bytes
On 2026-11-12 8:18 p.m., MitchAlsup wrote:
> Robert Finch <robfi680@gmail.com> posted:
> 
>> On 2026-11-12 2:19 p.m., MitchAlsup wrote:
>>> anton@mips.complang.tuwien.ac.at (Anton Ertl) posted:
>>>
>>>> Stefan Monnier <monnier@iro.umontreal.ca> writes:
> -----------------------
>>> Performing a series of FMAC steps in the FMAC unit is straightforward--
>>> feeding the polynomial evaluation a series of coefficients is not--
>>> unless those coefficients are stored in ROM in the FMAC unit itself.
>>> Thus, My 66000 transcendentals.
>>>
>> Why cannot the polynomical coefficients be passed in registers?
> 
> Are you going to make a RS-entry with 9 Src2 operands ???
>   
But cannot the calc be broken up into sequential elements?
Q+ FPOLY instruction expands into multiple FMA micro-ops.
The micro-ops only need a few src operands. The next coefficient is 
assumed to come from the next register.
It is using Horner's rule.
FPOLY has a cascade input option so it can be called as many times as 
desired.

Of course the Q+ micro-op translator is kinda huge, maybe unworkable IRL.



>>>>> [ In contrast, vVM is definitely RISCy from that standpoint.  ]
>>>>
>>>> VVM is a microarchitectural mechanism, so architectural concepts like
>>>> RISC and CISC are inappropriate for that.  You may want to discuss the
>>>> VEC and LOOP instructions of MY 66000.
>>>>
>>>> - anton
>>
Re: vector length CSR?
#676
Author: Stephen Fuld
Date: Fri, 13 Nov 2026 03:18
24 lines
2472 bytes
On 11/11/2026 10:53 PM, Thomas Koenig wrote:
> Stephen Fuld <sfuld@alumni.cmu.edu.invalid> schrieb:
> 
>> It seems the
>> advantage of an SIMD approach is the large set of addressable registers
>> that can be used to keep data readily available for future use.
> 
> Plus, you can do wide permutes, and it can also help with reduction.
> Having mask for reducing operations also helps (or a length field).
> 
> There is one other thing that VVM does not do natively: Reductions
> on commutative operators. 

When we talked about reductions on VVM in a thread some months ago, I 
thought Mitch said that VVM could parallelize such reductions, including 
handling an array size that was not a multiple of the number of 
functional units used (i.e. the degree of parallelism), and combining 
the partial sums at the end.  As I have said, I am not a hardware guy 
but that sounded impressive and I don't know how he does that.


-- 
  - Stephen Fuld
(e-mail address disguised to prevent spam)
Re: vector length CSR?
#677
Author: George Neuner
Date: Fri, 13 Nov 2026 04:14
44 lines
3374 bytes
On Tue, 10 Nov 2026 09:03:17 GMT, anton@mips.complang.tuwien.ac.at
(Anton Ertl) wrote:

>EricP <ThatWouldBeTelling@thevillage.com> writes:
>>I'm not sure what I'm thinking as this idea is very un-baked
>>but maybe the Mill's belt concept could be useful.
>>
>>Instead of treating the register file as 32 32-byte SIMD registers,
>>what if it was a 1024 byte belt. A variable byte length LDV Load Vector
>>copies a memory vector onto the belt such that element[0] lands in belt[0].
>>Source operands use a 10 bit belt byte offset,
>>and dynamic vector length of up to 32 bytes.
>>
>>Internally its implemented as a circular buffer,
>>with byte alignment shifters to right-align (little endian)
>>the source operands as they are read for each operation.
>>
>>There is no renaming because the belt output inherently
>>rotates the the whole belt. Internally that would just be
>>an byte vector alignment shifter applied to the destination.
>
>The disadvantage of a belt is that stuff vanishes from the belt (or
>you have to preserve it by regularly copying from the end of the belt
>to the beginning, so you do not get the advantage of a vector
>register, that you can reuse its content as often as you like without
>additional costs (useful, e.g., in matrix multiplication).
>
>IIRC there are vector instruction sets (maybe even RVV?) that
>can have more shorter or fewer longer vector registers.
>
>- anton

WRT the Mill, I think people here may be missing that it supported
short-vector-SIMD, and that a vector operand on its belt was a single
element [of whatever width] - not a bunch of scalars that magically
would be operated on together.

According to Ivan, the Mill's instruction set supported quad FP and
128-bit short vector SIMD.
[Similar width as Intel's SSE2, though SSE_ doesn't do quad FP.]  

He spoke about the potential for [more lanes] wider SIMD and made
clear that, whatever widths were supported, the "operands" still would
be treated as single belt elements.
Re: vector length CSR?
#680
Author: Anton Ertl
Date: Fri, 13 Nov 2026 07:20
95 lines
5326 bytes
EricP <ThatWouldBeTelling@thevillage.com> writes:
>Wikipedia mentions an earlier array processor, the 3838
>
>https://www.bitsavers.org/pdf/ibm/3838/Array_Processor_Status_Report_Jan76.pdf
>
>"HARDWARE
>   1 MEGABYTE BULK STORE (24K POINTS, 1M-PURCHASE)
>   24/48 BIT FRACTION
>ARITHMATIC ELEMENT
>   2 ADDERS
>   1 MULTIPLIER
>   HIGHLY PIPELINED
>   100 NS CYCLE
>   2-1000 WORD WORKING STORES
>   MICROPROGRAMMED
>   SHORT/LONG PRECISION
>   No ERROR CHECKING
>CONTROL PROCESSOR
>   2 MICRO SECOND CYCLE
>   CONTROLS DATA TRANSFERS
>     HOST TO BULK STORE (3M B/S)
>     BULK STORE TO WORKING STORE (40M B/S)
>   PROVIDES OVERLAP
>370 CHANNEL INTERFACE

So that's around the same time as Cray-1, maybe inspired by earlier
pipelined vector machines by TI and CDC.

The cycle time is 8 times longer than that of the Cray-1, so the
Cray-1 probably resulted in very low sales for the 3838.

The use of the channels for these kinds of accelerators is
interesting.  Maybe this was the inspiration for the way that the SPEs
in the Cell Broadband Engine (used in, e.g., the Playstation 3)
interface to the rest of the system.  I'll ask Michael Gschwind when I
see him (he occasionally visits his alma mater).

While reading up on Cell and Michal Gschwind, I found the following, which leads us back to vector extensions on S390x:

<https://en.wikipedia.org/wiki/Michael_Gschwind#SIMD_Parallel_vector_architecture>
|To enable efficient compilation, Gschwind proposed the implementation
|of merged scalar and vector execution units, eliminating the cost of
|copies between scalar and vectorized code, and simplifying compiler
|architecture by resolving phase ordering problems in compilers.
|
|The Cell's accelerator cores (Synergistic Processor Unit SPU) contain
|a single 128 element register file with 128 bit per register.
|Registers may hold either scalar or a vector of multiple values.[66]
|The simplified cost model leads to significantly improved
|vectorization success, improving overall program performance and
|efficiency.[67]
|
|The vector-scalar approach was also adopted by the IBM Power VSX
|(Vector Scalar Extension) SIMD instructions,[68] BlueGene/Q vector
|instructions[69][70] and System/z mainframe vector instruction
|set,[42][71] the design of all three IBM vector-scalar architectures
|having been led by Gschwind as Chief Architect for IBM System
|Architecture.

So IBM reuses architectural (and probably implementation) work across
its various architectures.  This has also happened with decimal FP
appearing on Power and S390x.  So the S390x vector stuff probably was
not demand-driven, but supply-driven.  One would have to compare the
vector extensions of the various architectures (and architecture
versions) to see if there are any parts that occur only on some of
them and where they appear first.  One can assume that demand puts the
feature in the first architecture, and then supply puts it in the
others.

>It mentions an earlier array processor, the 2938, note the date of 1966
>
>https://www.bitsavers.org/pdf/ibm/2938/Functional_Objectives_for_an_Array_Processor_Nov66.pdf
>
>"August 1967
>THE 2938 ARRAY PROCESSOR
>
>The 2938 Array Processor is a peripheral processor for attachment to
>System/360 Models 44, 65, and 75.
>...
>The arithmetic unit of the 2938 is a multiplication and addition unit which
>performs the operation Z = U*X +- Y. The unit operates on System/360
>short-operand floating-point data only.
>...
>the combined multiply and add time is effectively 200 nanoseconds,
>whereas the total time for a particular set of U, X I and Y to pass
>through the arithmetic unit to form the resultant Z is approximately
>800 nanoseconds."

Should I interpret that as 800ns latency with a throughput of 1/200ns?
That would then be an early case of a pipelined vector processor.

- anton
-- 
'Anyone trying for "industrial quality" ISA should avoid undefined behavior.'
  Mitch Alsup, <c17fcd89-f024-40e7-a594-88a85ac10d20o@googlegroups.com>
Re: vector length CSR?
#679
Author: Thomas Koenig
Date: Fri, 13 Nov 2026 07:28
27 lines
2593 bytes
Stephen Fuld <sfuld@alumni.cmu.edu.invalid> schrieb:
> On 11/11/2026 10:53 PM, Thomas Koenig wrote:
>> Stephen Fuld <sfuld@alumni.cmu.edu.invalid> schrieb:
>> 
>>> It seems the
>>> advantage of an SIMD approach is the large set of addressable registers
>>> that can be used to keep data readily available for future use.
>> 
>> Plus, you can do wide permutes, and it can also help with reduction.
>> Having mask for reducing operations also helps (or a length field).
>> 
>> There is one other thing that VVM does not do natively: Reductions
>> on commutative operators. 
>
> When we talked about reductions on VVM in a thread some months ago, I 
> thought Mitch said that VVM could parallelize such reductions, including 
> handling an array size that was not a multiple of the number of 
> functional units used (i.e. the degree of parallelism), and combining 
> the partial sums at the end.  As I have said, I am not a hardware guy 
> but that sounded impressive and I don't know how he does that.

I don't see this in the manuals, at least.  Mitch, did I miss it?

-- 
This USENET posting was made without artificial intelligence,
artificial impertinence, artificial arrogance, artificial stupidity,
artificial flavorings or artificial colorants.
Re: vector length CSR?
#681
Author: Thomas Koenig
Date: Fri, 13 Nov 2026 08:46
35 lines
2856 bytes
John Levine <johnl@taugh.com> schrieb:
> According to EricP  <ThatWouldBeTelling@thevillage.com>:
>>Floating Point Systems had been selling attached "array processors"
>>for PDP-11, VAX-780 and IBM systems since 1976 and colloborated with
>>DEC in 1987 attaching to the VAX 8200, 8500, 87/8800.
>>https://en.wikipedia.org/wiki/Floating_Point_Systems
>
> They were fast, but extremely difficult to program because you had to work
> out all the paralellism by hand.  Trying to program FPS got Josh Fisher
> thinking about trace scheduling which led to Multiflow and later Itanium.
>
>>The 3090 announced its vector unit on 1-Oct-1985
>>to replace "discontinued 3838 array processor".
>>https://en.wikipedia.org/wiki/IBM_3090#Vector_facility
>
> Here's the manual for it.
>
> https://bitsavers.org/pdf/ibm/3090/GG24-3058-0_IBM_3090_Vector_Facility_Technical_Reference_198607.pdf

In my PhD days, the university had a Fujitsu VP with an IBM 3090
as front end computer, which later got the vector extension.  If
you wanted fast execution, you used the VP.

At least I got to write cool JCL for the combined system.
Compile the code on the IBM (which had FAR better error messages,
the Japanese English was hard ro understand). If it worked,
submit a job on the VP to also compile, execute, and send back
the results to the IBM.  Both ran a variant of MVS.  Later on,
they switched the VP to a variant of UNIX, which was weird.
You still had to do dataset allocation like on the MVS systems.

-- 
This USENET posting was made without artificial intelligence,
artificial impertinence, artificial arrogance, artificial stupidity,
artificial flavorings or artificial colorants.
Re: CISC are not "unreduced"
#683
Author: Thomas Koenig
Date: Fri, 13 Nov 2026 11:02
60 lines
4252 bytes
Stefan Monnier <monnier@iro.umontreal.ca> schrieb:
> Anton Ertl [2026-11-12 06:21:21] wrote:
>> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>>>Yeah, if we take CISC as motivated by the desire to provide an assembly
>>>language that is comfortable for humans, we can also take RISC as
>>>motivated by the desire to provide an assembly language that's
>>>convenient for compilers (which would rather not need to worry about
>>>tradeoffs between using LD+ADD+ST vs using some fancy addressing mode
>>>on ADD).
>> The fancy addressing mode is the same whether you use it with a LD, a
>> ST, or an ADD.
>
> That's beside the point.  With a load/store architecture you don't need
> to choose between using the ADD-with-addressing mode or using explicit
> loads and stores.  Makes life simpler for the compiler.

I agree.  But a large amount of optimization has gone into architectures
with have memory operands (especially x86), so this is in large part
a solved problem.

>
>> Compilers actually have no problem using that addressing mode,
>> especially in an architecture like VAX: When the variable resides in a
>> register, use a register, when it's in memory, use the appropriate
>> addressing mode.
>
> What if explicit loads and stores are faster/slower?

That should be in the cost model of the compiler.

> And how is the answer affected by subsequent operations accessing the
> same memory location?

In the general case, that should be done well by the compiler.
If it sees a sequence of events where there is a load and an
operation, or a load, an operation and a store, with nothing
further going on with that value, then that is a candidate for a
memory operation.  Otherwise not.  Modern cmpilers are based on
SSA (call it RISC with an inifinite amount of registers which are
only assigned to once), the rest is pattern recognition and
register allocation.

>> (optimality is more difficult, but for trees has been
>> reached with tree-parsing, as used in burg or iburg).
>
> And this is useful for CISC but much less so for RISC, so you can use
> a simpler compiler for RISC instruction sets.

If you are going to make a new architecture, you have two choices:
Roll your own compiler or do a port of an existing compiler,
for example LLVM or gcc.  Mitch and Brian did the latter (LLVM),
and I think it turned out well.  (If you're doing things which are
not done in other architectures, you might have to fight some 
general optimizations which turn out to be pessimization for your
particular feature, as Brian has experienced.)

-- 
This USENET posting was made without artificial intelligence,
artificial impertinence, artificial arrogance, artificial stupidity,
artificial flavorings or artificial colorants.
Re: CISC are not "unreduced"
#684
Author: BGB
Date: Fri, 13 Nov 2026 11:28
359 lines
15002 bytes
On 11/11/2026 8:32 PM, MitchAlsup wrote:
> BGB <cr88192@gmail.com> posted:
> 
>> On 11/10/2026 11:08 AM, Stefan Monnier wrote:
>>> David Brown [2026-11-10 10:31:47] wrote:
>>>> It is also, I think, helpful to consider RISC as the "opposite" of
>>>> CISC - and Complex Instruction Set Computer cannot really be
>>>> interpreted as meaning anything other than that the instructions are
>>>> "complex".  By comparison, with RISC the /instructions/ are "reduced".
>>>
>>> Indeed.  And one of the motivations behind the CISC evolution was the
>>> famed "semantic gap", which pushed towards rather fewer instructions
>>> that are more flexible, regular, and powerful.
>>>
>>
>> I can note that one goal I pushed for in my ISA design was to reduce
>> executed instruction counts without raising the level of abstraction
>> or having complex logic.
> 
> For my part, My 66000 was restricted to not add more than 1 gate of delay
> per cycle to any stage of the pipeline.
>   

OK.

There are some things that could be done, but yeah, latency is a pain.


It is like the issue of early on, I mostly gave up on things like 
1-cycle ALU ops.

Granted, 1-cycle AND/OR/XOR and 32-bit ADD would be possible, but:
   AND/OR/XOR: Not really the heaviest used;
   32-bit ADD OK, but still kinda tight.


Carry-select helps, but ironically it seems like carry-select is better 
at allowing a 2-cycle 128-bit adder than giving a 64-bit result within 
the same clock-cycle (or, at least when the ALU result needs to reach 
the register forwarding).

Well, say:
    16-bit: Carry-chain is faster;
    32-bit: Nearly break-even;
    64-bit: Carry select helps, but modestly;
   128-bit: Carry select pays off a lot more.

For things like PC-increment and Branches, ended up doing a little 
trickery. Originally, they would have had an implicit 4GB "do-not-cross" 
boundary, but I figured out a workaround:
   Branch predictor skips branches if they would cross a boundary;
     Falls back to a slow-branch, which uses a full AGU;
   Crossing a boundary can insert a pipeline stall or similar;
     Inconsistent state stalls so carry can propagate.


The actual ADD takes place within a single cycle, but is 2-cycle mostly 
for sake of forwarding the result.

I didn't see a big difference here between 6R and 4R, and early on it 
was looking like only really 32-bit designs could easily hit a 100 MHz goal.

In a few cases, had pushed things to 75 MHz, but usually this required 
more extreme corner-cutting that hurt performance:
   Small caches;
   Penalties for memory RAW and WAW scenarios;
   Penalizing misaligned access;
   ...


Some FPGA soft-processors had also gained more clock speed by doing 
things that would more drastically impact actual performance, like 
faking 32 or 64 bit operations with multi-stage 16-bit ALUs.

Apparently people had also implemented a few 200 MHz bit-serial 
processors. But...

A 200 MHz CPU that performs more like the 6502 in a NES isn't quite so 
useful. And, any more than a few levels, and logic doesn't pass timing 
at 200 MHz.

Some other people went the other way and instead targeted 25 and 33 MHz.


Seemingly, areas that tend to fail timing at times:
   L1 D$ stuff;
   Register-Forwarding path;
   Instruction decoder path;
   ...

The ring-bus is at least easy on timing, one just sort of has to be 
generous with forwarding cycles and not try to have too many shortcut 
paths to allow things to spread out on the FPGA.


I mostly got tired of battling with a lot of this though.


In theory, a more efficient CPU design could be possible, but would need 
to be more carefully engineered.

Had noted that while I could have an mode that simply drops some older 
functionality off the CPU (say, a mode that only runs XG3 and RISC-V), 
but itself this doesn't save all that much in terms of resource costs.

Can note that a CPU core that only runs RV64GC but is otherwise similar, 
wont actually save much in terms of resource cost over still having XG3 
(well, because mostly both need essentially the same stuff in the EX 
stages and similar).

Well, and if one wants a small core, it also means no hardware FPU or 
SIMD. Etc...


Comparably, the amount and variability of stuff attached to the EX 
stages effects cost more than the exact size of the listing.

Listing size by itself matters less than things like instruction layout 
variability and similar.

Most of the "cost" of adding instructions being not in the cost of 
having them in the listing, but rather having any unique EX-side logic. 
So, a "new" instruction is cheap if it is just plugging inputs into the 
existing logic in a slightly different way; but not so cheap if it means 
new logic or new paths.



>> Though, this mostly ends up creating a pressure towards a larger GPR
>> space and having the ability to encode larger immediate and displacement
>> fields and similar for the cases where spills were common.
> 
> I did not find that, given that I waste no registers for immediates or
> displacements.
>   

Big issue was mostly functions that have large numbers of live variables.

Seemingly, my own code seems more prone to run into cases of heavy 
variable use, but then heavy variable use is often the path to better 
performance.

Well, and a lot of C code that ends up almost more structured like ASM code.


>> Also the LUI+ADDI scheme used by RISC-V, while very effective as a
>> fallback case for a 32-bit machine, falls on its face for 64-bit
>> machines. Also the design of the ISA starts to fall on its face the
>> moment one has a struct or similar that is larger than 2K.
>>
>> So:
>>     LUI+ADD+LW/SW => Sucks...
>> Well, and:
>>     SLL+ADD+LW/SW => Also sucks.
>> ...
> 
> And the only thing that always works is:
> 
>       MEM   Rd,[Rbase,Rindex<<scale,#displacement{32 or 64}]
> 
> You can access anything anywhere in a 64-bit VAS in 1 instruction--
> including transferring control through GOT.
> 

That is a heavy-hitter, though usually "good enough" in practice to 
treat index and displacement as two mutually exclusive scenarios and 
require a LEA or similar to do both.

Getting a 64-bit 3-way addition to happen within a single clock-cycle 
seems like a big ask though.

I mostly went with a more modest:
   48 + 33 << (0..3)

Had some Disp64 cases, but decided to get clever and for Disp64 the 
displacement and base register swap places; so the Disp64 functions like 
an Abs64 with a register index, Which, is maybe jank, but worked...


Can note:
   Base48 + Index48 << Sc:
     Experimented with, worked, but a little harder for timing.
   Experimental Addr64/Addr96 modes:
     Avoids timing penalty as the addressing was split.
     So, no carry propagation from low to high to worry about;
     Was mostly just pulling a trick over the existing 48b addressing.


> -------------------
>> And, like, if one were doing a lot of work with JPEG or similar, a case
>> could be made for things like YUV -> RGB converters and similar.
>> Nevermind the specific version of YUV.
>>
>> Some of my stuff used an approximation, say:
>>     Y=(4*G+3*R+B)/8; U=(B-Y)/2+128; V=(R-Y)/2+128;
>>
>> Which while not an exact match for the standard color spaces, is "close
>> enough". If mashing the result into RGB555 it may not really matter.
>> Could be realized relatively affordably in a hardware implementation.
>>
>> Well, and say:
>>     Y=(9*G+5*R+2*B)/16;
>>     ...
>> Would be more accurate, but slightly less cheap to convert back to RGB
>> (even if, yes, these factors still allow the multiplications to be done
>> via a LEA instruction or similar; it results in the reverse-side Green
>> conversion no longer being a plain shift).
>>
>> Say:
>>     G=(8*Y-3*R-B)>>2;
>> Vs:
>>     G=((16*Y-5*R-2*B)*57)>>9;
> 
> My point on all of this is to find a way to avoid approximations and
> get the well defined math done cheaply.
>   

Possibly, but the proper YCbCr math requires a lot of fixed-point 
multiply and similar.

Could use SIMD, but then one is effectively needing to do a matrix-multiply.

And, then one still needs to range-clamp the output and similar.

...

So, TBD if there is a way to make it cheap.



Even with a crappy approximation, in a Cinepak style codec the YUV->RGB 
is the bulk of the CPU time.

Though, did manage to get my recent experimental codec in this area to 
have decode speeds of 350-500 megapixels/second on my Xen+ (with a 
single-threaded decoder).


So, say:
   UPIC as a video codec   : ~        90 Mpix/sec
   BT6A (Cinepak-like)     : ~  350- 500 Mpix/sec
   BT5C (vaguely CRAM like): ~  700- 900 Mpix/sec
   MS-CRAM                 : ~ 1000-1200 Mpix/sec

MS-CRAM:
   Fastest, but terrible Q/bpp, more prone to become IO bound;
   Proper CRAM also has 8-color blocks, but better off not used.
     The add huge bulk, for not much gain in quality.

BT5C:
   Much better Q/bpp, but best case quality is still CRAM-like
   Neither BT5C nor CRAM can get particularly high image quality.
   Well, like, the RGB555 and 1-bit selectors are a bit of a damper.
   Was intended to try to get CRAM-like speeds, but fell short.

BT6A:
   Theoretically can achieve better image quality;
     YUV 4:2:0 with an 8-bit / channel;
   Fiddling has managed to get promising Q/bpp;
   Managed to get moderately fast decode speeds.
   However, work is ongoing to make the encoder fast enough.
     Not going to work if videos have implausible encode times.
   Idea was to try for "kinda like Cinepak but compresses better".


UPIC:
   Design is sorta like T.81 JPEG but with different transforms:
     8x8 BHT in place of 8x8 DCT
     RCT in place of YCbCr
     STF+AdRice (or now STF+AdSkew) in place of Huffman
     ...
   Added motion vectors and skip/delta blocks for video, like H.261;
   Could mostly manage 360p at 1 Mbps.
     Trying to to 720p and it totally falls on its face.
     Seemingly needs ~ 5 Mbps for semi-passable 720p.
       Should have been 4, but needs an extra 1 Mbps here.


Theoretically, UPIC's Q/bpp could be helped with an in-loop deblocking 
filter and sub-pixel steps; but, these would (relatively speaking) tank 
the decode speeds. Could in theory have a multithreaded decoder, but 
multithreading here is a cheap trick to make slow code look faster.

UPIC was originally more intended as a plain image format though, and 
does better in this role. It can partly take on PNG and JPEG use-cases 
(while being a little faster than either).

For images, UPIC naturally supports a lossless mode by way of using 
reversible transforms.



Meanwhile, BT6A needs a computationally demanding encoder to give 
acceptable compression. Could maybe do a quick-and-dirty encoder for 
lower compression, but then it is basically just dumping YUV with extra 
steps.

The big expensive thing mostly has to deal with "codebooks", eg:
   2x2 pixels, stored as delta-coded Y,Y,Y,Y,U,V
   4x4 pixels, stored as four 2x2 codebook indices;
     Or, 2x2 block zoomed to 4x4.
   8x8 pixels, stored as four 4x4 indices;
     Or, 2x2 zoomed to 8x8;
   16x16 pixels, stored as four 8x8 indices;
     Or, 2x2 zoomed to 16x16.

Basically, it operating on 16x16 blocks and recursively subdividing them 
quad-tree style to decide how to best encode them; building a running 
set of codebooks and then searching these codebooks to find indices to 
build the desired blocks (and track block lifetime and simulating the 
running state of the decoder at each step). This process leading to a 
relatively computationally-intensive encoding process.


Also, for better or worse, makes significant use of the properties of 
Hilbert curves. Nevermind if putting all the pixels for a 16x16 block 
into Hilbert order may seem needlessly convoluted.


However, with a lot of fiddling, was able to push the encoder into an 
area where it sorta overlaps with JPEG (BT6A still obviously inferior on 
Q/bpp though).

Still seems like something, as BT6A lacks an entropy coder.

Though, for better or worse, post-compression does very little for BT6A 
in this case. Despite being a byte-based format, there is seemingly not 
much entropy for an entropy coder to extract.

Have been able to push images below 1.0 bpp with tolerable quality, 
which is maybe still notable for a format without an entropy coder...


Still not a particularly "simple" format code-wise.

Though, checking, its decoder is still a little shorter than the BT5C or 
UPIC decoders, so at least it is not unreasonable.


Note:
Neither 5C nor 6A being intended to try to deal with the same use-cases 
as H.264 or similar though...


Well, 6A was more just to test out a design that I had thought up within 
the context of a sci-fi story though. Got it working acceptably, so the 
depiction in the story (of its general features and its artifacts) 
basically matches up.

Nevermind if my description of artifacts was mostly based on describing 
the artifacts visible in Cinepak, with slight artistic license.


Nevermind whether or not this sort of stuff makes for "gripping sci-fi" 
(and it is debatable if the story is even sci-fi when most of the 
in-universe tech is kinda inferior to what we have now).

...
Re: vector length CSR?
#685
Author: Terje Mathisen
Date: Fri, 13 Nov 2026 14:19
35 lines
2955 bytes
George Neuner wrote:
> WRT the Mill, I think people here may be missing that it supported
> short-vector-SIMD, and that a vector operand on its belt was a single
> element [of whatever width] - not a bunch of scalars that magically
> would be operated on together.

Yes and no, see below.
> 
> According to Ivan, the Mill's instruction set supported quad FP and
> 128-bit short vector SIMD.
> [Similar width as Intel's SSE2, though SSE_ doesn't do quad FP.]
> 
> He spoke about the potential for [more lanes] wider SIMD and made
> clear that, whatever widths were supported, the "operands" still would
> be treated as single belt elements.
> 
The real magic sauce is the fact that belt operands carries metadata, 
including not just byte/short/int/long/float/double/etc designators, but 
also a vector vs scalar boolean, as well as None and NAR (Not A Result, 
similar to NaN but even more powerful).

This means that Mill only needs a single ADD instruction, it 
automagically handles vector/scalar/multiple element sizes based on 
those metadata bits.

If you want to treat 16 bytes, loaded as 16 unsigned bytes, as if they 
were 8 int16_t's, then you need to convert the entry.

Terje

PS. Expect to see Mill return to being generally visible in the near future.

-- 
- <Terje.Mathisen at tmsw.no>
"almost all programming can be viewed as an exercise in caching"
Re: vector length CSR?
#687
Author: Michael S
Date: Fri, 13 Nov 2026 14:30
42 lines
3002 bytes
On Fri, 13 Nov 2026 15:19:04 +0100
Terje Mathisen <terje.mathisen@tmsw.no> wrote:

> George Neuner wrote:
> > WRT the Mill, I think people here may be missing that it supported
> > short-vector-SIMD, and that a vector operand on its belt was a
> > single element [of whatever width] - not a bunch of scalars that
> > magically would be operated on together.  
> 
> Yes and no, see below.
> > 
> > According to Ivan, the Mill's instruction set supported quad FP and
> > 128-bit short vector SIMD.
> > [Similar width as Intel's SSE2, though SSE_ doesn't do quad FP.]
> > 
> > He spoke about the potential for [more lanes] wider SIMD and made
> > clear that, whatever widths were supported, the "operands" still
> > would be treated as single belt elements.
> >   
> The real magic sauce is the fact that belt operands carries metadata, 
> including not just byte/short/int/long/float/double/etc designators,
> but also a vector vs scalar boolean, as well as None and NAR (Not A
> Result, similar to NaN but even more powerful).
> 
> This means that Mill only needs a single ADD instruction, it 
> automagically handles vector/scalar/multiple element sizes based on 
> those metadata bits.
> 
> If you want to treat 16 bytes, loaded as 16 unsigned bytes, as if
> they were 8 int16_t's, then you need to convert the entry.
> 
> Terje
> 
> PS. Expect to see Mill return to being generally visible in the near
> future.
> 

Still with aspiration to actually implement it in silicon?
Or realistic?


Re: vector length CSR?
#688
Author: EricP
Date: Fri, 13 Nov 2026 15:28
99 lines
6718 bytes
On 2026-Nov-12 15:43, Robert Finch wrote:
> On 2026-11-12 3:06 p.m., EricP wrote:
>> On 2026-Nov-10 04:03, Anton Ertl wrote:
>>> EricP <ThatWouldBeTelling@thevillage.com> writes:
>>>> I'm not sure what I'm thinking as this idea is very un-baked
>>>> but maybe the Mill's belt concept could be useful.
>>>>
>>>> Instead of treating the register file as 32 32-byte SIMD registers,
>>>> what if it was a 1024 byte belt. A variable byte length LDV Load Vector
>>>> copies a memory vector onto the belt such that element[0] lands in belt[0].
>>>> Source operands use a 10 bit belt byte offset,
>>>> and dynamic vector length of up to 32 bytes.
>>>>
>>>> Internally its implemented as a circular buffer,
>>>> with byte alignment shifters to right-align (little endian)
>>>> the source operands as they are read for each operation.
>>>>
>>>> There is no renaming because the belt output inherently
>>>> rotates the the whole belt. Internally that would just be
>>>> an byte vector alignment shifter applied to the destination.
>>>
>>> The disadvantage of a belt is that stuff vanishes from the belt (or
>>> you have to preserve it by regularly copying from the end of the belt
>>> to the beginning, so you do not get the advantage of a vector
>>> register, that you can reuse its content as often as you like without
>>> additional costs (useful, e.g., in matrix multiplication).
>>>
>>> IIRC there are vector instruction sets (maybe even RVV?) that
>>> can have more shorter or fewer longer vector registers.
>>>
>>> - anton
>>
>> Just playing around with this belt idea a bit more...
>>
>> Yes it needs other registers. So say it has
>> 32 scalar 64-bit registers that can hold integer or float values,
>> plus a 32 slot belt with 64-bit values,
>> plus 32 vector registers of 8kB each, each with a byte count,
>> and the vectors can be interpreted as 1, 2, 4 or 8 byte elements.
>>
>> Each vector instruction can source its operands from scalar, belt,
>> or vector registers. If it is a vector register then it is implied
>> that the current vector loop counter is the index to the element.
>> The result output goes to belt[0] or belt[1:0] if 128 bit result.
>> To save a belt value it must be copied to scalar, or vector register
>> at the current index, or recycled to belt[0], or to memory.
>>
>> So the belt becomes the equivalent of a forwarding network for
>> vector calculation temporaries that don't need to be saved.
>>
>> Not sure where I'm headed with this... just thinking out loud.
>>
>>
> IDK how the belt works. Sounds like a familiar architecture with a conveyor belt of operands bolted on? When does the belt advance? At one point I was trying to re-organize the re-order buffer like a belt. Queueing at one end and committing at the other. The idea was to use a shift register for the re-order buffer.

Its like an accumulator register in that it is the default result output register
but it has multiple slots that logically act like a shift register array.
As each new result is output the one at the far end falls off the belt.
Like a regular register file it is logically committed when a result is written out.

Internally it can be implemented as a shift register, or as a circular buffer,
or as a fixed physical register file with a circular renamer.

The difference is in the programming model.
A regular scalar RF (SRF) uses absolute register number addressing
while a belt register file (BRF) uses relative addressing.

With SRF when you write to R1 and that's where the result stays.
If you want to retain R1 for a later loop iteration then you have to copy it
to R2 or unroll a loop and assign a different register to each iteration.

With BRF each result is saved to belt[0] and older ones shift up.
If the belt is 32 slots then belt[31] falls off and is lost unless saved first.
One way to save a belt result is by copying back to the start belt[0].
A reference a source slot is the Nth result ago.

A belt's behaviour is inherently circular. I've not programmed a belt,
or written any vector code, but it struck me that this circular result
naming model might be more in line with how vector loops work.

In a sense this is what Mitch's VVM is doing, taking absolute SRF register id's
and renaming them into a circle as the Nth result ago, then assigning those
slots to specific reservation stations.

> Thinking about the dichotomy of vector registers versus integer and float-point ones. Why do vector registers accept either float or integer values while the integer and floating-point register files are kept separate?

In OoO either way works - an ISA can have a single unified scalar architectural
register file but internally have separate physical RF for integer and float,
with a single unified rename table. Or an ISA can have separate int and float
architectural registers but a unified physical RF with separate rename tables.

For in-order designs, having separate architecture RF gives programs a larger
register address space to work with and avoid spills. With 32 registers that
is not as necessary but with 16 or 8 registers it is very important.

> I bin planning on just using a single massive physical register file for everything. Just changing the logical register tags to fake separate register files. But there is going to be separate register files viewable in the ISA. IDK if to have separate register files for vector integers and vector floats though. Why not add even more separate register files for decimal-floats and posits too?
> 

Re: vector length CSR?
#689
Author: EricP
Date: Fri, 13 Nov 2026 15:56
61 lines
4017 bytes
On 2026-Nov-12 23:14, George Neuner wrote:
> On Tue, 10 Nov 2026 09:03:17 GMT, anton@mips.complang.tuwien.ac.at
> (Anton Ertl) wrote:
> 
>> EricP <ThatWouldBeTelling@thevillage.com> writes:
>>> I'm not sure what I'm thinking as this idea is very un-baked
>>> but maybe the Mill's belt concept could be useful.
>>>
>>> Instead of treating the register file as 32 32-byte SIMD registers,
>>> what if it was a 1024 byte belt. A variable byte length LDV Load Vector
>>> copies a memory vector onto the belt such that element[0] lands in belt[0].
>>> Source operands use a 10 bit belt byte offset,
>>> and dynamic vector length of up to 32 bytes.
>>>
>>> Internally its implemented as a circular buffer,
>>> with byte alignment shifters to right-align (little endian)
>>> the source operands as they are read for each operation.
>>>
>>> There is no renaming because the belt output inherently
>>> rotates the the whole belt. Internally that would just be
>>> an byte vector alignment shifter applied to the destination.
>>
>> The disadvantage of a belt is that stuff vanishes from the belt (or
>> you have to preserve it by regularly copying from the end of the belt
>> to the beginning, so you do not get the advantage of a vector
>> register, that you can reuse its content as often as you like without
>> additional costs (useful, e.g., in matrix multiplication).
>>
>> IIRC there are vector instruction sets (maybe even RVV?) that
>> can have more shorter or fewer longer vector registers.
>>
>> - anton
> 
> WRT the Mill, I think people here may be missing that it supported
> short-vector-SIMD, and that a vector operand on its belt was a single
> element [of whatever width] - not a bunch of scalars that magically
> would be operated on together.
> 
> According to Ivan, the Mill's instruction set supported quad FP and
> 128-bit short vector SIMD.
> [Similar width as Intel's SSE2, though SSE_ doesn't do quad FP.]
> 
> He spoke about the potential for [more lanes] wider SIMD and made
> clear that, whatever widths were supported, the "operands" still would
> be treated as single belt elements.

I didn't know that is how Mill handled SIMD but it makes sense.

I was looking at the belt style for how it names results.
Regular scalar register files use absolute addressing, eg R1.
A belt style RF uses relative addressing, eg belt[N] is the Nth result ago.

I've not programmed a belt, or a vector processor but it seemed to me that this
relative result addressing might be more in line with what vector programs need
in that it inherently names results like an unrolled loop.

My exploration had not made it as far as to consider internally packing
vector instructions and their operands together for SIMD execution but my
intuition says that the belt's relative addressing might make this much easier.

Re: vector length CSR?
#690
Author: Terje Mathisen
Date: Fri, 13 Nov 2026 16:05
50 lines
3409 bytes
Michael S wrote:
> On Fri, 13 Nov 2026 15:19:04 +0100
> Terje Mathisen <terje.mathisen@tmsw.no> wrote:
> 
>> George Neuner wrote:
>>> WRT the Mill, I think people here may be missing that it supported
>>> short-vector-SIMD, and that a vector operand on its belt was a
>>> single element [of whatever width] - not a bunch of scalars that
>>> magically would be operated on together.
>>
>> Yes and no, see below.
>>>
>>> According to Ivan, the Mill's instruction set supported quad FP and
>>> 128-bit short vector SIMD.
>>> [Similar width as Intel's SSE2, though SSE_ doesn't do quad FP.]
>>>
>>> He spoke about the potential for [more lanes] wider SIMD and made
>>> clear that, whatever widths were supported, the "operands" still
>>> would be treated as single belt elements.
>>>    
>> The real magic sauce is the fact that belt operands carries metadata,
>> including not just byte/short/int/long/float/double/etc designators,
>> but also a vector vs scalar boolean, as well as None and NAR (Not A
>> Result, similar to NaN but even more powerful).
>>
>> This means that Mill only needs a single ADD instruction, it
>> automagically handles vector/scalar/multiple element sizes based on
>> those metadata bits.
>>
>> If you want to treat 16 bytes, loaded as 16 unsigned bytes, as if
>> they were 8 int16_t's, then you need to convert the entry.
>>
>> Terje
>>
>> PS. Expect to see Mill return to being generally visible in the near
>> future.
>>
> 
> Still with aspiration to actually implement it in silicon?
> Or realistic?

I sincerely hope so since I would love to be able to run on actual 
silicon, not just a sw simulator! :-)

Terje


-- 
- <Terje.Mathisen at tmsw.no>
"almost all programming can be viewed as an exercise in caching"
Re: vector length CSR?
#692
Author: Stephen Fuld
Date: Fri, 13 Nov 2026 16:36
56 lines
3795 bytes
On 11/13/2026 7:28 AM, EricP wrote:
> On 2026-Nov-12 15:43, Robert Finch wrote:

snip
>> IDK how the belt works. Sounds like a familiar architecture with a 
>> conveyor belt of operands bolted on? When does the belt advance? At 
>> one point I was trying to re-organize the re-order buffer like a belt. 
>> Queueing at one end and committing at the other. The idea was to use a 
>> shift register for the re-order buffer.
> 
> Its like an accumulator register in that it is the default result output 
> register
> but it has multiple slots that logically act like a shift register array.
> As each new result is output the one at the far end falls off the belt.
> Like a regular register file it is logically committed when a result is 
> written out.

Yes.  I look at it as sort of a fixed length stack (put new elements at 
the top an push all other elements down) with the enhancement that you 
can address, for reading only, stack elements other than the top.


> Internally it can be implemented as a shift register, or as a circular 
> buffer,
> or as a fixed physical register file with a circular renamer.

IIRC, the Mill implements it using the output buffers of each functional 
unit plus each having a "position register" of log2 (number of FUs) bit 
register that gives that register's position within the stack.  Each 
instruction sets the register corresponding to that instruction to TOS 
and increments all the other position registers.  No actual separate 
register set and no shifting.


> The difference is in the programming model.
> A regular scalar RF (SRF) uses absolute register number addressing
> while a belt register file (BRF) uses relative addressing.

Yes.

> 
> With SRF when you write to R1 and that's where the result stays.
> If you want to retain R1 for a later loop iteration then you have to 
> copy it
> to R2 or unroll a loop and assign a different register to each iteration.
> 
> With BRF each result is saved to belt[0] and older ones shift up.
> If the belt is 32 slots then belt[31] falls off and is lost unless saved 
> first.

Yes, although with the Mill (IIRC), the "shift" is logical not physical.


-- 
  - Stephen Fuld
(e-mail address disguised to prevent spam)
Re: vector length CSR?
#697
Author: Scott Lurndal
Date: Fri, 13 Nov 2026 18:12
23 lines
1992 bytes
Thomas Koenig <tkoenig@netcologne.de> writes:
>John Levine <johnl@taugh.com> schrieb:
>> According to EricP  <ThatWouldBeTelling@thevillage.com>:
>>>Floating Point Systems had been selling attached "array processors"
>>>for PDP-11, VAX-780 and IBM systems since 1976 and colloborated with
>>>DEC in 1987 attaching to the VAX 8200, 8500, 87/8800.
>>>https://en.wikipedia.org/wiki/Floating_Point_Systems
>>
>> They were fast, but extremely difficult to program because you had to work
>> out all the paralellism by hand.  Trying to program FPS got Josh Fisher
>> thinking about trace scheduling which led to Multiflow and later Itanium.
>>
>>>The 3090 announced its vector unit on 1-Oct-1985
>>>to replace "discontinued 3838 array processor".
>>>https://en.wikipedia.org/wiki/IBM_3090#Vector_facility
>>
>> Here's the manual for it.
>>
>> https://bitsavers.org/pdf/ibm/3090/GG24-3058-0_IBM_3090_Vector_Facility_Technical_Reference_198607.pdf

There was also the one-off BSP:

https://en.wikipedia.org/wiki/Burroughs_Scientific_Processor
Re: CISC are not "unreduced"
#698
Author: MitchAlsup
Date: Fri, 13 Nov 2026 18:14
49 lines
3005 bytes
Robert Finch <robfi680@gmail.com> posted:

> On 2026-11-12 8:18 p.m., MitchAlsup wrote:
> > Robert Finch <robfi680@gmail.com> posted:
> > 
> >> On 2026-11-12 2:19 p.m., MitchAlsup wrote:
> >>> anton@mips.complang.tuwien.ac.at (Anton Ertl) posted:
> >>>
> >>>> Stefan Monnier <monnier@iro.umontreal.ca> writes:
> > -----------------------
> >>> Performing a series of FMAC steps in the FMAC unit is straightforward--
> >>> feeding the polynomial evaluation a series of coefficients is not--
> >>> unless those coefficients are stored in ROM in the FMAC unit itself.
> >>> Thus, My 66000 transcendentals.
> >>>
> >> Why cannot the polynomical coefficients be passed in registers?
> > 
> > Are you going to make a RS-entry with 9 Src2 operands ???
> >   
> But cannot the calc be broken up into sequential elements?

Do you break up FMUL or FDIV into individual steps ???

> Q+ FPOLY instruction expands into multiple FMA micro-ops.

I just lob SIN() at the FMAC unit; which has a SIN() sequencer.

> The micro-ops only need a few src operands. The next coefficient is 
> assumed to come from the next register.
> It is using Horner's rule.

Which is FMAC latency dependent ...

> FPOLY has a cascade input option so it can be called as many times as 
> desired.
> 
> Of course the Q+ micro-op translator is kinda huge, maybe unworkable IRL.
> 
> 
> 
> >>>>> [ In contrast, vVM is definitely RISCy from that standpoint.  ]
> >>>>
> >>>> VVM is a microarchitectural mechanism, so architectural concepts like
> >>>> RISC and CISC are inappropriate for that.  You may want to discuss the
> >>>> VEC and LOOP instructions of MY 66000.
> >>>>
> >>>> - anton
> >>
> 
Re: CISC are not "unreduced"
#705
Author: Anton Ertl
Date: Fri, 13 Nov 2026 18:26
123 lines
7346 bytes
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>Anton Ertl [2026-11-12 06:21:21] wrote:
>> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>>>Yeah, if we take CISC as motivated by the desire to provide an assembly
>>>language that is comfortable for humans, we can also take RISC as
>>>motivated by the desire to provide an assembly language that's
>>>convenient for compilers (which would rather not need to worry about
>>>tradeoffs between using LD+ADD+ST vs using some fancy addressing mode
>>>on ADD).
>> The fancy addressing mode is the same whether you use it with a LD, a
>> ST, or an ADD.
>
>That's beside the point.  With a load/store architecture you don't need
>to choose between using the ADD-with-addressing mode or using explicit
>loads and stores.  Makes life simpler for the compiler.

No.  With an architecture like the VAX, RISC is actually harder:

VAX: If operand src1 is in memory, accessed with d(SP), use the ADD
instruction with d(SP) as second operand.  Likewise for src2 and dst.

RISC: If operand src2 is in memory, allocate a register for it (but
why is it in memory? Probably because there are no registers
available, so first spill some other value); then load the operand
from d(SP) into the register; possibly do the same for the other
source operand (but don't spill the register for src2). If the
destination is in memory, allocate a register for storing it in the
meantime (again with the potential for spilling).  Finally do the add.
Store the result if necessary.  And now refill all the spilled values.

It's all doable, but simpler?  No.

For the more common CISC style with load-and-op and read-modify-write,
things are harder than on the VAX, but RISC still is not simpler.

>> Compilers actually have no problem using that addressing mode,
>> especially in an architecture like VAX: When the variable resides in a
>> register, use a register, when it's in memory, use the appropriate
>> addressing mode.
>
>What if explicit loads and stores are faster/slower?

If using the hardware as a load/store architecture is preferable, then
the compiler will just generate that code, and it will be just as hard
or simple as on a RISC.

If the load-op and RMW instructions are preferable, the compiler can
just use them when the operand is in memory.

>And how is the answer affected by subsequent operations accessing the
>same memory location?

Just the same as on a RISC: You run register allocation before
instruction selection, so if a value is accessed several times and
registers are available, the value will be allocated into a register,
on both architecture styles.  Then the instruction selection sees that
there is a register access for src1 of an add, and on either style of
architecture will just access it in a register, making the RISC case
much easier.

>> (optimality is more difficult, but for trees has been
>> reached with tree-parsing, as used in burg or iburg).
>
>And this is useful for CISC but much less so for RISC, so you can use
>a simpler compiler for RISC instruction sets.

It's also useful for RISCs, because it has instructions that combine a
constant with an operation, and instructions that add a constant and a
register, and then use the resulting address in a load (or store); not
to mention addressing modes of, e.g., the 88K architecture.  And
auto-increment/decrement addressing modes, such as available on ARM
A32 and A64, and HPPA, do not fit the tree parsing paradigm.

I taught the students to use iburg/burg when the compiler course was
run on an Alpha, and I am telling them to do that now, when the
compiler course runs on an AMD64 machine.  The usage of these tools
depends far more on the student than on the architecture.

>> AES instructions are not particularly convenient for CPU implementors,
>> probably on the contrary, because they need hardware that is not
>> useful for anything else.
>
>AFAIK, AES was designed specifically to give access to that extra
>hardware.  More specifically, manufacturers were eager to add more FPUs
>and the question they faced was how to make that hardware available to
>the programmer.
>IOW it's "more hardware" that caused AES rather than the other way around.

I read about CPU designers having to cut down their designs when the
realization comes closer (silicon diet).  So it's not that they had
silicon to spend on useless things.  I think they wanted to offer AES
because they expected people to actually use it (and I think they were
right).

And one other benefit of these instructions is that they avoid the
cache side channels that implementations based on other instructions
are likely to have.

>And AFAICT, AES is a fairly naive/simple way (for the CPU implementor)
>to give access to that hardware.

One you have decided to implement AES in hardware, the question is,
how.  The VAX way (as shown in POLY) is to have one instruction that
takes the key (maybe the preprocessed key) and does it all.  Intel
chose to have an instruction that performs a round, and use 9
instances of this instruction plus a separate one for the last round.
That looks like a rather RISCy approach to me, but of course it still
has the CISC property of having a memory operand.  It also has an
instruction for preprocessing the key, and I think you need to use
that multple times.

>> vVM is a microarchitectural mechanism,
>
>Is it?  I use it as a way to refer to the design of VEC+LOOP (which is
>so designed as to allow a particular micro-architecture).

Architecturally, LOOP is a branch (maybe it also deals with the loop
counter?), and VEC is a noop AFAIK.

- anton
-- 
'Anyone trying for "industrial quality" ISA should avoid undefined behavior.'
  Mitch Alsup, <c17fcd89-f024-40e7-a594-88a85ac10d20o@googlegroups.com>
Re: CISC are not "unreduced"
#709
Author: Anton Ertl
Date: Fri, 13 Nov 2026 21:51
36 lines
3153 bytes
anton@mips.complang.tuwien.ac.at (Anton Ertl) writes:
>Stefan Monnier <monnier@iro.umontreal.ca> writes:
>>And how is the answer affected by subsequent operations accessing the
>>same memory location?
>
>Just the same as on a RISC: You run register allocation before
>instruction selection, so if a value is accessed several times and
>registers are available, the value will be allocated into a register,
>on both architecture styles.

Actually, normally register allocation is performed after instruction
selection.  So if the operand is a local variable that can be in a
register (no address taken), it will be assumed to be in a register,
for instruction selection.  Later the register allocator actually
tries to allocate a register for the variable, and if not, on a RISC
spill code is inserted with additional live ranges, and the register
allocator has to run again (at least that's the way that Chaitin and
Briggs described this).  On a VAX, you just use a memory operand for
those variables that do not fit into registers.

>>> vVM is a microarchitectural mechanism,
>>
>>Is it?  I use it as a way to refer to the design of VEC+LOOP (which is
>>so designed as to allow a particular micro-architecture).
>
>Architecturally, LOOP is a branch (maybe it also deals with the loop
>counter?), and VEC is a noop AFAIK.

And the fact that VVM is a microarchitectural mechanism is it's
beauty.  The semantics are just the same as for the whole loop without
VVM.

- anton
-- 
'Anyone trying for "industrial quality" ISA should avoid undefined behavior.'
  Mitch Alsup, <c17fcd89-f024-40e7-a594-88a85ac10d20o@googlegroups.com>
Re: CISC are not "unreduced"
#714
Author: Stefan Monnier
Date: Fri, 13 Nov 2026 22:42
25 lines
3006 bytes
Thomas Koenig [2026-11-13 11:02:07] wrote:
> Stefan Monnier <monnier@iro.umontreal.ca> schrieb:
>> Anton Ertl [2026-11-12 06:21:21] wrote:
>>> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>>>>Yeah, if we take CISC as motivated by the desire to provide an assembly
>>>>language that is comfortable for humans, we can also take RISC as
>>>>motivated by the desire to provide an assembly language that's
>>>>convenient for compilers (which would rather not need to worry about
>>>>tradeoffs between using LD+ADD+ST vs using some fancy addressing mode
>>>>on ADD).
>>> The fancy addressing mode is the same whether you use it with a LD, a
>>> ST, or an ADD.
>> That's beside the point.  With a load/store architecture you don't need
>> to choose between using the ADD-with-addressing mode or using explicit
>> loads and stores.  Makes life simpler for the compiler.
> I agree.  But a large amount of optimization has gone into architectures
> with have memory operands (especially x86), so this is in large part
> a solved problem.

I'm not disagreeing but that's now, so it doesn't really change the fact
that "RISC [w]as motivated by the desire to provide an assembly language
that's convenient for compilers" (among other desires).


=== Stefan
Re: CISC are not "unreduced"
#715
Author: Stefan Monnier
Date: Fri, 13 Nov 2026 22:54
41 lines
3766 bytes
Anton Ertl [2026-11-13 18:26:42] wrote:
> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>>That's beside the point.  With a load/store architecture you don't need
>>to choose between using the ADD-with-addressing mode or using explicit
>>loads and stores.  Makes life simpler for the compiler.
> No.  With an architecture like the VAX, RISC is actually harder:
> VAX: If operand src1 is in memory, accessed with d(SP), use the ADD
> instruction with d(SP) as second operand.  Likewise for src2 and dst.
>
> RISC: If operand src2 is in memory, allocate a register for it (but
> why is it in memory? Probably because there are no registers
> available, so first spill some other value);

AFAIK at the point you make this choice you haven't performed register
allocation yet, so if it's in memory it's for other reasons than
register pressure and you don't need to allocate a register, you
allocate a "variable" instead (which will likely be mapped to
a register later on).

> It's all doable, but simpler?  No.

In my experience it is, because each indirection from the high-level
language maps to basically a single simple LD/ST.  In contrast to use
VAX's ADD-with-memory you have to combine such an indirection with the
addition operation, so you need to do the burg kind of dance.

>>And this is useful for CISC but much less so for RISC, so you can use
>>a simpler compiler for RISC instruction sets.
>
> It's also useful for RISCs, because it has instructions that combine a
> constant with an operation, and instructions that add a constant and a
> register, and then use the resulting address in a load (or store); not
> to mention addressing modes of, e.g., the 88K architecture.  And
> auto-increment/decrement addressing modes, such as available on ARM
> A32 and A64, and HPPA, do not fit the tree parsing paradigm.

Yup.  They didn't push the "make it simple for compilers" as far as they
could have.  There were other competing desires.


=== Stefan
Re: vector length CSR?
#711
Author: MitchAlsup
Date: Sat, 14 Nov 2026 00:27
29 lines
2424 bytes
Thomas Koenig <tkoenig@netcologne.de> posted:

> Stephen Fuld <sfuld@alumni.cmu.edu.invalid> schrieb:
> > On 11/11/2026 10:53 PM, Thomas Koenig wrote:
> >> Stephen Fuld <sfuld@alumni.cmu.edu.invalid> schrieb:
> >> 
> >>> It seems the
> >>> advantage of an SIMD approach is the large set of addressable registers
> >>> that can be used to keep data readily available for future use.
> >> 
> >> Plus, you can do wide permutes, and it can also help with reduction.
> >> Having mask for reducing operations also helps (or a length field).
> >> 
> >> There is one other thing that VVM does not do natively: Reductions
> >> on commutative operators. 
> >
> > When we talked about reductions on VVM in a thread some months ago, I 
> > thought Mitch said that VVM could parallelize such reductions, including 
> > handling an array size that was not a multiple of the number of 
> > functional units used (i.e. the degree of parallelism), and combining 
> > the partial sums at the end.  As I have said, I am not a hardware guy 
> > but that sounded impressive and I don't know how he does that.
> 
> I don't see this in the manuals, at least.  Mitch, did I miss it?

The augend input to FMAC has a special feed-forward mechanism
{µArchitectural}

I may have to do something special when running 4-wide.
Re: CISC are not "unreduced"
#713
Author: Anton Ertl
Date: Sat, 14 Nov 2026 09:12
40 lines
3489 bytes
anton@mips.complang.tuwien.ac.at (Anton Ertl) writes:
>Actually, normally register allocation is performed after instruction
>selection.  So if the operand is a local variable that can be in a
>register (no address taken), it will be assumed to be in a register,
>for instruction selection.  Later the register allocator actually
>tries to allocate a register for the variable, and if not, on a RISC
>spill code is inserted with additional live ranges, and the register
>allocator has to run again (at least that's the way that Chaitin and
>Briggs described this).  On a VAX, you just use a memory operand for
>those variables that do not fit into registers.

The latter is oversimplified, too.

E.g., if you have a statement

c[i] = a[i] + b[i];

If a, b, c, and i are all in (pseudo-)registers, this can be one
instruction on the VAX, and any somewhat sophisticated instruction
selector will select it, whether optimal or not.  But if it turns out
that the pseudo-register for a does not fit in a real register, and
has to be spilled to d(SP), the whole thing does not fit in an
instruction*, and, e.g., there has to be a load of a into a register
first, leading to all the same problems that RISCs already have for
c=a+b.  There is a reason why bugs tend to hide in register
allocation; I remember reading that one register allocator needed to
process 10 million lines of code until all bugs had been found (and
10M lines was a lot at the time).

* I have not examined the VAX instruction set to see if it has an
  addressing mode that covers this case.  If it has, then this
  particular example does not show the problem, but given that VAX
  instructions are finite, one can construct an example where an
  in-register value fits in the instruction, while the in-memory value
  does not.

- anton
-- 
'Anyone trying for "industrial quality" ISA should avoid undefined behavior.'
  Mitch Alsup, <c17fcd89-f024-40e7-a594-88a85ac10d20o@googlegroups.com>
Re: vector length CSR?
#717
Author: Thomas Koenig
Date: Sat, 14 Nov 2026 14:04
40 lines
3245 bytes
MitchAlsup <user5857@newsgrouper.org.invalid> schrieb:
> Thomas Koenig <tkoenig@netcologne.de> posted:
>
>> Stephen Fuld <sfuld@alumni.cmu.edu.invalid> schrieb:
>> > On 11/11/2026 10:53 PM, Thomas Koenig wrote:
>> >> Stephen Fuld <sfuld@alumni.cmu.edu.invalid> schrieb:
>> >> 
>> >>> It seems the
>> >>> advantage of an SIMD approach is the large set of addressable registers
>> >>> that can be used to keep data readily available for future use.
>> >> 
>> >> Plus, you can do wide permutes, and it can also help with reduction.
>> >> Having mask for reducing operations also helps (or a length field).
>> >> 
>> >> There is one other thing that VVM does not do natively: Reductions
>> >> on commutative operators. 
>> >
>> > When we talked about reductions on VVM in a thread some months ago, I 
>> > thought Mitch said that VVM could parallelize such reductions, including 
>> > handling an array size that was not a multiple of the number of 
>> > functional units used (i.e. the degree of parallelism), and combining 
>> > the partial sums at the end.  As I have said, I am not a hardware guy 
>> > but that sounded impressive and I don't know how he does that.
>> 
>> I don't see this in the manuals, at least.  Mitch, did I miss it?
>
> The augend input to FMAC has a special feed-forward mechanism
> {µArchitectural}
>
> I may have to do something special when running 4-wide.


So, in order to do efficient reductions, the vectorized VVM
loops will also have to be unrolled, with a final horizontal
reduction step (like I wrote above).

-- 
This USENET posting was made without artificial intelligence,
artificial impertinence, artificial arrogance, artificial stupidity,
artificial flavorings or artificial colorants.
Re: vector length CSR?
#721
Author: Michael S
Date: Sat, 14 Nov 2026 16:18
62 lines
3760 bytes
On Fri, 13 Nov 2026 17:05:26 +0100
Terje Mathisen <terje.mathisen@tmsw.no> wrote:

> Michael S wrote:
> > On Fri, 13 Nov 2026 15:19:04 +0100
> > Terje Mathisen <terje.mathisen@tmsw.no> wrote:
> >   
> >> George Neuner wrote:  
> >>> WRT the Mill, I think people here may be missing that it supported
> >>> short-vector-SIMD, and that a vector operand on its belt was a
> >>> single element [of whatever width] - not a bunch of scalars that
> >>> magically would be operated on together.  
> >>
> >> Yes and no, see below.  
> >>>
> >>> According to Ivan, the Mill's instruction set supported quad FP
> >>> and 128-bit short vector SIMD.
> >>> [Similar width as Intel's SSE2, though SSE_ doesn't do quad FP.]
> >>>
> >>> He spoke about the potential for [more lanes] wider SIMD and made
> >>> clear that, whatever widths were supported, the "operands" still
> >>> would be treated as single belt elements.
> >>>      
> >> The real magic sauce is the fact that belt operands carries
> >> metadata, including not just byte/short/int/long/float/double/etc
> >> designators, but also a vector vs scalar boolean, as well as None
> >> and NAR (Not A Result, similar to NaN but even more powerful).
> >>
> >> This means that Mill only needs a single ADD instruction, it
> >> automagically handles vector/scalar/multiple element sizes based on
> >> those metadata bits.
> >>
> >> If you want to treat 16 bytes, loaded as 16 unsigned bytes, as if
> >> they were 8 int16_t's, then you need to convert the entry.
> >>
> >> Terje
> >>
> >> PS. Expect to see Mill return to being generally visible in the
> >> near future.
> >>  
> > 
> > Still with aspiration to actually implement it in silicon?
> > Or realistic?  
> 
> I sincerely hope so since I would love to be able to run on actual 
> silicon, not just a sw simulator! :-)
> 
> Terje
> 
> 


Aiming too high, you'll hit nothing for sure.
Being realistic, it was possible to have Mill running as a soft core on
FPGA back in the previous decade.
Which could have helped with higher aspirations as well. Of course,
under assumption that the whole idea of Mill holds water.




Page 2 of 4 • 179 total messages
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads