Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Disable MMX inline assembly on Clang for now.
We should probably rewrite this with SSE compiler intrinsics or something
anyhow.
  • Loading branch information
icculus committed Jul 26, 2017
1 parent 03eaddc commit 7ecc48c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/render/SDL_yuv_mmx.c
Expand Up @@ -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"

Expand Down
9 changes: 7 additions & 2 deletions src/render/SDL_yuv_sw.c
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand All @@ -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) &&
Expand Down

0 comments on commit 7ecc48c

Please sign in to comment.