Disable MMX inline assembly on Clang for now. We should probably rewrite this with SSE compiler intrinsics or something anyhow.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
diff --git a/src/render/SDL_yuv_mmx.c b/src/render/SDL_yuv_mmx.c
index 2814d98..8c21b03 100644
--- a/src/render/SDL_yuv_mmx.c
+++ b/src/render/SDL_yuv_mmx.c
@@ -20,7 +20,8 @@
*/
#include "../SDL_internal.h"
-#if (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES
+/* !!! FIXME: this broke on Clang (if it wasn't broken _before_) in https://hg.libsdl.org/SDL/rev/2ee7d2fa299b */
+#if (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES && !defined(__clang__)
#include "SDL_stdinc.h"
diff --git a/src/render/SDL_yuv_sw.c b/src/render/SDL_yuv_sw.c
index d8ad2b4..737223c 100644
--- a/src/render/SDL_yuv_sw.c
+++ b/src/render/SDL_yuv_sw.c
@@ -90,7 +90,12 @@
/* The colorspace conversion functions */
+/* !!! FIXME: this broke on Clang (if it wasn't broken _before_) in https://hg.libsdl.org/SDL/rev/2ee7d2fa299b */
#if (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES
+#define USE_MMX_ASSEMBLY 1
+#endif
+
+#ifdef USE_MMX_ASSEMBLY
extern void Color565DitherYV12MMX1X(int *colortab, Uint32 * rgb_2_pix,
unsigned char *lum, unsigned char *cr,
unsigned char *cb, unsigned char *out,
@@ -967,7 +972,7 @@ SDL_SW_SetupYUVDisplay(SDL_SW_YUVTexture * swdata, Uint32 target_format)
case SDL_PIXELFORMAT_YV12:
case SDL_PIXELFORMAT_IYUV:
if (SDL_BYTESPERPIXEL(target_format) == 2) {
-#if (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES
+#ifdef USE_MMX_ASSEMBLY
/* inline assembly functions */
if (SDL_HasMMX() && (Rmask == 0xF800) &&
(Gmask == 0x07E0) && (Bmask == 0x001F)
@@ -988,7 +993,7 @@ SDL_SW_SetupYUVDisplay(SDL_SW_YUVTexture * swdata, Uint32 target_format)
swdata->Display2X = Color24DitherYV12Mod2X;
}
if (SDL_BYTESPERPIXEL(target_format) == 4) {
-#if (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES
+#ifdef USE_MMX_ASSEMBLY
/* inline assembly functions */
if (SDL_HasMMX() && (Rmask == 0x00FF0000) &&
(Gmask == 0x0000FF00) &&