[FFmpeg-devel] [PATCH] Remove MULL macro from lsp.c

Måns Rullgård mans
Tue Aug 26 20:09:44 CEST 2008


"Vladimir Voroshilov" <voroshil at gmail.com> writes:

> Please look into attached patch and tell what chunks are ok.
> I used (and tested) only MULL macro but others (due to used "l"
> suffix) can have the same bug.
> Unfortunately, i'm not know asm enough good to be sure.
>
> Index: libavcodec/i386/mathops.h
> ===================================================================
> --- libavcodec/i386/mathops.h	(revision 14975)
> +++ libavcodec/i386/mathops.h	(working copy)
> @@ -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; })

I think only the potential memory operands need the cast.  Here it
would be the "rb" parameter.

>  #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));\

Ditto.

>       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; })

Ditto.

I could be wrong.  Wait for someone more skilled in the black arts to
confirm or deny.

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list