From 2ccddc02111f316bdcb183f3ef1b2423eaf628d8 Mon Sep 17 00:00:00 2001 From: Vladimir Voroshilov Date: Tue, 26 Aug 2008 19:38:17 +0000 Subject: [PATCH] Add explicit (int) cast to i386 optimized MUL* macros. Wrong result is returned when 16-bit value is passed as value. Also fixes "Warning: using `%edx' instead of `%dx' due to `l' suffix". Originally committed as revision 14981 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/i386/mathops.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/i386/mathops.h b/libavcodec/i386/mathops.h index 51d59396e1..75ed55c57d 100644 --- a/libavcodec/i386/mathops.h +++ b/libavcodec/i386/mathops.h @@ -28,18 +28,18 @@ "imull %3 \n\t"\ "shrdl %4, %%edx, %%eax \n\t"\ : "=a"(rt), "=d"(dummy)\ - : "a" (ra), "rm" (rb), "i"(FRAC_BITS));\ + : "a" ((int)ra), "rm" ((int)rb), "i"(FRAC_BITS));\ rt; }) #endif #define MULH(ra, rb) \ ({ int rt, dummy;\ - asm ("imull %3\n\t" : "=d"(rt), "=a"(dummy): "a" (ra), "rm" (rb));\ + asm ("imull %3\n\t" : "=d"(rt), "=a"(dummy): "a" ((int)ra), "rm" ((int)rb));\ rt; }) #define MUL64(ra, rb) \ ({ int64_t rt;\ - asm ("imull %2\n\t" : "=A"(rt) : "a" (ra), "g" (rb));\ + asm ("imull %2\n\t" : "=A"(rt) : "a" ((int)ra), "g" ((int)rb));\ rt; }) #endif /* FFMPEG_I386_MATHOPS_H */