[x264-devel] commit: Fix potential miscompilation of some inline asm ( Jason Garrett-Glaser )

git version control git at videolan.org
Mon Sep 29 09:25:12 CEST 2008


x264 | branch: master | Jason Garrett-Glaser <darkshikari at gmail.com> | Mon Sep 29 00:11:38 2008 -0700| [2324c7074585b8b3f56e49ae41df9cbca06f6185] | committer: Jason Garrett-Glaser 

Fix potential miscompilation of some inline asm
Caused problems under some gcc 4.x versions with predictive lossless

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=2324c7074585b8b3f56e49ae41df9cbca06f6185
---

 common/x86/util.h |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/x86/util.h b/common/x86/util.h
index 1e45969..b67c903 100644
--- a/common/x86/util.h
+++ b/common/x86/util.h
@@ -69,7 +69,7 @@ static inline int x264_predictor_difference_mmxext( int16_t (*mvc)[2], intptr_t
         "jg 1b                \n"
         "movq    %%mm4, %0    \n"
         :"=m"(output), "+r"(i_mvc)
-        :"r"(mvc)
+        :"r"(mvc), "m"(*(struct {int16_t x[4];} *)mvc)
     );
     sum += output[0] + output[1] + output[2] + output[3];
     return sum;
@@ -90,7 +90,7 @@ static inline int array_non_zero_count_mmx( int16_t *v )
         "psadbw   %%mm7,  %%mm1 \n"
         "movd     %%mm1,  %0    \n"
         :"=r"(count)
-        :"r"(v)
+        :"r"(v), "m"(*(struct {int16_t x[16];} *)v)
     );
     return (count+0x10)&0xff;
 }
@@ -121,7 +121,7 @@ static ALWAYS_INLINE int array_non_zero_int_mmx( void *v, int i_count )
             "packsswb %%mm0,   %%mm0 \n"
             "movd     %%mm0,   %0    \n"
             :"=r"(nonzero)
-            :"r"(v)
+            :"r"(v), "m"(*(struct {int16_t x[64];} *)v)
         );
         return !!nonzero;
     }



More information about the x264-devel mailing list