]> git.sesse.net Git - ffmpeg/commitdiff
mathops: fix MULL() when the compiler does not inline the function.
authorJustin Ruggles <justin.ruggles@gmail.com>
Wed, 16 Mar 2011 00:38:23 +0000 (20:38 -0400)
committerJustin Ruggles <justin.ruggles@gmail.com>
Wed, 16 Mar 2011 00:49:37 +0000 (20:49 -0400)
If the function is not inlined, an immmediate cannot be used for the
shift parameter, so the %cl register must be used instead in that case.

This fixes compilation for x86-32 using gcc with --disable-optimizations.

libavcodec/x86/mathops.h

index b18302744cfe885929148a5233966f39f53e68f3..33d9a6c8ffd65aa8bacaa486eab241c31c8fa873 100644 (file)
@@ -35,7 +35,7 @@ static av_always_inline av_const int MULL(int a, int b, unsigned shift)
         "imull %3               \n\t"
         "shrdl %4, %%edx, %%eax \n\t"
         :"=a"(rt), "=d"(dummy)
-        :"a"(a), "rm"(b), "i"(shift)
+        :"a"(a), "rm"(b), "ci"((uint8_t)shift)
     );
     return rt;
 }