[PD] [OT] SSE/MMX tips?

Mathieu Bouchard matju at artengine.ca
Thu Sep 8 17:10:34 CEST 2011

On Wed, 7 Sep 2011, Bill Gribble wrote:

> It's really just for fun anyway.

Well, if you wanted to really use SSE in that case, it would be 
appropriate to process 4 interleaved signals at once, or at least two.

Btw, if you want something fun, consider :

   a+b = (a^b) + ((a&b)<<1)

that is, addition of ints can be split into a variable number of steps :

   int add (int a, int b) {return b ? add(a^b,(a&b)<<1) : a;}

where the number of steps is the number of consecutive carries (of ones) 
it has to do. (how many average steps does that make, for random ints ?)

I've always found this formula fascinating, but I'm still waiting for the 
occasion to make use of it, 15 years later :)

| Mathieu Bouchard ---- tél: +1.514.383.3801 ---- Villeray, Montréal, QC

More information about the Pd-list mailing list