[Ffmpeg-devel] [PATCH] (4) building with --disable-opts on i386

Marco Manfredini mldb
Mon Aug 14 12:42:33 CEST 2006

On Sunday 13 August 2006 21:52, Michael Niedermayer wrote:

> some other alternative would be to rewrite the code so as to do the
> addresing manually, instead of letting gcc play with it:
> "r" (dst), "r"(dst_stride), "r" (dst + 2*dst_stride),
> "r" (src), "r"(src_stride), "r" (src + 2*src_stride)
> and use (%0), (%0,%1), (%2), (%2,%1), ...
> [...]

If the optimiser knows the stride values, he doesn't need registers for them. 
but now I need 6 every time, a memory clobber and this doesn't help me with 
the register spill problem either.

I've tried: 

movd (%4),%mm0
movd (%4,%5),%mm1
lea (%4,%5),%4
movd (%4),%mm1
movd (%4,%5),%mm2
"+r" (src): "r"(src_stride)

But that's slower in my tests. 

The "return value" pattern looks best so far, because it's transparent and 
makes the localisation of the spill hacks easy. I'll try if I can make it 
looking less funny :-)


More information about the ffmpeg-devel mailing list