Fixed bug 2537 - _allmul in SDL_lib.c is not working properly

main
Sam Lantinga 2014-07-27 17:44:10 -07:00
parent 5c6c86912d
commit a0b68e817d
1 changed files with 29 additions and 38 deletions

View File

@ -370,44 +370,35 @@ _ftol2_sse()
_ftol(); _ftol();
} }
/* 64-bit math operators for 32-bit systems */ /* 64-bit math operators for 32-bit systems */
void void
__declspec(naked) __declspec(naked)
_allmul() _allmul()
{ {
/* *INDENT-OFF* */ /* *INDENT-OFF* */
__asm { __asm {
push ebp mov eax, dword ptr[esp+8]
mov ebp,esp mov ecx, dword ptr[esp+10h]
push edi or ecx, eax
push esi mov ecx, dword ptr[esp+0Ch]
push ebx jne hard
sub esp,0Ch mov eax, dword ptr[esp+4]
mov eax,dword ptr [ebp+10h] mul ecx
mov edi,dword ptr [ebp+8] ret 10h
mov ebx,eax hard:
mov esi,eax push ebx
sar esi,1Fh mul ecx
mov eax,dword ptr [ebp+8] mov ebx, eax
mul ebx mov eax, dword ptr[esp+8]
imul edi,esi mul dword ptr[esp+14h]
mov ecx,edx add ebx, eax
mov dword ptr [ebp-18h],eax mov eax, dword ptr[esp+8]
mov edx,dword ptr [ebp+0Ch] mul ecx
add ecx,edi add edx, ebx
imul ebx,edx pop ebx
mov eax,dword ptr [ebp-18h] ret 10h
lea ebx,[ebx+ecx] }
mov dword ptr [ebp-14h],ebx /* *INDENT-ON* */
mov edx,dword ptr [ebp-14h]
add esp,0Ch
pop ebx
pop esi
pop edi
pop ebp
ret 10h
}
/* *INDENT-ON* */
} }
void void