src/stdlib/SDL_stdlib.c
changeset 9015 45f11ff360a8
parent 8840 9b6ddcbdea65
child 9075 257a6793aaf5
     1.1 --- a/src/stdlib/SDL_stdlib.c	Sun Jul 27 17:43:36 2014 -0700
     1.2 +++ b/src/stdlib/SDL_stdlib.c	Sun Jul 27 17:44:10 2014 -0700
     1.3 @@ -370,44 +370,35 @@
     1.4      _ftol();
     1.5  }
     1.6  
     1.7 -/* 64-bit math operators for 32-bit systems */
     1.8 -void
     1.9 -__declspec(naked)
    1.10 -_allmul()
    1.11 -{
    1.12 -    /* *INDENT-OFF* */
    1.13 -    __asm {
    1.14 -        push        ebp
    1.15 -        mov         ebp,esp
    1.16 -        push        edi
    1.17 -        push        esi
    1.18 -        push        ebx
    1.19 -        sub         esp,0Ch
    1.20 -        mov         eax,dword ptr [ebp+10h]
    1.21 -        mov         edi,dword ptr [ebp+8]
    1.22 -        mov         ebx,eax
    1.23 -        mov         esi,eax
    1.24 -        sar         esi,1Fh
    1.25 -        mov         eax,dword ptr [ebp+8]
    1.26 -        mul         ebx
    1.27 -        imul        edi,esi
    1.28 -        mov         ecx,edx
    1.29 -        mov         dword ptr [ebp-18h],eax
    1.30 -        mov         edx,dword ptr [ebp+0Ch]
    1.31 -        add         ecx,edi
    1.32 -        imul        ebx,edx
    1.33 -        mov         eax,dword ptr [ebp-18h]
    1.34 -        lea         ebx,[ebx+ecx]
    1.35 -        mov         dword ptr [ebp-14h],ebx
    1.36 -        mov         edx,dword ptr [ebp-14h]
    1.37 -        add         esp,0Ch
    1.38 -        pop         ebx
    1.39 -        pop         esi
    1.40 -        pop         edi
    1.41 -        pop         ebp
    1.42 -        ret         10h
    1.43 -    }
    1.44 -    /* *INDENT-ON* */
    1.45 +/* 64-bit math operators for 32-bit systems */
    1.46 +void
    1.47 +__declspec(naked)
    1.48 +_allmul()
    1.49 +{
    1.50 +    /* *INDENT-OFF* */
    1.51 +    __asm {
    1.52 +        mov         eax, dword ptr[esp+8]
    1.53 +        mov         ecx, dword ptr[esp+10h]
    1.54 +        or          ecx, eax
    1.55 +        mov         ecx, dword ptr[esp+0Ch]
    1.56 +        jne         hard
    1.57 +        mov         eax, dword ptr[esp+4]
    1.58 +        mul         ecx
    1.59 +        ret         10h
    1.60 +hard:
    1.61 +        push        ebx
    1.62 +        mul         ecx
    1.63 +        mov         ebx, eax
    1.64 +        mov         eax, dword ptr[esp+8]
    1.65 +        mul         dword ptr[esp+14h]
    1.66 +        add         ebx, eax
    1.67 +        mov         eax, dword ptr[esp+8]
    1.68 +        mul         ecx
    1.69 +        add         edx, ebx
    1.70 +        pop         ebx
    1.71 +        ret         10h
    1.72 +    }
    1.73 +    /* *INDENT-ON* */
    1.74  }
    1.75  
    1.76  void