[PD-dev] Non-branching clipping algo...

Thomas Grill t.grill at gmx.net
Mon Oct 13 10:39:34 CEST 2003


Hi Luigi,
i'm not sure if it's really necessary to avoid branching in any case.
All of the new CPUs have a branch prediction that keeps the instruction
queues filled, so it's maybe only about hinting the CPU in the right
direction.
There are general rules how branching is predicted (like jumps forward are
not suspected to happen, while jumps backwards are) - have a look at the CPU
manuals!

best greetings,
Thomas

----- Original Message ----- 
From: "Luigi Castelli" <superbigio at yahoo.com>
To: <pd-dev at iem.at>
Sent: Monday, October 13, 2003 4:40 AM
Subject: [PD-dev] Non-branching clipping algo...


> Hi,
>
> I am trying to find a way to clip incoming values to a
> range from 0.0 to 1.0 without using branching.
>
> I found a bunch of algorithms on musicdsp.org to
> achieve clipping without branching but none were
> satisfactory.
>
> What I am really aiming for is to find a way to modify
> the tabfudge technique used in d_osc.c to achieve
> clipping instead of wrapping. Is that possible ?
>
> Thanks for any help or suggestion.
>
> - Luigi
>
> =====
> Luigi Castelli
>
> superbigio at yahoo.com
>
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product search
> http://shopping.yahoo.com
>
> _______________________________________________
> PD-dev mailing list
> PD-dev at iem.at
> http://iem.at/cgi-bin/mailman/listinfo/pd-dev
>
>





More information about the Pd-dev mailing list