From 0fdf4e2e39f0fe8110ee8582da1c5916d9fa737c Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Sat, 26 Nov 2011 20:12:12 +0200 Subject: [PATCH] i420_rgb: clobber lists for MMX and SSE2 --- modules/mmx/i420_rgb_mmx.h | 6 ++++-- modules/video_chroma/i420_rgb16.c | 31 +++++++++++++++++-------------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/modules/mmx/i420_rgb_mmx.h b/modules/mmx/i420_rgb_mmx.h index cd1155b4ba..b1ca058b79 100644 --- a/modules/mmx/i420_rgb_mmx.h +++ b/modules/mmx/i420_rgb_mmx.h @@ -56,7 +56,8 @@ static const uint64_t mmx_mask_fc = 0xfcfcfcfcfcfcfcfcULL; /* -- as %13 */ "m" (mmx_00ffw), "m" (mmx_Y_coeff), \ "m" (mmx_U_green), "m" (mmx_U_blue), \ "m" (mmx_V_red), "m" (mmx_V_green), \ - "m" (mmx_mask_f8), "m" (mmx_mask_fc) ); \ + "m" (mmx_mask_f8), "m" (mmx_mask_fc) \ + : "mm0", "mm1", "mm2", "mm3", "mm4", "mm5", "mm6", "mm7" ); \ } while(0) #define MMX_END __asm__ __volatile__ ( "emms" ) @@ -566,7 +567,8 @@ movq %%mm2, 24(%3) # Store ABGR7 ABGR6 \n\ : \ : "r" (p_y), "r" (p_u), \ "r" (p_v), "r" (p_buffer) \ - : "eax" ); \ + : "eax", "xmm0", "xmm1", "xmm2", "xmm3", \ + "xmm4", "xmm5", "xmm6", "xmm7" ); \ } while(0) #define SSE2_END __asm__ __volatile__ ( "sfence" ::: "memory" ) diff --git a/modules/video_chroma/i420_rgb16.c b/modules/video_chroma/i420_rgb16.c index c60b15b953..7a2a3fed51 100644 --- a/modules/video_chroma/i420_rgb16.c +++ b/modules/video_chroma/i420_rgb16.c @@ -32,14 +32,18 @@ #include #include +#include #include "i420_rgb.h" #if defined (MODULE_NAME_IS_i420_rgb) # include "i420_rgb_c.h" +# define VLC_TARGET #elif defined (MODULE_NAME_IS_i420_rgb_mmx) # include "../mmx/i420_rgb_mmx.h" +# define VLC_TARGET VLC_MMX #elif defined (MODULE_NAME_IS_i420_rgb_sse2) # include "../mmx/i420_rgb_mmx.h" +# define VLC_TARGET VLC_SSE #endif static void SetOffset( int, int, int, int, bool *, @@ -202,8 +206,7 @@ void I420_RGB16_dither( filter_t *p_filter, picture_t *p_src, #if defined (MODULE_NAME_IS_i420_rgb) -void I420_RGB16( filter_t *p_filter, picture_t *p_src, - picture_t *p_dest ) +void I420_RGB16( filter_t *p_filter, picture_t *p_src, picture_t *p_dest ) { /* We got this one from the old arguments */ uint16_t *p_pic = (uint16_t*)p_dest->p->p_pixels; @@ -297,8 +300,8 @@ void I420_RGB16( filter_t *p_filter, picture_t *p_src, #else // ! defined (MODULE_NAME_IS_i420_rgb) -void I420_R5G5B5( filter_t *p_filter, picture_t *p_src, - picture_t *p_dest ) +VLC_TARGET +void I420_R5G5B5( filter_t *p_filter, picture_t *p_src, picture_t *p_dest ) { /* We got this one from the old arguments */ uint16_t *p_pic = (uint16_t*)p_dest->p->p_pixels; @@ -527,8 +530,8 @@ void I420_R5G5B5( filter_t *p_filter, picture_t *p_src, #endif } -void I420_R5G6B5( filter_t *p_filter, picture_t *p_src, - picture_t *p_dest ) +VLC_TARGET +void I420_R5G6B5( filter_t *p_filter, picture_t *p_src, picture_t *p_dest ) { /* We got this one from the old arguments */ uint16_t *p_pic = (uint16_t*)p_dest->p->p_pixels; @@ -772,8 +775,7 @@ void I420_R5G6B5( filter_t *p_filter, picture_t *p_src, #if defined (MODULE_NAME_IS_i420_rgb) -void I420_RGB32( filter_t *p_filter, picture_t *p_src, - picture_t *p_dest ) +void I420_RGB32( filter_t *p_filter, picture_t *p_src, picture_t *p_dest ) { /* We got this one from the old arguments */ uint32_t *p_pic = (uint32_t*)p_dest->p->p_pixels; @@ -866,6 +868,7 @@ void I420_RGB32( filter_t *p_filter, picture_t *p_src, #else // defined (MODULE_NAME_IS_i420_rgb_mmx) || defined (MODULE_NAME_IS_i420_rgb_sse2) +VLC_TARGET void I420_A8R8G8B8( filter_t *p_filter, picture_t *p_src, picture_t *p_dest ) { @@ -1094,8 +1097,8 @@ void I420_A8R8G8B8( filter_t *p_filter, picture_t *p_src, #endif } -void I420_R8G8B8A8( filter_t *p_filter, picture_t *p_src, - picture_t *p_dest ) +VLC_TARGET +void I420_R8G8B8A8( filter_t *p_filter, picture_t *p_src, picture_t *p_dest ) { /* We got this one from the old arguments */ uint32_t *p_pic = (uint32_t*)p_dest->p->p_pixels; @@ -1322,8 +1325,8 @@ void I420_R8G8B8A8( filter_t *p_filter, picture_t *p_src, #endif } -void I420_B8G8R8A8( filter_t *p_filter, picture_t *p_src, - picture_t *p_dest ) +VLC_TARGET +void I420_B8G8R8A8( filter_t *p_filter, picture_t *p_src, picture_t *p_dest ) { /* We got this one from the old arguments */ uint32_t *p_pic = (uint32_t*)p_dest->p->p_pixels; @@ -1547,8 +1550,8 @@ void I420_B8G8R8A8( filter_t *p_filter, picture_t *p_src, #endif } -void I420_A8B8G8R8( filter_t *p_filter, picture_t *p_src, - picture_t *p_dest ) +VLC_TARGET +void I420_A8B8G8R8( filter_t *p_filter, picture_t *p_src, picture_t *p_dest ) { /* We got this one from the old arguments */ uint32_t *p_pic = (uint32_t*)p_dest->p->p_pixels; -- 2.39.2