From 78a36830f88ceb28d53d2c6e1daa61f591bf726c Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 26 Sep 2023 12:29:09 -0400 Subject: [PATCH] video: Remove MMX codepath from SDL_BlitCopy. It was only used if SSE wasn't supported (available since the Pentium III in 1999), or the data was aligned to 8 bytes but not aligned to 16 bytes. The likelihood of ever hitting this codepath seems extremely low. --- src/video/SDL_blit_copy.c | 54 --------------------------------------- 1 file changed, 54 deletions(-) diff --git a/src/video/SDL_blit_copy.c b/src/video/SDL_blit_copy.c index 5d2b05e3ec..bdb96b162a 100644 --- a/src/video/SDL_blit_copy.c +++ b/src/video/SDL_blit_copy.c @@ -50,53 +50,6 @@ static SDL_INLINE void SDL_TARGETING("sse") SDL_memcpySSE(Uint8 *dst, const Uint } #endif /* SDL_SSE_INTRINSICS */ -#ifdef SDL_MMX_INTRINSICS -#ifdef _MSC_VER -#pragma warning(disable : 4799) -#endif -static SDL_INLINE void SDL_TARGETING("mmx") SDL_memcpyMMX(Uint8 *dst, const Uint8 *src, int len) -{ - int remain = len & 63; - int i; - - __m64 *d64 = (__m64 *)dst; - __m64 *s64 = (__m64 *)src; - - for (i = len / 64; i--;) { - d64[0] = s64[0]; - d64[1] = s64[1]; - d64[2] = s64[2]; - d64[3] = s64[3]; - d64[4] = s64[4]; - d64[5] = s64[5]; - d64[6] = s64[6]; - d64[7] = s64[7]; - - d64 += 8; - s64 += 8; - } - - if (remain) { - const int skip = len - remain; - dst += skip; - src += skip; - while (remain--) { - *dst++ = *src++; - } - } -} - -static SDL_INLINE void SDL_TARGETING("mmx") SDL_BlitCopyMMX(Uint8 *dst, const Uint8 *src, const int dstskip, const int srcskip, const int w, int h) -{ - while (h--) { - SDL_memcpyMMX(dst, src, w); - src += srcskip; - dst += dstskip; - } - _mm_empty(); -} -#endif /* SDL_MMX_INTRINSICS */ - void SDL_BlitCopy(SDL_BlitInfo *info) { SDL_bool overlap; @@ -149,13 +102,6 @@ void SDL_BlitCopy(SDL_BlitInfo *info) } #endif -#ifdef SDL_MMX_INTRINSICS - if (SDL_HasMMX() && !(srcskip & 7) && !(dstskip & 7)) { - SDL_BlitCopyMMX(dst, src, dstskip, srcskip, w, h); - return; - } -#endif - while (h--) { SDL_memcpy(dst, src, w); src += srcskip;