[PD-dev] using SIMD instructions in externals

IOhannes m zmoelnig zmoelnig at iem.at
Wed Jan 18 14:58:16 CET 2006


Ed Kelly wrote:
> the perform routine, or am I missing something here? I
> apologise for my lack of knowledge...

well, you have to write simd yourself!
i think this was unclear from previous posts.

in pd_devel several often used functions (like adding 2 dsp-vectors) are 
implemented in SIMD.
if you don't want to do that (add 2 dsp-vectors) then you will have to 
write SIMD-code yourself (ah yes, i am repeating repeating).

however, you might get a glimpse of how it is done.

for obvious reasons i (once again) would suggest to rather have a look 
at zexy how you would write SSE-code in an external.
(e.g. look at the implementation of abs~ in the CVS-zexy)

while the tastes differ, i have found it most convenient to write 
SIMD-code not in assembler but rather in intrinsics (C-like 
function-wrappers around assembler): apart from taste this has also the 
benefit of being portable across different compilers (e.g. you can use 
the same implementation for both gcc and icc and m$vc).

note however, that you have it doesn't create code that is portable 
across different architectures (you need different implementations for 
SSE and AltiVec, even though you compile both with gcc)

if you want to write code that is both portable across compilers and 
architectures, you should use C ;-)


mfa.sdr
IOhannes




More information about the Pd-dev mailing list