SDL_blit_copy: Don't call potentially FPU using SDL_memcpy in SDL_memcpyMMX
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
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d1ca06a..376748b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -530,11 +530,9 @@ if(USE_INTELCC)
# warning #39: division by zero
# warning #239: floating point underflow
# warning #264: floating-point value does not fit in required floating-point type
- # warning #13203: No EMMS instruction before call to function
set_property(SOURCE "${SDL2_SOURCE_DIR}/src/libm/e_exp.c" APPEND_STRING PROPERTY COMPILE_FLAGS " -wd239 -wd264")
set_property(SOURCE "${SDL2_SOURCE_DIR}/src/libm/e_log.c" APPEND_STRING PROPERTY COMPILE_FLAGS " -wd39")
set_property(SOURCE "${SDL2_SOURCE_DIR}/src/libm/e_log10.c" APPEND_STRING PROPERTY COMPILE_FLAGS " -wd39")
- set_property(SOURCE "${SDL2_SOURCE_DIR}/src/video/SDL_blit_copy.c" APPEND_STRING PROPERTY COMPILE_FLAGS " -wd13203")
endif()
diff --git a/src/video/SDL_blit_copy.c b/src/video/SDL_blit_copy.c
index e8462ab..b772a55 100644
--- a/src/video/SDL_blit_copy.c
+++ b/src/video/SDL_blit_copy.c
@@ -57,7 +57,7 @@ static SDL_INLINE void SDL_memcpySSE(Uint8 *dst, const Uint8 *src, int len)
#endif
static SDL_INLINE void SDL_memcpyMMX(Uint8 *dst, const Uint8 *src, int len)
{
- const int remain = (len & 63);
+ int remain = len & 63;
int i;
__m64 *d64 = (__m64 *)dst;
@@ -79,7 +79,11 @@ static SDL_INLINE void SDL_memcpyMMX(Uint8 *dst, const Uint8 *src, int len)
if (remain) {
const int skip = len - remain;
- SDL_memcpy(dst + skip, src + skip, remain);
+ dst += skip;
+ src += skip;
+ while (remain--) {
+ *dst++ = *src++;
+ }
}
}
#endif /* __MMX__ */