On Sunday 31 October 2010 01:05:59 Søren Sandmann wrote:
> From Jeremy Huddleston:
>
> I noticed a problem building pixman with clang and reported it to
> the clang developers. They responded back with a comment about
> the inline asm in pixman-mmx.c and suggested a fix:
>
> """
> Incidentally, Jeremy, in the asm that reads
> __asm__ (
> "movq %7, %0\n"
> "movq %7, %1\n"
> "movq %7, %2\n"
> "movq %7, %3\n"
> "movq %7, %4\n"
> "movq %7, %5\n"
> "movq %7, %6\n"
>
> : "=y" (v1), "=y" (v2), "=y" (v3),
>
> "=y" (v4), "=y" (v5), "=y" (v6), "=y" (v7)
>
> : "y" (vfill));
>
> all the output operands except the last one should be marked as
> earlyclobber ("=&y"). This is working by accident with gcc.
> """Strictly speaking, this code should be always executed correctly even though it definitely looks suspicious. Assuming that the compiler does not have bugs, the worst that can happen is that some register would be assigned to itself, which is a redundant instruction with some minor performance loss. In the end, all the operands are going to have "vfill" value, no matter whether "vfill" happens to be shared with some other operand or not. So the patch looks good and improves code quality, but the comment is misleading because it sounds like it tries to address some serious problem. -- Best regards, Siarhei Siamashka
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Pixman mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/pixman
