4 ms·
And, BTW, I wouldn't try to hand tune assembly code with a modern x86 even if my life depended on it. Writing fast modern x86 assembly is often way easier than
by DarkShikari 15y ago
And, BTW, I wouldn't try to hand tune assembly code with a modern x86 even if my life depended on it.
Writing fast modern x86 assembly is often way easier than for most any other CPU because instruction ordering generally doesn't matter much as a result of OOE (outside of Atom, at least). This basically lets you BS together a function without thinking too hard about anything other than the individual instructions.
It's trivial to beat the performance of typical C code by a factor of 10-20 in many situations, particularly in the case of DSP functions, as per the topic.
Some typical cases (measured in cycles):
8x8 iDCT, 16-bit input to 8-bit output:
add8x8_idct8_c: 779
add8x8_idct8_sse2: 56
6-tap interpolation filter, 8-bit input, 16-bit intermediate, 8-bit output:
hpel_filter_c: 13093
hpel_filter_ssse3: 1770
Bilinear downscaling filter, 8-bit input, 8-bit output:
lowres_init_c: 16308
lowres_init_ssse3: 672
4 SAD comparison operations on 16x16 8-bit pixel blocks, unaligned input:
sad_x4_16x16_c: 1873
sad_x4_16x16_sse2: 95
Variance on 16x16 block, 8-bit input:
var_16x16_c: 536
var_16x16_sse2: 59