[FFmpeg-devel] looking for comparison of intrinsics vs hand written asm

Guillaume POIRIER poirierg
Fri Oct 30 16:47:39 CET 2009


Hi Attila!

On Fri, Oct 30, 2009 at 4:34 PM, Attila Kinali <attila at kinali.ch> wrote:

> Moin,
>
> I had discussion with some prof about code optimization
> and it came to a point where we disagreed on how big
> the difference between intrinsics and hand written asm
> is. I was quite sure that i've seen somewhere such a comparison,
> done by someone with a clue (ie both intrinsics and asm had
> a good quality), but cannot find anything anymore.
>
> Hence, i'd like to ask if someone has such a comparison.
> If possible also against intrinsics compiled with icc.



For me, the reason why you may want to write handwritten asm is because you
want every bit of control over code generation, and want to be sure that the
compiler doesn't screw things up.
The reason why you may want to write vectorized code with intrinsics is
because you want to spend the least amount of your time to get a certain
speed-up, and don't want to deal with ABI, assembler/compiler
incompatibilities.

Now, I'm sure that you can get various amount of speed-up when writing the
same vectorized code in ASM rather than with instrincs (I write "various"
because based on my experience, the compiler will do a decent job dealing
with your intrinsics, but it will fail miserably in some cases), but the
real question is: how much of your time you want to spend on optimising your
code?

Guillaume
-- 
"I am the Jesus Christ of politics. I sacrifice myself for everyone."

-- Silvio Berlusconi



More information about the ffmpeg-devel mailing list