[xiph-commits] r16970 - experimental/derf/theora-ptalarbvorm/lib/x86

tterribe at svn.xiph.org tterribe at svn.xiph.org
Sat Mar 13 15:12:28 PST 2010


Author: tterribe
Date: 2010-03-13 15:12:28 -0800 (Sat, 13 Mar 2010)
New Revision: 16970

Modified:
   experimental/derf/theora-ptalarbvorm/lib/x86/sse2encfrag.c
Log:
Be more explicit about register classes in oc_enc_frag_satd2_sse2() to prevent
 gcc from doing silly things like using %rsp for an input operand that we
 clobber.
We can't mark them all as output operands, because then they couldn't be
 aliased with actual outputs, and there wouldn't be enough registers on x86-32.
Fixes a crash introduced in r16967 for some compilers/options.


Modified: experimental/derf/theora-ptalarbvorm/lib/x86/sse2encfrag.c
===================================================================
--- experimental/derf/theora-ptalarbvorm/lib/x86/sse2encfrag.c	2010-03-13 22:13:28 UTC (rev 16969)
+++ experimental/derf/theora-ptalarbvorm/lib/x86/sse2encfrag.c	2010-03-13 23:12:28 UTC (rev 16970)
@@ -278,10 +278,12 @@
     /*Note that _src_ystride and _ref_ystride must be given non-overlapping
        constraints, otherewise if gcc can prove they're equal it will allocate
        them to the same register (which is bad); _src and _ref face a similar
-       problem, though those are never actually the same.*/
+       problem.
+      All four are destructively modified, but if we list them as output
+       constraints, gcc can't alias them with other outputs.*/
     :[ret]"=a"(ret),[dc]"=d"(dc),[buf]"+r"(bufp)
-    :[src]"r"(_src),[src_ystride]"c"((ptrdiff_t)_src_ystride),
-     [ref]"r"(_ref),[ref_ystride]"d"((ptrdiff_t)_ref_ystride)
+    :[src]"S"(_src),[src_ystride]"c"((ptrdiff_t)_src_ystride),
+     [ref]"a"(_ref),[ref_ystride]"d"((ptrdiff_t)_ref_ystride)
     /*We have to use neg, so we actually clobber the condition codes for once
        (not to mention sub, and add).*/
     :"cc"



More information about the commits mailing list