From: Jason Garrett-Glaser Date: Mon, 29 Sep 2008 07:11:38 +0000 (-0700) Subject: Fix potential miscompilation of some inline asm X-Git-Url: http://www.zmx.ovh/git.videolan.org/?a=commitdiff_plain;h=2324c7074585b8b3f56e49ae41df9cbca06f6185;p=x264.git Fix potential miscompilation of some inline asm Caused problems under some gcc 4.x versions with predictive lossless --- diff --git a/common/x86/util.h b/common/x86/util.h index 1e45969b..b67c9031 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; }