🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.arch
Article #933

Re: vector length CSR?

#933
From: MitchAlsup
Date: Tue, 24 Nov 2026 22:22
122 lines
6977 bytes
Thomas Koenig <tkoenig@netcologne.de> posted:

> Stephen Fuld <sfuld@alumni.cmu.edu.invalid> schrieb:
> > On 11/9/2026 9:08 AM, Stephen Fuld wrote:

By the way the first v in vVM is lower case.

> >
> > I issued the following "challenge".
> >
> >> I can't speak to the hardware complexity of the implementation.  Perhaps 
> >> that is a limiting factor.  But barring that, and the mental effort 
> >> required to "reorient" your thinking, I don't see why any new clean 
> >> sheet design would use SIMD instructions.  Perhaps someone can explain 
> >> why it should.
> >
> > The results were, at least to me, quite enlightening.  I think it might 
> > be useful to summarize these responses.  I group the types of problems 
> > that people thought SIMD was better at than VVM into three areas.
> >
> > The first group is exemplified by Anton bringing up the types of 
> > problems where memory values are reused in the vector registers.  He 
> > gave matrix multiplication as an example.  Terje presented an algorithm 
> > which others indicated was competitive with the SIMD method.  Note that 
> > I am not ruling out that there may be other problems that fit into this 
> > group but aren't amenable to the kind of solution Terje presented.  So I 
> > count that as worst case, a "tie".  But so far, not a compelling 
> > argument for SIMD.
> 
> I'm not really sure I understand, then.  VVM always has to access
> memory at cache latencies (4-5 cycles); register access does not
> need that, and clever algorithms can resuse that data to good effect.

My guess is that when the execution window is big enough to absorb
the cache latency, then there is little advantage to SIMD (if any).
 
> > The second group is "reductions" of various types.  Mostly, this came 
> > down to the question of whether the operation on the given data type 
> > could be parallelized or "reassociated".  I think we have come down to 
> > the following:
> >
> > 	For operations on unsigned integers, or on signed integers with certain 
> > compile options, and operations such as MAX, VVM has the advantage as it 
> > can parallelize them and, perhaps with some additional design work by 
> > Mitch, combine the partial results at the end, including handling sizes 
> > that are not a integer multiple of the amount of parallelization.  This 
> > seems like a big win for VVM.
> 
> VVM is always at an advantage when the SIMDified and the size of
> the hardware SIMD registers is unknown at compile and can leave
> all the loop peeling and other assorted nastiness to hardware.

Of somewhat higher importance is that the compile time SIMD-width
is a burden on SIMD that vVM does not have. If todays vVM is 256-
bits wide and tomorrows' is 124-bits wide--that same code is just
as optimal today as it is tomorrow.
 
> But a four-lane SIMD, for example, could do the same.  It would
> need a reduction step at the and, as well.

Just a note: a 4-lane DP FP SIMD pipeline is 256-bits wide, and can
handle {4-DP FP, 8 SP FP, 16 HP FP, 4 Dint, 8 Wint, 16 Hint, 32 Bint}.
 
> > 	For operations on signed integers where preserving possible internal 
> > overflows, etc. are required VVM can't parallelize them (signified by 
> > specifying 1 in the number of lanes field in the VEC instruction).

I see exception handling migrating from "take a trap" to "make flow
control exception-branches" and leave the whole mess to SW. How 
much faster is {Branch-on-integer-arithmetic-anomaly Anom, label}
than taking the trap, having trap handling setup a signal handler
setup an exception frame on application stack, and calling signal
handler.

Newer exception experiments are looking to optimize TRY-THROW-CATCH
with various SW conventions and stacked data.
 
> That is an interesting question.  Today's hardware does two's
> complement, so under "as if" rule a compiler could just happily do
> the summation in hardware and look at the end result; intermediate
> overflows will just be ignored, and as long as the end result fits,
> all is in order.  A Fortran compiler calculating the SUM
> intrinsic could just do that.  A C compiler could also do that
> if it chose to (and it seems that LLVM choses to do so at least
> for the a + b + c + d case).
> 
> > But 
> > there is still a more modest advantage for VVM in that reading the data 
> > from memory doesn't "scrub" the cache, and the loop termination test is 
> > a single instruction.
> >
> > 	For operations on floating point, with some "not yet filed" stuff, VVM 
> > has the advantage in that the operation can be parallelized without loss 
> > of precision.
> >
> > So overall, for this second group, I see no argument for SIMD.
> 
> If VVM can do reductions, yes.
> 
> > The third group, and one we really haven't discussed in this thread 
> > beyond Thomas' first mention is wide permutations.  I wasn't familiar 
> > with the relevant capabilities in AVX512, so I had to do a little 
> > research.  While My 66000 has a permute instruction, and perhaps if 
> > preceded by a Double instruction modifier can be wider, I don't see how 
> > it can compete with the 512 byte wide permutation in three cycles 
> > provided by AVX512, nor the capability to do byte wide permutes where 
> > the source isn't required to be a 8 bit boundary.  So if these kinds of 
> > operations are used often, then SIMD may be a requirement.
> 
> That is what i think, too.

Many times the indexes of the loaded memory provide for the kind
of permutation, so you don't need the PERM as an instruction; it
is just something that the vVM loop-to-loop analyzer needs to
figure out--once figured out {easy when constant} the LD-buffer
is routed to FUs based on the permutation.
 
> Those cases are not for auto-vectorization, you would have to
> write them especially with the special SIMD capabilities in mind.
> 
> > Of course, I welcome comments, additions, subtractions (!), etc.
> 
Technical Details
Message-ID: <1795558948-5857@newsgrouper.org>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!newsgrouper.org!.POSTED!not-for-mail
References: <11cpqih$acf5$1@dont-email.me> <sgu0flpndaqltpdbft40fghmi7vk78q2hs@4ax.com> <11cq2v7$dh5b$1@dont-email.me> <8jk1fl182pskj3fsmp4ju6qf420pgl0htg@4ax.com> <11csull$1ef6e$1@dont-email.me> <11e4r47$3582p$1@dont-email.me> <11e4ua9$34dsm$3@dont-email.me>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!newsgrouper.org!.POSTED!not-for-mail
From: MitchAlsup <user5857@newsgrouper.org.invalid>
Newsgroups: comp.arch
Subject: Re: vector length CSR?
References: <11cpqih$acf5$1@dont-email.me>
  <sgu0flpndaqltpdbft40fghmi7vk78q2hs@4ax.com> <11cq2v7$dh5b$1@dont-email.me>
  <8jk1fl182pskj3fsmp4ju6qf420pgl0htg@4ax.com>
  <11csull$1ef6e$1@dont-email.me> <11e4r47$3582p$1@dont-email.me> <11e4ua9$34dsm$3@dont-email.me>
Date: Tue, 24 Nov 2026 22:22:28 GMT
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Message-ID: <1795558948-5857@newsgrouper.org>
Injection-Info: newsgrouper.org; mail-complaints-to="newsgrouper@yahoo.com"; posting-account=user5857
Injection-Date: Tue, 24 Nov 2026 22:22:28 GMT
User-Agent: Newsgrouper/0.9.0