Jussi Laako wrote:
On Sun, 2005-11-20 at 12:54 +1100, Dave Robillard
wrote:
Out of curiosity, how expensive is this runtime
architechture check?
It's done only once at initialization time and even there it's matter of
< 100 machine instructions.
At runtime the cost is doing integer comparison.
For multimedia applications, one crafts a different entire function per
CPU type. One then simply uses function pointers to select the best
function at init stage. This therefore results in a jump without a
comparison.
For example, A resampling routine. There is a CPU specific function to
handle a block of samples, so the extra "jump" cost is only used per
sample block, and not per SIMD instruction.
James