src/stdlib/SDL_stdlib.c
changeset 1895 c121d94672cb
parent 1433 bb6839704ed6
child 2698 e1da92da346c
     1.1 --- a/src/stdlib/SDL_stdlib.c	Thu Jul 06 18:01:37 2006 +0000
     1.2 +++ b/src/stdlib/SDL_stdlib.c	Mon Jul 10 21:04:37 2006 +0000
     1.3 @@ -33,588 +33,632 @@
     1.4  #ifndef __FLTUSED__
     1.5  #define __FLTUSED__
     1.6  #ifdef __cplusplus
     1.7 -   extern "C"
     1.8 +extern "C"
     1.9  #endif
    1.10 -	   __declspec(selectany) int _fltused=1;
    1.11 +__declspec(selectany)
    1.12 +     int _fltused = 1;
    1.13  #endif
    1.14  
    1.15  /* Float to long */
    1.16 -void __declspec(naked) _ftol()
    1.17 +     void __declspec(naked) _ftol()
    1.18  {
    1.19 -	__asm {
    1.20 -		push        ebp
    1.21 -		mov         ebp,esp
    1.22 -		sub         esp,20h
    1.23 -		and         esp,0FFFFFFF0h
    1.24 -		fld         st(0)
    1.25 -		fst         dword ptr [esp+18h]
    1.26 -		fistp       qword ptr [esp+10h]
    1.27 -		fild        qword ptr [esp+10h]
    1.28 -		mov         edx,dword ptr [esp+18h]
    1.29 -		mov         eax,dword ptr [esp+10h]
    1.30 -		test        eax,eax
    1.31 -		je          integer_QnaN_or_zero
    1.32 +    /* *INDENT-OFF* */
    1.33 +    __asm {
    1.34 +        push        ebp
    1.35 +        mov         ebp,esp
    1.36 +        sub         esp,20h
    1.37 +        and         esp,0FFFFFFF0h
    1.38 +        fld         st(0)
    1.39 +        fst         dword ptr [esp+18h]
    1.40 +        fistp       qword ptr [esp+10h]
    1.41 +        fild        qword ptr [esp+10h]
    1.42 +        mov         edx,dword ptr [esp+18h]
    1.43 +        mov         eax,dword ptr [esp+10h]
    1.44 +        test        eax,eax
    1.45 +        je          integer_QnaN_or_zero
    1.46  arg_is_not_integer_QnaN:
    1.47 -		fsubp       st(1),st
    1.48 -		test        edx,edx
    1.49 -		jns         positive
    1.50 -		fstp        dword ptr [esp]
    1.51 -		mov         ecx,dword ptr [esp]
    1.52 -		xor         ecx,80000000h
    1.53 -		add         ecx,7FFFFFFFh
    1.54 -		adc         eax,0
    1.55 -		mov         edx,dword ptr [esp+14h]
    1.56 -		adc         edx,0
    1.57 -		jmp         localexit
    1.58 +        fsubp       st(1),st
    1.59 +        test        edx,edx
    1.60 +        jns         positive
    1.61 +        fstp        dword ptr [esp]
    1.62 +        mov         ecx,dword ptr [esp]
    1.63 +        xor         ecx,80000000h
    1.64 +        add         ecx,7FFFFFFFh
    1.65 +        adc         eax,0
    1.66 +        mov         edx,dword ptr [esp+14h]
    1.67 +        adc         edx,0
    1.68 +        jmp         localexit
    1.69  positive:
    1.70 -		fstp        dword ptr [esp]
    1.71 -		mov         ecx,dword ptr [esp]
    1.72 -		add         ecx,7FFFFFFFh
    1.73 -		sbb         eax,0
    1.74 -		mov         edx,dword ptr [esp+14h]
    1.75 -		sbb         edx,0
    1.76 -		jmp         localexit
    1.77 +        fstp        dword ptr [esp]
    1.78 +        mov         ecx,dword ptr [esp]
    1.79 +        add         ecx,7FFFFFFFh
    1.80 +        sbb         eax,0
    1.81 +        mov         edx,dword ptr [esp+14h]
    1.82 +        sbb         edx,0
    1.83 +        jmp         localexit
    1.84  integer_QnaN_or_zero:
    1.85 -		mov         edx,dword ptr [esp+14h]
    1.86 -		test        edx,7FFFFFFFh
    1.87 -		jne         arg_is_not_integer_QnaN
    1.88 -		fstp        dword ptr [esp+18h]
    1.89 -		fstp        dword ptr [esp+18h]
    1.90 +        mov         edx,dword ptr [esp+14h]
    1.91 +        test        edx,7FFFFFFFh
    1.92 +        jne         arg_is_not_integer_QnaN
    1.93 +        fstp        dword ptr [esp+18h]
    1.94 +        fstp        dword ptr [esp+18h]
    1.95  localexit:
    1.96 -		leave
    1.97 -		ret
    1.98 -	}
    1.99 +        leave
   1.100 +        ret
   1.101 +    }
   1.102 +    /* *INDENT-ON* */
   1.103  }
   1.104 -void __declspec(naked) _ftol2_sse()
   1.105 +
   1.106 +void
   1.107 +__declspec(naked)
   1.108 +_ftol2_sse()
   1.109  {
   1.110 -	_ftol();
   1.111 +    _ftol();
   1.112  }
   1.113  
   1.114  /* 64-bit math operators for 32-bit systems */
   1.115 -void __declspec(naked) _allmul()
   1.116 +void
   1.117 +__declspec(naked)
   1.118 +_allmul()
   1.119  {
   1.120 -	__asm {
   1.121 -		push        ebp
   1.122 -		mov         ebp,esp
   1.123 -		push        edi
   1.124 -		push        esi
   1.125 -		push        ebx
   1.126 -		sub         esp,0Ch
   1.127 -		mov         eax,dword ptr [ebp+10h]
   1.128 -		mov         edi,dword ptr [ebp+8]
   1.129 -		mov         ebx,eax
   1.130 -		mov         esi,eax
   1.131 -		sar         esi,1Fh
   1.132 -		mov         eax,dword ptr [ebp+8]
   1.133 -		mul         ebx
   1.134 -		imul        edi,esi
   1.135 -		mov         ecx,edx
   1.136 -		mov         dword ptr [ebp-18h],eax
   1.137 -		mov         edx,dword ptr [ebp+0Ch]
   1.138 -		add         ecx,edi
   1.139 -		imul        ebx,edx
   1.140 -		mov         eax,dword ptr [ebp-18h]
   1.141 -		lea         ebx,[ebx+ecx]
   1.142 -		mov         dword ptr [ebp-14h],ebx
   1.143 -		mov         edx,dword ptr [ebp-14h]
   1.144 -		add         esp,0Ch
   1.145 -		pop         ebx
   1.146 -		pop         esi
   1.147 -		pop         edi
   1.148 -		pop         ebp
   1.149 -		ret
   1.150 -	}
   1.151 +    /* *INDENT-OFF* */
   1.152 +    __asm {
   1.153 +        push        ebp
   1.154 +        mov         ebp,esp
   1.155 +        push        edi
   1.156 +        push        esi
   1.157 +        push        ebx
   1.158 +        sub         esp,0Ch
   1.159 +        mov         eax,dword ptr [ebp+10h]
   1.160 +        mov         edi,dword ptr [ebp+8]
   1.161 +        mov         ebx,eax
   1.162 +        mov         esi,eax
   1.163 +        sar         esi,1Fh
   1.164 +        mov         eax,dword ptr [ebp+8]
   1.165 +        mul         ebx
   1.166 +        imul        edi,esi
   1.167 +        mov         ecx,edx
   1.168 +        mov         dword ptr [ebp-18h],eax
   1.169 +        mov         edx,dword ptr [ebp+0Ch]
   1.170 +        add         ecx,edi
   1.171 +        imul        ebx,edx
   1.172 +        mov         eax,dword ptr [ebp-18h]
   1.173 +        lea         ebx,[ebx+ecx]
   1.174 +        mov         dword ptr [ebp-14h],ebx
   1.175 +        mov         edx,dword ptr [ebp-14h]
   1.176 +        add         esp,0Ch
   1.177 +        pop         ebx
   1.178 +        pop         esi
   1.179 +        pop         edi
   1.180 +        pop         ebp
   1.181 +        ret
   1.182 +    }
   1.183 +    /* *INDENT-ON* */
   1.184  }
   1.185 -void __declspec(naked) _alldiv()
   1.186 +void
   1.187 +__declspec(naked)
   1.188 +_alldiv()
   1.189  {
   1.190 -	__asm {
   1.191 -		push        edi
   1.192 -		push        esi
   1.193 -		push        ebx
   1.194 -		xor         edi,edi
   1.195 -		mov         eax,dword ptr [esp+14h]
   1.196 -		or          eax,eax
   1.197 -		jge         L1
   1.198 -		inc         edi
   1.199 -		mov         edx,dword ptr [esp+10h]
   1.200 -		neg         eax
   1.201 -		neg         edx
   1.202 -		sbb         eax,0
   1.203 -		mov         dword ptr [esp+14h],eax
   1.204 -		mov         dword ptr [esp+10h],edx
   1.205 +    /* *INDENT-OFF* */
   1.206 +    __asm {
   1.207 +        push        edi
   1.208 +        push        esi
   1.209 +        push        ebx
   1.210 +        xor         edi,edi
   1.211 +        mov         eax,dword ptr [esp+14h]
   1.212 +        or          eax,eax
   1.213 +        jge         L1
   1.214 +        inc         edi
   1.215 +        mov         edx,dword ptr [esp+10h]
   1.216 +        neg         eax
   1.217 +        neg         edx
   1.218 +        sbb         eax,0
   1.219 +        mov         dword ptr [esp+14h],eax
   1.220 +        mov         dword ptr [esp+10h],edx
   1.221  L1:
   1.222 -		mov         eax,dword ptr [esp+1Ch]
   1.223 -		or          eax,eax
   1.224 -		jge         L2
   1.225 -		inc         edi
   1.226 -		mov         edx,dword ptr [esp+18h]
   1.227 -		neg         eax
   1.228 -		neg         edx
   1.229 -		sbb         eax,0
   1.230 -		mov         dword ptr [esp+1Ch],eax
   1.231 -		mov         dword ptr [esp+18h],edx
   1.232 +        mov         eax,dword ptr [esp+1Ch]
   1.233 +        or          eax,eax
   1.234 +        jge         L2
   1.235 +        inc         edi
   1.236 +        mov         edx,dword ptr [esp+18h]
   1.237 +        neg         eax
   1.238 +        neg         edx
   1.239 +        sbb         eax,0
   1.240 +        mov         dword ptr [esp+1Ch],eax
   1.241 +        mov         dword ptr [esp+18h],edx
   1.242  L2:
   1.243 -		or          eax,eax
   1.244 -		jne         L3
   1.245 -		mov         ecx,dword ptr [esp+18h]
   1.246 -		mov         eax,dword ptr [esp+14h]
   1.247 -		xor         edx,edx
   1.248 -		div         ecx
   1.249 -		mov         ebx,eax
   1.250 -		mov         eax,dword ptr [esp+10h]
   1.251 -		div         ecx
   1.252 -		mov         edx,ebx
   1.253 -		jmp         L4
   1.254 +        or          eax,eax
   1.255 +        jne         L3
   1.256 +        mov         ecx,dword ptr [esp+18h]
   1.257 +        mov         eax,dword ptr [esp+14h]
   1.258 +        xor         edx,edx
   1.259 +        div         ecx
   1.260 +        mov         ebx,eax
   1.261 +        mov         eax,dword ptr [esp+10h]
   1.262 +        div         ecx
   1.263 +        mov         edx,ebx
   1.264 +        jmp         L4
   1.265  L3:
   1.266 -		mov         ebx,eax
   1.267 -		mov         ecx,dword ptr [esp+18h]
   1.268 -		mov         edx,dword ptr [esp+14h]
   1.269 -		mov         eax,dword ptr [esp+10h]
   1.270 +        mov         ebx,eax
   1.271 +        mov         ecx,dword ptr [esp+18h]
   1.272 +        mov         edx,dword ptr [esp+14h]
   1.273 +        mov         eax,dword ptr [esp+10h]
   1.274  L5:
   1.275 -		shr         ebx,1
   1.276 -		rcr         ecx,1
   1.277 -		shr         edx,1
   1.278 -		rcr         eax,1
   1.279 -		or          ebx,ebx
   1.280 -		jne         L5
   1.281 -		div         ecx
   1.282 -		mov         esi,eax
   1.283 -		mul         dword ptr [esp+1Ch]
   1.284 -		mov         ecx,eax
   1.285 -		mov         eax,dword ptr [esp+18h]
   1.286 -		mul         esi
   1.287 -		add         edx,ecx
   1.288 -		jb          L6
   1.289 -		cmp         edx,dword ptr [esp+14h]
   1.290 -		ja          L6
   1.291 -		jb          L7
   1.292 -		cmp         eax,dword ptr [esp+10h]
   1.293 -		jbe         L7
   1.294 +        shr         ebx,1
   1.295 +        rcr         ecx,1
   1.296 +        shr         edx,1
   1.297 +        rcr         eax,1
   1.298 +        or          ebx,ebx
   1.299 +        jne         L5
   1.300 +        div         ecx
   1.301 +        mov         esi,eax
   1.302 +        mul         dword ptr [esp+1Ch]
   1.303 +        mov         ecx,eax
   1.304 +        mov         eax,dword ptr [esp+18h]
   1.305 +        mul         esi
   1.306 +        add         edx,ecx
   1.307 +        jb          L6
   1.308 +        cmp         edx,dword ptr [esp+14h]
   1.309 +        ja          L6
   1.310 +        jb          L7
   1.311 +        cmp         eax,dword ptr [esp+10h]
   1.312 +        jbe         L7
   1.313  L6:
   1.314 -		dec         esi
   1.315 +        dec         esi
   1.316  L7:
   1.317 -		xor         edx,edx
   1.318 -		mov         eax,esi
   1.319 +        xor         edx,edx
   1.320 +        mov         eax,esi
   1.321  L4:
   1.322 -		dec         edi
   1.323 -		jne         L8
   1.324 -		neg         edx
   1.325 -		neg         eax
   1.326 -		sbb         edx,0
   1.327 +        dec         edi
   1.328 +        jne         L8
   1.329 +        neg         edx
   1.330 +        neg         eax
   1.331 +        sbb         edx,0
   1.332  L8:
   1.333 -		pop         ebx
   1.334 -		pop         esi
   1.335 -		pop         edi
   1.336 -		ret         10h
   1.337 -	}
   1.338 +        pop         ebx
   1.339 +        pop         esi
   1.340 +        pop         edi
   1.341 +        ret         10h
   1.342 +    }
   1.343 +    /* *INDENT-ON* */
   1.344  }
   1.345 -void __declspec(naked) _aulldiv()
   1.346 +void
   1.347 +__declspec(naked)
   1.348 +_aulldiv()
   1.349  {
   1.350 -	__asm {
   1.351 -		push        ebx
   1.352 -		push        esi
   1.353 -		mov         eax,dword ptr [esp+18h]
   1.354 -		or          eax,eax
   1.355 -		jne         L1
   1.356 -		mov         ecx,dword ptr [esp+14h]
   1.357 -		mov         eax,dword ptr [esp+10h]
   1.358 -		xor         edx,edx
   1.359 -		div         ecx
   1.360 -		mov         ebx,eax
   1.361 -		mov         eax,dword ptr [esp+0Ch]
   1.362 -		div         ecx
   1.363 -		mov         edx,ebx
   1.364 -		jmp         L2
   1.365 +    /* *INDENT-OFF* */
   1.366 +    __asm {
   1.367 +        push        ebx
   1.368 +        push        esi
   1.369 +        mov         eax,dword ptr [esp+18h]
   1.370 +        or          eax,eax
   1.371 +        jne         L1
   1.372 +        mov         ecx,dword ptr [esp+14h]
   1.373 +        mov         eax,dword ptr [esp+10h]
   1.374 +        xor         edx,edx
   1.375 +        div         ecx
   1.376 +        mov         ebx,eax
   1.377 +        mov         eax,dword ptr [esp+0Ch]
   1.378 +        div         ecx
   1.379 +        mov         edx,ebx
   1.380 +        jmp         L2
   1.381  L1:
   1.382 -		mov         ecx,eax
   1.383 -		mov         ebx,dword ptr [esp+14h]
   1.384 -		mov         edx,dword ptr [esp+10h]
   1.385 -		mov         eax,dword ptr [esp+0Ch]
   1.386 +        mov         ecx,eax
   1.387 +        mov         ebx,dword ptr [esp+14h]
   1.388 +        mov         edx,dword ptr [esp+10h]
   1.389 +        mov         eax,dword ptr [esp+0Ch]
   1.390  L3:
   1.391 -		shr         ecx,1
   1.392 -		rcr         ebx,1
   1.393 -		shr         edx,1
   1.394 -		rcr         eax,1
   1.395 -		or          ecx,ecx
   1.396 -		jne         L3
   1.397 -		div         ebx
   1.398 -		mov         esi,eax
   1.399 -		mul         dword ptr [esp+18h]
   1.400 -		mov         ecx,eax
   1.401 -		mov         eax,dword ptr [esp+14h]
   1.402 -		mul         esi
   1.403 -		add         edx,ecx
   1.404 -		jb          L4
   1.405 -		cmp         edx,dword ptr [esp+10h]
   1.406 -		ja          L4
   1.407 -		jb          L5
   1.408 -		cmp         eax,dword ptr [esp+0Ch]
   1.409 -		jbe         L5
   1.410 +        shr         ecx,1
   1.411 +        rcr         ebx,1
   1.412 +        shr         edx,1
   1.413 +        rcr         eax,1
   1.414 +        or          ecx,ecx
   1.415 +        jne         L3
   1.416 +        div         ebx
   1.417 +        mov         esi,eax
   1.418 +        mul         dword ptr [esp+18h]
   1.419 +        mov         ecx,eax
   1.420 +        mov         eax,dword ptr [esp+14h]
   1.421 +        mul         esi
   1.422 +        add         edx,ecx
   1.423 +        jb          L4
   1.424 +        cmp         edx,dword ptr [esp+10h]
   1.425 +        ja          L4
   1.426 +        jb          L5
   1.427 +        cmp         eax,dword ptr [esp+0Ch]
   1.428 +        jbe         L5
   1.429  L4:
   1.430 -		dec         esi
   1.431 +        dec         esi
   1.432  L5:
   1.433 -		xor         edx,edx
   1.434 -		mov         eax,esi
   1.435 +        xor         edx,edx
   1.436 +        mov         eax,esi
   1.437  L2:
   1.438 -		pop         esi
   1.439 -		pop         ebx
   1.440 -		ret         10h
   1.441 -	}
   1.442 +        pop         esi
   1.443 +        pop         ebx
   1.444 +        ret         10h
   1.445 +    }
   1.446 +    /* *INDENT-ON* */
   1.447  }
   1.448 -void __declspec(naked) _allrem()
   1.449 +void
   1.450 +__declspec(naked)
   1.451 +_allrem()
   1.452  {
   1.453 -	__asm {
   1.454 -		push        ebx
   1.455 -		push        edi
   1.456 -		xor         edi,edi
   1.457 -		mov         eax,dword ptr [esp+10h]
   1.458 -		or          eax,eax
   1.459 -		jge         L1
   1.460 -		inc         edi
   1.461 -		mov         edx,dword ptr [esp+0Ch]
   1.462 -		neg         eax
   1.463 -		neg         edx
   1.464 -		sbb         eax,0
   1.465 -		mov         dword ptr [esp+10h],eax
   1.466 -		mov         dword ptr [esp+0Ch],edx
   1.467 +    /* *INDENT-OFF* */
   1.468 +    __asm {
   1.469 +        push        ebx
   1.470 +        push        edi
   1.471 +        xor         edi,edi
   1.472 +        mov         eax,dword ptr [esp+10h]
   1.473 +        or          eax,eax
   1.474 +        jge         L1
   1.475 +        inc         edi
   1.476 +        mov         edx,dword ptr [esp+0Ch]
   1.477 +        neg         eax
   1.478 +        neg         edx
   1.479 +        sbb         eax,0
   1.480 +        mov         dword ptr [esp+10h],eax
   1.481 +        mov         dword ptr [esp+0Ch],edx
   1.482  L1:
   1.483 -		mov         eax,dword ptr [esp+18h]
   1.484 -		or          eax,eax
   1.485 -		jge         L2
   1.486 -		mov         edx,dword ptr [esp+14h]
   1.487 -		neg         eax
   1.488 -		neg         edx
   1.489 -		sbb         eax,0
   1.490 -		mov         dword ptr [esp+18h],eax
   1.491 -		mov         dword ptr [esp+14h],edx
   1.492 +        mov         eax,dword ptr [esp+18h]
   1.493 +        or          eax,eax
   1.494 +        jge         L2
   1.495 +        mov         edx,dword ptr [esp+14h]
   1.496 +        neg         eax
   1.497 +        neg         edx
   1.498 +        sbb         eax,0
   1.499 +        mov         dword ptr [esp+18h],eax
   1.500 +        mov         dword ptr [esp+14h],edx
   1.501  L2:
   1.502 -		or          eax,eax
   1.503 -		jne         L3
   1.504 -		mov         ecx,dword ptr [esp+14h]
   1.505 -		mov         eax,dword ptr [esp+10h]
   1.506 -		xor         edx,edx
   1.507 -		div         ecx
   1.508 -		mov         eax,dword ptr [esp+0Ch]
   1.509 -		div         ecx
   1.510 -		mov         eax,edx
   1.511 -		xor         edx,edx
   1.512 -		dec         edi
   1.513 -		jns         L4
   1.514 -		jmp         L8
   1.515 +        or          eax,eax
   1.516 +        jne         L3
   1.517 +        mov         ecx,dword ptr [esp+14h]
   1.518 +        mov         eax,dword ptr [esp+10h]
   1.519 +        xor         edx,edx
   1.520 +        div         ecx
   1.521 +        mov         eax,dword ptr [esp+0Ch]
   1.522 +        div         ecx
   1.523 +        mov         eax,edx
   1.524 +        xor         edx,edx
   1.525 +        dec         edi
   1.526 +        jns         L4
   1.527 +        jmp         L8
   1.528  L3:
   1.529 -		mov         ebx,eax
   1.530 -		mov         ecx,dword ptr [esp+14h]
   1.531 -		mov         edx,dword ptr [esp+10h]
   1.532 -		mov         eax,dword ptr [esp+0Ch]
   1.533 +        mov         ebx,eax
   1.534 +        mov         ecx,dword ptr [esp+14h]
   1.535 +        mov         edx,dword ptr [esp+10h]
   1.536 +        mov         eax,dword ptr [esp+0Ch]
   1.537  L5:
   1.538 -		shr         ebx,1
   1.539 -		rcr         ecx,1
   1.540 -		shr         edx,1
   1.541 -		rcr         eax,1
   1.542 -		or          ebx,ebx
   1.543 -		jne         L5
   1.544 -		div         ecx
   1.545 -		mov         ecx,eax
   1.546 -		mul         dword ptr [esp+18h]
   1.547 -		xchg        eax,ecx
   1.548 -		mul         dword ptr [esp+14h]
   1.549 -		add         edx,ecx
   1.550 -		jb          L6
   1.551 -		cmp         edx,dword ptr [esp+10h]
   1.552 -		ja          L6
   1.553 -		jb          L7
   1.554 -		cmp         eax,dword ptr [esp+0Ch]
   1.555 -		jbe         L7
   1.556 +        shr         ebx,1
   1.557 +        rcr         ecx,1
   1.558 +        shr         edx,1
   1.559 +        rcr         eax,1
   1.560 +        or          ebx,ebx
   1.561 +        jne         L5
   1.562 +        div         ecx
   1.563 +        mov         ecx,eax
   1.564 +        mul         dword ptr [esp+18h]
   1.565 +        xchg        eax,ecx
   1.566 +        mul         dword ptr [esp+14h]
   1.567 +        add         edx,ecx
   1.568 +        jb          L6
   1.569 +        cmp         edx,dword ptr [esp+10h]
   1.570 +        ja          L6
   1.571 +        jb          L7
   1.572 +        cmp         eax,dword ptr [esp+0Ch]
   1.573 +        jbe         L7
   1.574  L6:
   1.575 -		sub         eax,dword ptr [esp+14h]
   1.576 -		sbb         edx,dword ptr [esp+18h]
   1.577 +        sub         eax,dword ptr [esp+14h]
   1.578 +        sbb         edx,dword ptr [esp+18h]
   1.579  L7:
   1.580 -		sub         eax,dword ptr [esp+0Ch]
   1.581 -		sbb         edx,dword ptr [esp+10h]
   1.582 -		dec         edi
   1.583 -		jns         L8
   1.584 +        sub         eax,dword ptr [esp+0Ch]
   1.585 +        sbb         edx,dword ptr [esp+10h]
   1.586 +        dec         edi
   1.587 +        jns         L8
   1.588  L4:
   1.589 -		neg         edx
   1.590 -		neg         eax
   1.591 -		sbb         edx,0
   1.592 +        neg         edx
   1.593 +        neg         eax
   1.594 +        sbb         edx,0
   1.595  L8:
   1.596 -		pop         edi
   1.597 -		pop         ebx
   1.598 -		ret         10h
   1.599 -	}
   1.600 +        pop         edi
   1.601 +        pop         ebx
   1.602 +        ret         10h
   1.603 +    }
   1.604 +    /* *INDENT-ON* */
   1.605  }
   1.606 -void __declspec(naked) _aullrem()
   1.607 +void
   1.608 +__declspec(naked)
   1.609 +_aullrem()
   1.610  {
   1.611 -	__asm {
   1.612 -		push        ebx
   1.613 -		mov         eax,dword ptr [esp+14h]
   1.614 -		or          eax,eax
   1.615 -		jne         L1
   1.616 -		mov         ecx,dword ptr [esp+10h]
   1.617 -		mov         eax,dword ptr [esp+0Ch]
   1.618 -		xor         edx,edx
   1.619 -		div         ecx
   1.620 -		mov         eax,dword ptr [esp+8]
   1.621 -		div         ecx
   1.622 -		mov         eax,edx
   1.623 -		xor         edx,edx
   1.624 -		jmp         L2
   1.625 +    /* *INDENT-OFF* */
   1.626 +    __asm {
   1.627 +        push        ebx
   1.628 +        mov         eax,dword ptr [esp+14h]
   1.629 +        or          eax,eax
   1.630 +        jne         L1
   1.631 +        mov         ecx,dword ptr [esp+10h]
   1.632 +        mov         eax,dword ptr [esp+0Ch]
   1.633 +        xor         edx,edx
   1.634 +        div         ecx
   1.635 +        mov         eax,dword ptr [esp+8]
   1.636 +        div         ecx
   1.637 +        mov         eax,edx
   1.638 +        xor         edx,edx
   1.639 +        jmp         L2
   1.640  L1:
   1.641 -		mov         ecx,eax
   1.642 -		mov         ebx,dword ptr [esp+10h]
   1.643 -		mov         edx,dword ptr [esp+0Ch]
   1.644 -		mov         eax,dword ptr [esp+8]
   1.645 +        mov         ecx,eax
   1.646 +        mov         ebx,dword ptr [esp+10h]
   1.647 +        mov         edx,dword ptr [esp+0Ch]
   1.648 +        mov         eax,dword ptr [esp+8]
   1.649  L3:
   1.650 -		shr         ecx,1
   1.651 -		rcr         ebx,1
   1.652 -		shr         edx,1
   1.653 -		rcr         eax,1
   1.654 -		or          ecx,ecx
   1.655 -		jne         L3
   1.656 -		div         ebx
   1.657 -		mov         ecx,eax
   1.658 -		mul         dword ptr [esp+14h]
   1.659 -		xchg        eax,ecx
   1.660 -		mul         dword ptr [esp+10h]
   1.661 -		add         edx,ecx
   1.662 -		jb          L4
   1.663 -		cmp         edx,dword ptr [esp+0Ch]
   1.664 -		ja          L4
   1.665 -		jb          L5
   1.666 -		cmp         eax,dword ptr [esp+8]
   1.667 -		jbe         L5
   1.668 +        shr         ecx,1
   1.669 +        rcr         ebx,1
   1.670 +        shr         edx,1
   1.671 +        rcr         eax,1
   1.672 +        or          ecx,ecx
   1.673 +        jne         L3
   1.674 +        div         ebx
   1.675 +        mov         ecx,eax
   1.676 +        mul         dword ptr [esp+14h]
   1.677 +        xchg        eax,ecx
   1.678 +        mul         dword ptr [esp+10h]
   1.679 +        add         edx,ecx
   1.680 +        jb          L4
   1.681 +        cmp         edx,dword ptr [esp+0Ch]
   1.682 +        ja          L4
   1.683 +        jb          L5
   1.684 +        cmp         eax,dword ptr [esp+8]
   1.685 +        jbe         L5
   1.686  L4:
   1.687 -		sub         eax,dword ptr [esp+10h]
   1.688 -		sbb         edx,dword ptr [esp+14h]
   1.689 +        sub         eax,dword ptr [esp+10h]
   1.690 +        sbb         edx,dword ptr [esp+14h]
   1.691  L5:
   1.692 -		sub         eax,dword ptr [esp+8]
   1.693 -		sbb         edx,dword ptr [esp+0Ch]
   1.694 -		neg         edx
   1.695 -		neg         eax
   1.696 -		sbb         edx,0
   1.697 +        sub         eax,dword ptr [esp+8]
   1.698 +        sbb         edx,dword ptr [esp+0Ch]
   1.699 +        neg         edx
   1.700 +        neg         eax
   1.701 +        sbb         edx,0
   1.702  L2:
   1.703 -		pop         ebx
   1.704 -		ret         10h
   1.705 -	}
   1.706 +        pop         ebx
   1.707 +        ret         10h
   1.708 +    }
   1.709 +    /* *INDENT-ON* */
   1.710  }
   1.711 -void __declspec(naked) _alldvrm()
   1.712 +void
   1.713 +__declspec(naked)
   1.714 +_alldvrm()
   1.715  {
   1.716 -	__asm {
   1.717 -		push        edi
   1.718 -		push        esi
   1.719 -		push        ebp
   1.720 -		xor         edi,edi
   1.721 -		xor         ebp,ebp
   1.722 -		mov         eax,dword ptr [esp+14h]
   1.723 -		or          eax,eax
   1.724 -		jge         L1
   1.725 -		inc         edi
   1.726 -		inc         ebp
   1.727 -		mov         edx,dword ptr [esp+10h]
   1.728 -		neg         eax
   1.729 -		neg         edx
   1.730 -		sbb         eax,0
   1.731 -		mov         dword ptr [esp+14h],eax
   1.732 -		mov         dword ptr [esp+10h],edx
   1.733 +    /* *INDENT-OFF* */
   1.734 +    __asm {
   1.735 +        push        edi
   1.736 +        push        esi
   1.737 +        push        ebp
   1.738 +        xor         edi,edi
   1.739 +        xor         ebp,ebp
   1.740 +        mov         eax,dword ptr [esp+14h]
   1.741 +        or          eax,eax
   1.742 +        jge         L1
   1.743 +        inc         edi
   1.744 +        inc         ebp
   1.745 +        mov         edx,dword ptr [esp+10h]
   1.746 +        neg         eax
   1.747 +        neg         edx
   1.748 +        sbb         eax,0
   1.749 +        mov         dword ptr [esp+14h],eax
   1.750 +        mov         dword ptr [esp+10h],edx
   1.751  L1:
   1.752 -		mov         eax,dword ptr [esp+1Ch]
   1.753 -		or          eax,eax
   1.754 -		jge         L2
   1.755 -		inc         edi
   1.756 -		mov         edx,dword ptr [esp+18h]
   1.757 -		neg         eax
   1.758 -		neg         edx
   1.759 -		sbb         eax,0
   1.760 -		mov         dword ptr [esp+1Ch],eax
   1.761 -		mov         dword ptr [esp+18h],edx
   1.762 +        mov         eax,dword ptr [esp+1Ch]
   1.763 +        or          eax,eax
   1.764 +        jge         L2
   1.765 +        inc         edi
   1.766 +        mov         edx,dword ptr [esp+18h]
   1.767 +        neg         eax
   1.768 +        neg         edx
   1.769 +        sbb         eax,0
   1.770 +        mov         dword ptr [esp+1Ch],eax
   1.771 +        mov         dword ptr [esp+18h],edx
   1.772  L2:
   1.773 -		or          eax,eax
   1.774 -		jne         L3
   1.775 -		mov         ecx,dword ptr [esp+18h]
   1.776 -		mov         eax,dword ptr [esp+14h]
   1.777 -		xor         edx,edx
   1.778 -		div         ecx
   1.779 -		mov         ebx,eax
   1.780 -		mov         eax,dword ptr [esp+10h]
   1.781 -		div         ecx
   1.782 -		mov         esi,eax
   1.783 -		mov         eax,ebx
   1.784 -		mul         dword ptr [esp+18h]
   1.785 -		mov         ecx,eax
   1.786 -		mov         eax,esi
   1.787 -		mul         dword ptr [esp+18h]
   1.788 -		add         edx,ecx
   1.789 -		jmp         L4
   1.790 +        or          eax,eax
   1.791 +        jne         L3
   1.792 +        mov         ecx,dword ptr [esp+18h]
   1.793 +        mov         eax,dword ptr [esp+14h]
   1.794 +        xor         edx,edx
   1.795 +        div         ecx
   1.796 +        mov         ebx,eax
   1.797 +        mov         eax,dword ptr [esp+10h]
   1.798 +        div         ecx
   1.799 +        mov         esi,eax
   1.800 +        mov         eax,ebx
   1.801 +        mul         dword ptr [esp+18h]
   1.802 +        mov         ecx,eax
   1.803 +        mov         eax,esi
   1.804 +        mul         dword ptr [esp+18h]
   1.805 +        add         edx,ecx
   1.806 +        jmp         L4
   1.807  L3:
   1.808 -		mov         ebx,eax
   1.809 -		mov         ecx,dword ptr [esp+18h]
   1.810 -		mov         edx,dword ptr [esp+14h]
   1.811 -		mov         eax,dword ptr [esp+10h]
   1.812 +        mov         ebx,eax
   1.813 +        mov         ecx,dword ptr [esp+18h]
   1.814 +        mov         edx,dword ptr [esp+14h]
   1.815 +        mov         eax,dword ptr [esp+10h]
   1.816  L5:
   1.817 -		shr         ebx,1
   1.818 -		rcr         ecx,1
   1.819 -		shr         edx,1
   1.820 -		rcr         eax,1
   1.821 -		or          ebx,ebx
   1.822 -		jne         L5
   1.823 -		div         ecx
   1.824 -		mov         esi,eax
   1.825 -		mul         dword ptr [esp+1Ch]
   1.826 -		mov         ecx,eax
   1.827 -		mov         eax,dword ptr [esp+18h]
   1.828 -		mul         esi
   1.829 -		add         edx,ecx
   1.830 -		jb          L6
   1.831 -		cmp         edx,dword ptr [esp+14h]
   1.832 -		ja          L6
   1.833 -		jb          L7
   1.834 -		cmp         eax,dword ptr [esp+10h]
   1.835 -		jbe         L7
   1.836 +        shr         ebx,1
   1.837 +        rcr         ecx,1
   1.838 +        shr         edx,1
   1.839 +        rcr         eax,1
   1.840 +        or          ebx,ebx
   1.841 +        jne         L5
   1.842 +        div         ecx
   1.843 +        mov         esi,eax
   1.844 +        mul         dword ptr [esp+1Ch]
   1.845 +        mov         ecx,eax
   1.846 +        mov         eax,dword ptr [esp+18h]
   1.847 +        mul         esi
   1.848 +        add         edx,ecx
   1.849 +        jb          L6
   1.850 +        cmp         edx,dword ptr [esp+14h]
   1.851 +        ja          L6
   1.852 +        jb          L7
   1.853 +        cmp         eax,dword ptr [esp+10h]
   1.854 +        jbe         L7
   1.855  L6:
   1.856 -		dec         esi
   1.857 -		sub         eax,dword ptr [esp+18h]
   1.858 -		sbb         edx,dword ptr [esp+1Ch]
   1.859 +        dec         esi
   1.860 +        sub         eax,dword ptr [esp+18h]
   1.861 +        sbb         edx,dword ptr [esp+1Ch]
   1.862  L7:
   1.863 -		xor         ebx,ebx
   1.864 +        xor         ebx,ebx
   1.865  L4:
   1.866 -		sub         eax,dword ptr [esp+10h]
   1.867 -		sbb         edx,dword ptr [esp+14h]
   1.868 -		dec         ebp
   1.869 -		jns         L9
   1.870 -		neg         edx
   1.871 -		neg         eax
   1.872 -		sbb         edx,0
   1.873 +        sub         eax,dword ptr [esp+10h]
   1.874 +        sbb         edx,dword ptr [esp+14h]
   1.875 +        dec         ebp
   1.876 +        jns         L9
   1.877 +        neg         edx
   1.878 +        neg         eax
   1.879 +        sbb         edx,0
   1.880  L9:
   1.881 -		mov         ecx,edx
   1.882 -		mov         edx,ebx
   1.883 -		mov         ebx,ecx
   1.884 -		mov         ecx,eax
   1.885 -		mov         eax,esi
   1.886 -		dec         edi
   1.887 -		jne         L8
   1.888 -		neg         edx
   1.889 -		neg         eax
   1.890 -		sbb         edx,0
   1.891 +        mov         ecx,edx
   1.892 +        mov         edx,ebx
   1.893 +        mov         ebx,ecx
   1.894 +        mov         ecx,eax
   1.895 +        mov         eax,esi
   1.896 +        dec         edi
   1.897 +        jne         L8
   1.898 +        neg         edx
   1.899 +        neg         eax
   1.900 +        sbb         edx,0
   1.901  L8:
   1.902 -		pop         ebp
   1.903 -		pop         esi
   1.904 -		pop         edi
   1.905 -		ret         10h
   1.906 -	}
   1.907 +        pop         ebp
   1.908 +        pop         esi
   1.909 +        pop         edi
   1.910 +        ret         10h
   1.911 +    }
   1.912 +    /* *INDENT-ON* */
   1.913  }
   1.914 -void __declspec(naked) _aulldvrm()
   1.915 +void
   1.916 +__declspec(naked)
   1.917 +_aulldvrm()
   1.918  {
   1.919 -	__asm {
   1.920 -		push        esi
   1.921 -		mov         eax,dword ptr [esp+14h]
   1.922 -		or          eax,eax
   1.923 -		jne         L1
   1.924 -		mov         ecx,dword ptr [esp+10h]
   1.925 -		mov         eax,dword ptr [esp+0Ch]
   1.926 -		xor         edx,edx
   1.927 -		div         ecx
   1.928 -		mov         ebx,eax
   1.929 -		mov         eax,dword ptr [esp+8]
   1.930 -		div         ecx
   1.931 -		mov         esi,eax
   1.932 -		mov         eax,ebx
   1.933 -		mul         dword ptr [esp+10h]
   1.934 -		mov         ecx,eax
   1.935 -		mov         eax,esi
   1.936 -		mul         dword ptr [esp+10h]
   1.937 -		add         edx,ecx
   1.938 -		jmp         L2
   1.939 +    /* *INDENT-OFF* */
   1.940 +    __asm {
   1.941 +        push        esi
   1.942 +        mov         eax,dword ptr [esp+14h]
   1.943 +        or          eax,eax
   1.944 +        jne         L1
   1.945 +        mov         ecx,dword ptr [esp+10h]
   1.946 +        mov         eax,dword ptr [esp+0Ch]
   1.947 +        xor         edx,edx
   1.948 +        div         ecx
   1.949 +        mov         ebx,eax
   1.950 +        mov         eax,dword ptr [esp+8]
   1.951 +        div         ecx
   1.952 +        mov         esi,eax
   1.953 +        mov         eax,ebx
   1.954 +        mul         dword ptr [esp+10h]
   1.955 +        mov         ecx,eax
   1.956 +        mov         eax,esi
   1.957 +        mul         dword ptr [esp+10h]
   1.958 +        add         edx,ecx
   1.959 +        jmp         L2
   1.960  L1:
   1.961 -		mov         ecx,eax
   1.962 -		mov         ebx,dword ptr [esp+10h]
   1.963 -		mov         edx,dword ptr [esp+0Ch]
   1.964 -		mov         eax,dword ptr [esp+8]
   1.965 +        mov         ecx,eax
   1.966 +        mov         ebx,dword ptr [esp+10h]
   1.967 +        mov         edx,dword ptr [esp+0Ch]
   1.968 +        mov         eax,dword ptr [esp+8]
   1.969  L3:
   1.970 -		shr         ecx,1
   1.971 -		rcr         ebx,1
   1.972 -		shr         edx,1
   1.973 -		rcr         eax,1
   1.974 -		or          ecx,ecx
   1.975 -		jne         L3
   1.976 -		div         ebx
   1.977 -		mov         esi,eax
   1.978 -		mul         dword ptr [esp+14h]
   1.979 -		mov         ecx,eax
   1.980 -		mov         eax,dword ptr [esp+10h]
   1.981 -		mul         esi
   1.982 -		add         edx,ecx
   1.983 -		jb          L4
   1.984 -		cmp         edx,dword ptr [esp+0Ch]
   1.985 -		ja          L4
   1.986 -		jb          L5
   1.987 -		cmp         eax,dword ptr [esp+8]
   1.988 -		jbe         L5
   1.989 +        shr         ecx,1
   1.990 +        rcr         ebx,1
   1.991 +        shr         edx,1
   1.992 +        rcr         eax,1
   1.993 +        or          ecx,ecx
   1.994 +        jne         L3
   1.995 +        div         ebx
   1.996 +        mov         esi,eax
   1.997 +        mul         dword ptr [esp+14h]
   1.998 +        mov         ecx,eax
   1.999 +        mov         eax,dword ptr [esp+10h]
  1.1000 +        mul         esi
  1.1001 +        add         edx,ecx
  1.1002 +        jb          L4
  1.1003 +        cmp         edx,dword ptr [esp+0Ch]
  1.1004 +        ja          L4
  1.1005 +        jb          L5
  1.1006 +        cmp         eax,dword ptr [esp+8]
  1.1007 +        jbe         L5
  1.1008  L4:
  1.1009 -		dec         esi
  1.1010 -		sub         eax,dword ptr [esp+10h]
  1.1011 -		sbb         edx,dword ptr [esp+14h]
  1.1012 +        dec         esi
  1.1013 +        sub         eax,dword ptr [esp+10h]
  1.1014 +        sbb         edx,dword ptr [esp+14h]
  1.1015  L5:
  1.1016 -		xor         ebx,ebx
  1.1017 +        xor         ebx,ebx
  1.1018  L2:
  1.1019 -		sub         eax,dword ptr [esp+8]
  1.1020 -		sbb         edx,dword ptr [esp+0Ch]
  1.1021 -		neg         edx
  1.1022 -		neg         eax
  1.1023 -		sbb         edx,0
  1.1024 -		mov         ecx,edx
  1.1025 -		mov         edx,ebx
  1.1026 -		mov         ebx,ecx
  1.1027 -		mov         ecx,eax
  1.1028 -		mov         eax,esi
  1.1029 -		pop         esi
  1.1030 -		ret         10h
  1.1031 -	}
  1.1032 +        sub         eax,dword ptr [esp+8]
  1.1033 +        sbb         edx,dword ptr [esp+0Ch]
  1.1034 +        neg         edx
  1.1035 +        neg         eax
  1.1036 +        sbb         edx,0
  1.1037 +        mov         ecx,edx
  1.1038 +        mov         edx,ebx
  1.1039 +        mov         ebx,ecx
  1.1040 +        mov         ecx,eax
  1.1041 +        mov         eax,esi
  1.1042 +        pop         esi
  1.1043 +        ret         10h
  1.1044 +    }
  1.1045 +    /* *INDENT-ON* */
  1.1046  }
  1.1047 -void __declspec(naked) _allshl()
  1.1048 +void
  1.1049 +__declspec(naked)
  1.1050 +_allshl()
  1.1051  {
  1.1052 -	__asm {
  1.1053 -		cmp         cl,40h
  1.1054 -		jae         RETZERO
  1.1055 -		cmp         cl,20h
  1.1056 -		jae         MORE32
  1.1057 -		shld        edx,eax,cl
  1.1058 -		shl         eax,cl
  1.1059 -		ret
  1.1060 +    /* *INDENT-OFF* */
  1.1061 +    __asm {
  1.1062 +        cmp         cl,40h
  1.1063 +        jae         RETZERO
  1.1064 +        cmp         cl,20h
  1.1065 +        jae         MORE32
  1.1066 +        shld        edx,eax,cl
  1.1067 +        shl         eax,cl
  1.1068 +        ret
  1.1069  MORE32:
  1.1070 -		mov         edx,eax
  1.1071 -		xor         eax,eax
  1.1072 -		and         cl,1Fh
  1.1073 -		shl         edx,cl
  1.1074 -		ret
  1.1075 +        mov         edx,eax
  1.1076 +        xor         eax,eax
  1.1077 +        and         cl,1Fh
  1.1078 +        shl         edx,cl
  1.1079 +        ret
  1.1080  RETZERO:
  1.1081 -		xor         eax,eax
  1.1082 -		xor         edx,edx
  1.1083 -		ret
  1.1084 -	}
  1.1085 +        xor         eax,eax
  1.1086 +        xor         edx,edx
  1.1087 +        ret
  1.1088 +    }
  1.1089 +    /* *INDENT-ON* */
  1.1090  }
  1.1091 -void __declspec(naked) _aullshr()
  1.1092 +void
  1.1093 +__declspec(naked)
  1.1094 +_aullshr()
  1.1095  {
  1.1096 -	__asm {
  1.1097 -		cmp         cl,40h
  1.1098 -		jae         RETZERO
  1.1099 -		cmp         cl,20h
  1.1100 -		jae         MORE32
  1.1101 -		shrd        eax,edx,cl
  1.1102 -		shr         edx,cl
  1.1103 -		ret
  1.1104 +    /* *INDENT-OFF* */
  1.1105 +    __asm {
  1.1106 +        cmp         cl,40h
  1.1107 +        jae         RETZERO
  1.1108 +        cmp         cl,20h
  1.1109 +        jae         MORE32
  1.1110 +        shrd        eax,edx,cl
  1.1111 +        shr         edx,cl
  1.1112 +        ret
  1.1113  MORE32:
  1.1114 -		mov         eax,edx
  1.1115 -		xor         edx,edx
  1.1116 -		and         cl,1Fh
  1.1117 -		shr         eax,cl
  1.1118 -		ret
  1.1119 +        mov         eax,edx
  1.1120 +        xor         edx,edx
  1.1121 +        and         cl,1Fh
  1.1122 +        shr         eax,cl
  1.1123 +        ret
  1.1124  RETZERO:
  1.1125 -		xor         eax,eax
  1.1126 -		xor         edx,edx
  1.1127 -		ret
  1.1128 -	}
  1.1129 +        xor         eax,eax
  1.1130 +        xor         edx,edx
  1.1131 +        ret
  1.1132 +    }
  1.1133 +    /* *INDENT-ON* */
  1.1134  }
  1.1135  
  1.1136  #endif /* MSC_VER */
  1.1137  
  1.1138  #endif /* !HAVE_LIBC */
  1.1139 +
  1.1140 +/* vi: set ts=4 sw=4 expandtab: */