summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <ssp@redhat.com>2010-10-30 17:20:22 -0400
committerSøren Sandmann Pedersen <ssp@redhat.com>2011-01-19 08:08:02 -0500
commit2edec481b9582f6f593310af5fd4b713005028a5 (patch)
tree865ac025a2cc24f47812fb8b8d986c7a0c6c1f17
parent6718621c62ef03d1dd71c34242a873aba798e8aa (diff)
downloadpixman-2edec481b9582f6f593310af5fd4b713005028a5.tar.gz
[mmx] Mark some of the output variables as early-clobber.
GCC assumes that input variables in inline assembly are fully consumed before any output variable is written. This means it may allocate the variables in the same register unless the output variables are marked as early-clobber. 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. """ Cc: jeremyhu@apple.com Reviewed-by: Matt Turner <mattst88@gmail.com>
-rw-r--r--pixman/pixman-mmx.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c
index e936c4c..34637a4 100644
--- a/pixman/pixman-mmx.c
+++ b/pixman/pixman-mmx.c
@@ -1921,8 +1921,8 @@ pixman_fill_mmx (uint32_t *bits,
"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" (v1), "=&y" (v2), "=&y" (v3),
+ "=&y" (v4), "=&y" (v5), "=&y" (v6), "=y" (v7)
: "y" (vfill));
#endif