[PD-dev] d_math.c "break[s] strict-aliasing rules"

Tim Blechmann tim at klingt.org
Thu Apr 19 16:18:43 CEST 2007


hi miller,

On Wed, 2007-04-18 at 18:13 -0700, Miller Puckette wrote:
> Well, I measured the difference and didn't see significant speedup (on an
> imac recently)... eventually it might make a difference, of course.  But
> certain bit-bashing code (the square root thing, but more importantly 
> phasor~ and osc~) runs half again faster than any version I've been able
> to write with strict aliasing.

i did some benchmarks of pd's phasor~ code against a straight-forward
implementation on my pentium-m, when implementing the objects for nova.
the straight-forward implementation ran about 20 to 30 % faster than the
pd-style implementation.
code like sqare root or inverse square root can be coded by just
utilizing the rsqrtps and sqrtps opcodes, with a 14 bit precision, when
working on the sse unit ...

> An alternative would be to special-case the offending code somehow.  This
> could be part of a larger effort to make the DSP code modular so that SSE
> instructions and whatnot could also be "plugged in".  Worth thinking about...

according to the gcc manual, simple vectorizable operactions, that's
used for audio processing, can be autovectorized, if (and only if) the
programmer takes care of both alignment and aliasing issues ... 

tim

--
tim at klingt.org    ICQ: 96771783
http://tim.klingt.org

Life is really simple, but we insist on making it complicated.
  Confucius
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puredata.info/pipermail/pd-dev/attachments/20070419/5c2c183f/attachment.pgp>


More information about the Pd-dev mailing list