[vlc-commits] i420_yuy2: clobber MM and XMM registers correctly
Rémi Denis-Courmont
git at videolan.org
Sat Oct 13 15:41:34 CEST 2012
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Oct 13 16:41:14 2012 +0300| [01924381fd15196a68f29d4cc279fb7a42f6f556] | committer: Rémi Denis-Courmont
i420_yuy2: clobber MM and XMM registers correctly
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=01924381fd15196a68f29d4cc279fb7a42f6f556
---
modules/video_chroma/i420_yuy2.c | 14 +++++++++-----
modules/video_chroma/i420_yuy2.h | 12 ++++++++----
2 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/modules/video_chroma/i420_yuy2.c b/modules/video_chroma/i420_yuy2.c
index 59969fb..a157e94 100644
--- a/modules/video_chroma/i420_yuy2.c
+++ b/modules/video_chroma/i420_yuy2.c
@@ -45,12 +45,16 @@
#if defined (MODULE_NAME_IS_i420_yuy2)
# define DEST_FOURCC "YUY2,YUNV,YVYU,UYVY,UYNV,Y422,IUYV,cyuv,Y211"
+# define VLC_TARGET
#elif defined (MODULE_NAME_IS_i420_yuy2_mmx)
# define DEST_FOURCC "YUY2,YUNV,YVYU,UYVY,UYNV,Y422,IUYV,cyuv"
+# define VLC_TARGET VLC_MMX
#elif defined (MODULE_NAME_IS_i420_yuy2_sse2)
# define DEST_FOURCC "YUY2,YUNV,YVYU,UYVY,UYNV,Y422,IUYV,cyuv"
+# define VLC_TARGET VLC_SSE
#elif defined (MODULE_NAME_IS_i420_yuy2_altivec)
# define DEST_FOURCC "YUY2,YUNV,YVYU,UYVY,UYNV,Y422"
+# define VLC_TARGET
#endif
/*****************************************************************************
@@ -184,12 +188,12 @@ static inline unsigned long long read_cycles(void)
/* Following functions are local */
-VIDEO_FILTER_WRAPPER( I420_YUY2 )
-VIDEO_FILTER_WRAPPER( I420_YVYU )
-VIDEO_FILTER_WRAPPER( I420_UYVY )
+VLC_TARGET VIDEO_FILTER_WRAPPER( I420_YUY2 )
+VLC_TARGET VIDEO_FILTER_WRAPPER( I420_YVYU )
+VLC_TARGET VIDEO_FILTER_WRAPPER( I420_UYVY )
#if !defined (MODULE_NAME_IS_i420_yuy2_altivec)
-VIDEO_FILTER_WRAPPER( I420_IUYV )
-VIDEO_FILTER_WRAPPER( I420_cyuv )
+VLC_TARGET VIDEO_FILTER_WRAPPER( I420_IUYV )
+VLC_TARGET VIDEO_FILTER_WRAPPER( I420_cyuv )
#endif
#if defined (MODULE_NAME_IS_i420_yuy2)
VIDEO_FILTER_WRAPPER( I420_Y211 )
diff --git a/modules/video_chroma/i420_yuy2.h b/modules/video_chroma/i420_yuy2.h
index e699442..573c30f 100644
--- a/modules/video_chroma/i420_yuy2.h
+++ b/modules/video_chroma/i420_yuy2.h
@@ -39,12 +39,14 @@ movq (%3), %%mm3 # Load 8 Y Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 \n\
" \
: \
: "r" (p_u), "r" (p_v), \
- "r" (p_y1), "r" (p_y2) ); \
+ "r" (p_y1), "r" (p_y2) \
+ : "mm0", "mm1", "mm2", "mm3"); \
__asm__ __volatile__( \
".p2align 3 \n\t" \
MMX_INSTRUCTIONS \
: \
- : "r" (p_line1), "r" (p_line2) ); \
+ : "r" (p_line1), "r" (p_line2) \
+ : "mm0", "mm1", "mm2", "mm3"); \
p_line1 += 16; p_line2 += 16; \
p_y1 += 8; p_y2 += 8; \
p_u += 4; p_v += 4; \
@@ -199,13 +201,15 @@ movq (%0), %%xmm1 # Load 8 Cb u7 u6 u5 u4 u3 u2 u1 u0 \n\
movq (%1), %%xmm2 # Load 8 Cr v7 06 v5 v4 v3 v2 v1 v0 \n\
" \
: \
- : "r" (p_u), "r" (p_v) ); \
+ : "r" (p_u), "r" (p_v) \
+ : "xmm1", "xmm2"); \
__asm__ __volatile__( \
".p2align 3 \n\t" \
SSE2_INSTRUCTIONS \
: \
: "r" (p_line1), "r" (p_line2), \
- "r" (p_y1), "r" (p_y2) ); \
+ "r" (p_y1), "r" (p_y2) \
+ : "xmm0", "xmm1", "xmm2", "xmm3", "xmm4"); \
p_line1 += 32; p_line2 += 32; \
p_y1 += 16; p_y2 += 16; \
p_u += 8; p_v += 8; \
More information about the vlc-commits
mailing list