[PD-dev] SIMD for core Pd objects vs. my crappy C

Tim Blechmann TimBlechmann at gmx.net
Fri Dec 2 02:15:54 CET 2005


> > So I just had a thought, perhaps its not an original one.  I was  
> > thinking that if the core Pd objects were well optimized, using
> > SIMD and all that good stuff, then the objects I write in Pd might 
> > actually  be comparable in speed to the objects I write in plain C 
> > (I'm no  assembly programmer).
> >
> that is largely dependent to what you are doing - there can still be 
> enormous differences, with or without SIMD.

right . .. see my volctl~ external. it consists of
two functions:

|
|  |line~|
|  |
|*~|
|

and 

|
|*~ 1|
|

one is a vector-vector multiplication with a vector generation, the
other is a vector-scalar multiplication ...

the dispatching between the two functions can't be done in the pd
patch (unless you somehow have a coding for a signal vector to be
constant, which would not be trivial to introduce to pd)


> > So on that topic, how hard would it be to make patches for the
> > SIMD stuff that would apply to MSP's sources?
> 
> now that quite some time has passed it's a lot of work.
> And i don't see the actual merits since Miller has stated a few times 
> that he doesn't want to incorporate them.
> 
> It's no _real_ problem, because within 5-10 years autovectorization 
> functionalities in all major compilers will take that into account.

this is not exactly true... no compiler i know actually does
autovectorization (i've not tried gcc-4, yet), but even the highly
optimized intel c compiler doesn't generate proper simd code.

still, i doubt, that compilers will ever be possible to generate code
for more complex functions. especially functions, that are formulated
with branches (clipping, peak finding, sign, denormal bashing), are not
easy to optimize. but especially these functions have the highest 
speedups (according to my benchmarks)....

t

-- 
mailto:TimBlechmann at gmx.de    ICQ: 96771783
http://www.mokabar.tk

latest mp3: kMW.mp3
http://mattin.org/mp3.html

latest cd: Goh Lee Kwang & Tim Blechmann: Drone
http://www.geocities.com/gohleekwangtimblechmannduo/

After one look at this planet any visitor from outer space 
would say "I want to see the manager."
				      William S. Burroughs




More information about the Pd-dev mailing list