]> granicus.if.org Git - libx264/commitdiff
x86: Fix clobbers for inline asm
authorAnton Mitrofanov <BugMaster@narod.ru>
Fri, 4 Sep 2020 15:00:45 +0000 (18:00 +0300)
committerAnton Mitrofanov <bugmaster@narod.ru>
Sun, 25 Oct 2020 17:10:15 +0000 (18:10 +0100)
common/x86/mc-c.c
common/x86/predict-c.c
common/x86/util.h

index 9ca1c0f21b81b94cfeb0192c8ecf8f34f957d3fd..958ff0d00cfb4b76500eab3fd0b78dea942eed9d 100644 (file)
@@ -747,6 +747,7 @@ do\
         "movd   %%xmm0, %0         \n"\
         :"+&r"(temp_s)\
         :"r"(temp_x)\
+        :"xmm0", "xmm1"\
     );\
     s = temp_s;\
 } while( 0 )
@@ -762,6 +763,7 @@ do\
         "movd   %%xmm0, %0         \n"\
         :"+&r"(temp)\
         :"m"(M32(x))\
+        :"xmm0", "xmm1"\
     );\
     (s)[0] = temp.w[0];\
     (s)[1] = temp.w[1];\
index ba791bb0125d441498e58886b9a043d868ab9cc3..83a853ef92bb3849c8145dcb234f70e286221336 100644 (file)
@@ -93,6 +93,7 @@ static void predict_16x16_p_##name( pixel *src )\
         :"=r"(H)\
         :"m"(src[-FDEC_STRIDE-1]), "m"(src[-FDEC_STRIDE+8]),\
          "m"(*pw_12345678), "m"(*pw_m87654321)\
+        :"xmm0", "xmm1"\
     );
 #else // !HIGH_BIT_DEPTH
 #define PREDICT_16x16_P_ASM\
@@ -112,6 +113,7 @@ static void predict_16x16_p_##name( pixel *src )\
         :"=r"(H)\
         :"m"(src[-FDEC_STRIDE]), "m"(src[-FDEC_STRIDE+8]),\
          "m"(src[-FDEC_STRIDE-8]), "m"(*pb_12345678), "m"(*pb_m87654321)\
+        :"mm0", "mm1"\
     );
 #endif // HIGH_BIT_DEPTH
 
@@ -230,6 +232,7 @@ static void predict_8x8c_p_##name( pixel *src )\
         "movd         %%xmm0, %0     \n"\
         :"=r"(H)\
         :"m"(src[-FDEC_STRIDE]), "m"(*pw_m32101234)\
+        :"xmm0", "xmm1"\
     );
 #else // !HIGH_BIT_DEPTH
 #define PREDICT_8x8C_P_ASM\
@@ -244,6 +247,7 @@ static void predict_8x8c_p_##name( pixel *src )\
         "movswl        %w0, %0    \n"\
         :"=r"(H)\
         :"m"(src[-FDEC_STRIDE]), "m"(*pb_m32101234)\
+        :"mm0", "mm1"\
     );
 #endif // HIGH_BIT_DEPTH
 
index d928b3d8edf33fa83d444d713b2dd22c346c36b9..4d4912d6ec03cce6e6828f7f48ad266c46c393c8 100644 (file)
@@ -56,6 +56,7 @@ static ALWAYS_INLINE void x264_median_mv_mmx2( int16_t *dst, int16_t *a, int16_t
         "movd   %%mm0, %0    \n"
         :"=m"(*(x264_union32_t*)dst)
         :"m"(M32( a )), "m"(M32( b )), "m"(M32( c ))
+        :"mm0", "mm1", "mm2", "mm3"
     );
 }
 
@@ -91,6 +92,7 @@ static ALWAYS_INLINE int x264_predictor_difference_mmx2( int16_t (*mvc)[2], intp
         "movd    %%mm4, %0    \n"
         :"=r"(sum), "+r"(i_mvc)
         :"r"(mvc), "m"(M64( mvc )), "m"(pw_1)
+        :"mm0", "mm2", "mm3", "mm4", "cc"
     );
     return sum;
 }
@@ -117,6 +119,7 @@ static ALWAYS_INLINE uint16_t x264_cabac_mvd_sum_mmx2(uint8_t *mvdleft, uint8_t
         :"=r"(amvd)
         :"m"(M16( mvdleft )),"m"(M16( mvdtop )),
          "m"(pb_2),"m"(pb_32),"m"(pb_33)
+        :"mm0", "mm1", "mm2"
     );
     return amvd;
 }
@@ -178,6 +181,7 @@ static ALWAYS_INLINE int x264_predictor_clip_mmx2( int16_t (*dst)[2], int16_t (*
         "3:                     \n"
         :"+r"(mvc), "=m"(M64( dst )), "+r"(tmp), "+r"(mvc_max), "+r"(i)
         :"r"(dst), "g"(pmv), "m"(pd_32), "m"(M64( mvc ))
+        :"mm0", "mm1", "mm2", "mm3", "mm4", "mm5", "mm6", "cc"
     );
     return i;
 }
@@ -245,6 +249,7 @@ static ALWAYS_INLINE int x264_predictor_roundclip_mmx2( int16_t (*dst)[2], int16
         "3:                     \n"
         :"+r"(mvc), "=m"(M64( dst )), "+r"(tmp), "+r"(mvc_max), "+r"(i)
         :"r"(dst), "m"(pw_2), "g"(pmv), "m"(pd_32), "m"(M64( mvc ))
+        :"mm0", "mm1", "mm2", "mm3", "mm4", "mm5", "mm6", "mm7", "cc"
     );
     return i;
 }