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.
This commit is contained in:
Ryan C. Gordon
2023-09-26 12:29:09 -04:00
parent 9d03ff6c18
commit 78a36830f8

View File

@@ -50,53 +50,6 @@ static SDL_INLINE void SDL_TARGETING("sse") SDL_memcpySSE(Uint8 *dst, const Uint
} }
#endif /* SDL_SSE_INTRINSICS */ #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) void SDL_BlitCopy(SDL_BlitInfo *info)
{ {
SDL_bool overlap; SDL_bool overlap;
@@ -149,13 +102,6 @@ void SDL_BlitCopy(SDL_BlitInfo *info)
} }
#endif #endif
#ifdef SDL_MMX_INTRINSICS
if (SDL_HasMMX() && !(srcskip & 7) && !(dstskip & 7)) {
SDL_BlitCopyMMX(dst, src, dstskip, srcskip, w, h);
return;
}
#endif
while (h--) { while (h--) {
SDL_memcpy(dst, src, w); SDL_memcpy(dst, src, w);
src += srcskip; src += srcskip;