SDL_blit_copy: Don't call potentially FPU using SDL_memcpy in SDL_memcpyMMX

This commit is contained in:
Anonymous Maarten 2023-03-26 16:31:18 +02:00 committed by Anonymous Maarten
parent 51c10bef0b
commit cd64e0b6e3
2 changed files with 6 additions and 4 deletions

View file

@ -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()

View file

@ -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__ */