[FFmpeg-devel] [PATCH] Fix compilation of FASTDIV() with llvm-gcc on x86_64

Reimar Döffinger Reimar.Doeffinger
Mon Jul 5 18:40:28 CEST 2010


On Mon, Jul 05, 2010 at 04:01:26PM +0100, M?ns Rullg?rd wrote:
> Michael Niedermayer <michaelni at gmx.at> writes:
> 
> > On Mon, Jul 05, 2010 at 02:54:09PM +0100, Mans Rullgard wrote:
> >> LLVM requires matching input and output asm parameters to have the
> >> same type.  For the FASTDIV macro, an (int) cast on the input fixes
> >> this trivially.
> >
> > the extra cast likely slows it down
> 
> GCC generates the same code.

That seems strange, wouldn't the compiler have to do an explicit
sign extension when you add that cast?
Well, unless it does a mov anyway before, then it just needs to replace
it by a movslq.
But that would still be a change, so does gcc do the cast implicitly or what?



More information about the ffmpeg-devel mailing list