[vlc-devel] i420_yuy2: clobber MM and XMM registers correctly

KO Myung-Hun komh78 at gmail.com
Sat Oct 13 16:26:42 CEST 2012



Rémi Denis-Courmont wrote:
> 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;             \
> 
> _______________________________________________

This commit causes the following error.

-----
F:/usr/bin/make.exe  all-am
make.exe[1]: Entering directory `F:/lang/work/vlc/vlc.git/modules/mmx'
  CC     libi420_yuy2_mmx_plugin_la-i420_yuy2.lo
../video_chroma/i420_yuy2.c: In function 'I420_YUY2':
../video_chroma/i420_yuy2.c:325: error: unknown register name 'mm3' in 'asm'
../video_chroma/i420_yuy2.c:325: error: unknown register name 'mm2' in 'asm'
../video_chroma/i420_yuy2.c:325: error: unknown register name 'mm1' in 'asm'
../video_chroma/i420_yuy2.c:325: error: unknown register name 'mm0' in 'asm'
../video_chroma/i420_yuy2.c:325: error: unknown register name 'mm3' in 'asm'
../video_chroma/i420_yuy2.c:325: error: unknown register name 'mm2' in 'asm'
../video_chroma/i420_yuy2.c:325: error: unknown register name 'mm1' in 'asm'
../video_chroma/i420_yuy2.c:325: error: unknown register name 'mm0' in 'asm'
../video_chroma/i420_yuy2.c: In function 'I420_YVYU':
../video_chroma/i420_yuy2.c:536: error: unknown register name 'mm3' in 'asm'
../video_chroma/i420_yuy2.c:536: error: unknown register name 'mm2' in 'asm'
../video_chroma/i420_yuy2.c:536: error: unknown register name 'mm1' in 'asm'
../video_chroma/i420_yuy2.c:536: error: unknown register name 'mm0' in 'asm'
../video_chroma/i420_yuy2.c:536: error: unknown register name 'mm3' in 'asm'
../video_chroma/i420_yuy2.c:536: error: unknown register name 'mm2' in 'asm'
../video_chroma/i420_yuy2.c:536: error: unknown register name 'mm1' in 'asm'
../video_chroma/i420_yuy2.c:536: error: unknown register name 'mm0' in 'asm'
../video_chroma/i420_yuy2.c: In function 'I420_UYVY':
../video_chroma/i420_yuy2.c:745: error: unknown register name 'mm3' in 'asm'
../video_chroma/i420_yuy2.c:745: error: unknown register name 'mm2' in 'asm'
../video_chroma/i420_yuy2.c:745: error: unknown register name 'mm1' in 'asm'
../video_chroma/i420_yuy2.c:745: error: unknown register name 'mm0' in 'asm'
../video_chroma/i420_yuy2.c:745: error: unknown register name 'mm3' in 'asm'
../video_chroma/i420_yuy2.c:745: error: unknown register name 'mm2' in 'asm'
../video_chroma/i420_yuy2.c:745: error: unknown register name 'mm1' in 'asm'
../video_chroma/i420_yuy2.c:745: error: unknown register name 'mm0' in 'asm'
../video_chroma/i420_yuy2.c: In function 'I420_cyuv':
../video_chroma/i420_yuy2.c:890: error: unknown register name 'mm3' in 'asm'
../video_chroma/i420_yuy2.c:890: error: unknown register name 'mm2' in 'asm'
../video_chroma/i420_yuy2.c:890: error: unknown register name 'mm1' in 'asm'
../video_chroma/i420_yuy2.c:890: error: unknown register name 'mm0' in 'asm'
../video_chroma/i420_yuy2.c:890: error: unknown register name 'mm3' in 'asm'
../video_chroma/i420_yuy2.c:890: error: unknown register name 'mm2' in 'asm'
../video_chroma/i420_yuy2.c:890: error: unknown register name 'mm1' in 'asm'
../video_chroma/i420_yuy2.c:890: error: unknown register name 'mm0' in 'asm'
make.exe[1]: *** [libi420_yuy2_mmx_plugin_la-i420_yuy2.lo] Error 1
make.exe[1]: Leaving directory `F:/lang/work/vlc/vlc.git/modules/mmx'
make.exe: *** [all] Error 2
-----


-- 
KO Myung-Hun

Using Mozilla SeaMonkey 2.7.2
Under OS/2 Warp 4 for Korean with FixPak #15
In VirtualBox v4.1.18 on Intel Core i7-3615QM 2.30GHz with 8GB RAM

Korean OS/2 User Community : http://www.ecomstation.co.kr




More information about the vlc-devel mailing list