Re: The myth of fingerprints, er, no, garbage collectors

"Tim Bradshaw (as tfb at cley dot com)" <[email protected]> Sun, 28 Jun 2026 16:40:32 +0100
Newsgroups gmane.lisp.lispworks.general
Message-ID <[email protected]>
On 25 Jun 2026, at 21:42, Yuri Davidovsky <[email protected]> wrote:
> 
> My custom struct thing is live and kicking in the meantime. Working now on an upgrade that allows it to lay data out in a simd friendly format while being able to access structs in a sequential manner in lisp seamlessly.

I am confused (really, this isn't rhetorical) about why you need this typed-aref stuff for SIMD.

As best I can tell what you need to make use of SIMD instructions is to be able to pad arrays of whatever type to whatever lengths the SIMD instructions like.  But SIMD is, well, single instruction on multiple things, so the things in your array are all going to want to be the same data type.

My SOA thing will do that.  It obviously doesn't have any explicit SIMD support (it's portable-up-to-MOP CL), but it does have an interface which will tell you both what slot lives where, and expose the arrays which hold array slots, which you could, for instance, pass to C functions.  You can provide it with array-constructor functions: these need to return the right sorts of array but can, for instance statically-allocate an array (or some of the arrays for an object with many types in it).

I've not tested this for SIMD things because the idea of writing C to do that makes me feel even more ill than any other kind of C.  But certainly doing things from C to these arrays works just fine.

So as best I can tell, the typed-aref stuff is just an approach to be able to ram elements of different types into some array?  It's not to do with SIMD?

Obviously doing that has advantages: it saves you array headers, for instance (SOA needs a different array for each slot with a distinct upgraded-array-element-type).  Perhaps it gets you better cache behaviour.

(Unless SIMD things require some data layout which isn't just arrays of values?  I can imagine all the fortran people (I was a fortran person) looking to speed up their code which has vast arrays of doubles being ... really not pleased by that.)


Or perhaps I am confused.

--tim


_______________________________________________
Lisp Hug - the mailing list for LispWorks users
[email protected]
http://www.lispworks.com/support/lisp-hug.html