[MPlayer-dev-eng] [PATCH] negating unsigned in asm code

Michael Niedermayer michaelni at gmx.at
Tue Jun 28 16:38:58 CEST 2005


Hi

On Tuesday 28 June 2005 12:39, Reimar Döffinger wrote:
> Hi,
> rgb2rgb_template.c causes a lot of crashes on AMD64, since the current
> code first negates unsigned variables and then extends them to 64 bits,
> the result being a very big positive value instead of a negative one.
> One possibility would be making all unsigned signed.
> The attached patch instead does the subtraction/negating in assembler,
> which fixes this as well (a bit at the cost of readability, but not much
> IMHO).
> Is it okay to apply??

no, you are changing operands which are marked as read only, while i suspect 
it will work it might break with some versions of gcc as gcc expects read 
only operands to be unchanged after the asm


iam also pretty sure that the cast is done before the sub, so 
> -               :: "r" (src), "r"(dst), "r" ((long)src_size-7)
> +               :: "r" (src), "r"(dst), "r" ((long)src_size)

shouldnt be needed


[...]
-- 
Michael




More information about the MPlayer-dev-eng mailing list