Fixed building on various versions of GCC - YUV MMX code is disabled for now
authorSam Lantinga
Mon, 07 Aug 2017 10:28:59 -0700
changeset 111950d399e95168b
parent 11194 3d0bbfe683a8
child 11196 c6e58fceba42
Fixed building on various versions of GCC - YUV MMX code is disabled for now
src/render/SDL_yuv_mmx.c
src/render/SDL_yuv_mmx_c.h
src/render/SDL_yuv_sw.c
src/render/SDL_yuv_sw_c.h
     1.1 --- a/src/render/SDL_yuv_mmx.c	Mon Aug 07 00:36:45 2017 -0400
     1.2 +++ b/src/render/SDL_yuv_mmx.c	Mon Aug 07 10:28:59 2017 -0700
     1.3 @@ -20,8 +20,9 @@
     1.4  */
     1.5  #include "../SDL_internal.h"
     1.6  
     1.7 -/* !!! FIXME: this broke on Clang (if it wasn't broken _before_) in https://hg.libsdl.org/SDL/rev/2ee7d2fa299b */
     1.8 -#if (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES && !defined(__clang__)
     1.9 +#include "SDL_yuv_mmx_c.h"
    1.10 +
    1.11 +#ifdef USE_MMX_ASSEMBLY
    1.12  
    1.13  #include "SDL_stdinc.h"
    1.14  
    1.15 @@ -403,6 +404,6 @@
    1.16  
    1.17  /* *INDENT-ON* */
    1.18  
    1.19 -#endif /* GCC3 i386 inline assembly */
    1.20 +#endif /* USE_MMX_ASSEMBLY */
    1.21  
    1.22  /* vi: set ts=4 sw=4 expandtab: */
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/src/render/SDL_yuv_mmx_c.h	Mon Aug 07 10:28:59 2017 -0700
     2.3 @@ -0,0 +1,28 @@
     2.4 +/*
     2.5 +  Simple DirectMedia Layer
     2.6 +  Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
     2.7 +
     2.8 +  This software is provided 'as-is', without any express or implied
     2.9 +  warranty.  In no event will the authors be held liable for any damages
    2.10 +  arising from the use of this software.
    2.11 +
    2.12 +  Permission is granted to anyone to use this software for any purpose,
    2.13 +  including commercial applications, and to alter it and redistribute it
    2.14 +  freely, subject to the following restrictions:
    2.15 +
    2.16 +  1. The origin of this software must not be misrepresented; you must not
    2.17 +     claim that you wrote the original software. If you use this software
    2.18 +     in a product, an acknowledgment in the product documentation would be
    2.19 +     appreciated but is not required.
    2.20 +  2. Altered source versions must be plainly marked as such, and must not be
    2.21 +     misrepresented as being the original software.
    2.22 +  3. This notice may not be removed or altered from any source distribution.
    2.23 +*/
    2.24 +#include "../SDL_internal.h"
    2.25 +
    2.26 +/* FIXME: This breaks on various versions of GCC and should be rewritten using intrinsics */
    2.27 +#if 0 /* (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES && !defined(__clang__) */
    2.28 +#define USE_MMX_ASSEMBLY 1
    2.29 +#endif
    2.30 +
    2.31 +/* vi: set ts=4 sw=4 expandtab: */
     3.1 --- a/src/render/SDL_yuv_sw.c	Mon Aug 07 00:36:45 2017 -0400
     3.2 +++ b/src/render/SDL_yuv_sw.c	Mon Aug 07 10:28:59 2017 -0700
     3.3 @@ -86,15 +86,11 @@
     3.4  #include "SDL_video.h"
     3.5  #include "SDL_cpuinfo.h"
     3.6  #include "SDL_yuv_sw_c.h"
     3.7 +#include "SDL_yuv_mmx_c.h"
     3.8  
     3.9  
    3.10  /* The colorspace conversion functions */
    3.11  
    3.12 -/* !!! FIXME: this broke on Clang (if it wasn't broken _before_) in https://hg.libsdl.org/SDL/rev/2ee7d2fa299b */
    3.13 -#if (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES && !defined(__clang__)
    3.14 -#define USE_MMX_ASSEMBLY 1
    3.15 -#endif
    3.16 -
    3.17  #ifdef USE_MMX_ASSEMBLY
    3.18  extern void Color565DitherYV12MMX1X(int *colortab, Uint32 * rgb_2_pix,
    3.19                                      unsigned char *lum, unsigned char *cr,
     4.1 --- a/src/render/SDL_yuv_sw_c.h	Mon Aug 07 00:36:45 2017 -0400
     4.2 +++ b/src/render/SDL_yuv_sw_c.h	Mon Aug 07 10:28:59 2017 -0700
     4.3 @@ -69,4 +69,9 @@
     4.4                          int pitch);
     4.5  void SDL_SW_DestroyYUVTexture(SDL_SW_YUVTexture * swdata);
     4.6  
     4.7 +/* FIXME: This breaks on various versions of GCC and should be rewritten using intrinsics */
     4.8 +#if 0 /* (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES && !defined(__clang__) */
     4.9 +#define USE_MMX_ASSEMBLY 1
    4.10 +#endif
    4.11 +
    4.12  /* vi: set ts=4 sw=4 expandtab: */