Default to build SDL without MSVCRT
authorSam Lantinga
Wed, 08 Feb 2006 08:55:33 +0000
changeset 13461b5fbaf1d2c6
parent 1345 7f32b9bede06
child 1347 905dc98a40fa
Default to build SDL without MSVCRT
VisualC.zip
include/SDL_types.h
src/stdlib/SDL_stdlib.c
     1.1 Binary file VisualC.zip has changed
     2.1 --- a/include/SDL_types.h	Tue Feb 07 18:36:54 2006 +0000
     2.2 +++ b/include/SDL_types.h	Wed Feb 08 08:55:33 2006 +0000
     2.3 @@ -27,8 +27,14 @@
     2.4  
     2.5  #include <sys/types.h>
     2.6  #ifdef _MSC_VER
     2.7 -/* FIXME!! */
     2.8 -typedef unsigned int size_t;
     2.9 +#ifndef _SIZE_T_DEFINED
    2.10 +#ifdef  _WIN64
    2.11 +typedef unsigned __int64    size_t;
    2.12 +#else
    2.13 +typedef _W64 unsigned int   size_t;
    2.14 +#endif
    2.15 +#define _SIZE_T_DEFINED
    2.16 +#endif
    2.17  typedef size_t uintptr_t;
    2.18  #endif
    2.19  
     3.1 --- a/src/stdlib/SDL_stdlib.c	Tue Feb 07 18:36:54 2006 +0000
     3.2 +++ b/src/stdlib/SDL_stdlib.c	Wed Feb 08 08:55:33 2006 +0000
     3.3 @@ -30,43 +30,581 @@
     3.4  
     3.5  #if defined(_MSC_VER)
     3.6  
     3.7 -/* Float to long (FIXME!) */
     3.8 -long _ftol()
     3.9 +/* Float to long */
    3.10 +void __declspec(naked) _ftol()
    3.11  {
    3.12 -	return 0;
    3.13 +	__asm {
    3.14 +		push        ebp
    3.15 +		mov         ebp,esp
    3.16 +		sub         esp,20h
    3.17 +		and         esp,0FFFFFFF0h
    3.18 +		fld         st(0)
    3.19 +		fst         dword ptr [esp+18h]
    3.20 +		fistp       qword ptr [esp+10h]
    3.21 +		fild        qword ptr [esp+10h]
    3.22 +		mov         edx,dword ptr [esp+18h]
    3.23 +		mov         eax,dword ptr [esp+10h]
    3.24 +		test        eax,eax
    3.25 +		je          integer_QnaN_or_zero
    3.26 +arg_is_not_integer_QnaN:
    3.27 +		fsubp       st(1),st
    3.28 +		test        edx,edx
    3.29 +		jns         positive
    3.30 +		fstp        dword ptr [esp]
    3.31 +		mov         ecx,dword ptr [esp]
    3.32 +		xor         ecx,80000000h
    3.33 +		add         ecx,7FFFFFFFh
    3.34 +		adc         eax,0
    3.35 +		mov         edx,dword ptr [esp+14h]
    3.36 +		adc         edx,0
    3.37 +		jmp         localexit
    3.38 +positive:
    3.39 +		fstp        dword ptr [esp]
    3.40 +		mov         ecx,dword ptr [esp]
    3.41 +		add         ecx,7FFFFFFFh
    3.42 +		sbb         eax,0
    3.43 +		mov         edx,dword ptr [esp+14h]
    3.44 +		sbb         edx,0
    3.45 +		jmp         localexit
    3.46 +integer_QnaN_or_zero:
    3.47 +		mov         edx,dword ptr [esp+14h]
    3.48 +		test        edx,7FFFFFFFh
    3.49 +		jne         arg_is_not_integer_QnaN
    3.50 +		fstp        dword ptr [esp+18h]
    3.51 +		fstp        dword ptr [esp+18h]
    3.52 +localexit:
    3.53 +		leave
    3.54 +		ret
    3.55 +	}
    3.56  }
    3.57 -long _ftol2_sse()
    3.58 +void __declspec(naked) _ftol2_sse()
    3.59  {
    3.60 -	return 0;
    3.61 +	_ftol();
    3.62  }
    3.63  
    3.64 -/* 64-bit math operators (FIXME!) */
    3.65 -void _allmul()
    3.66 +/* 64-bit math operators for 32-bit systems */
    3.67 +void __declspec(naked) _allmul()
    3.68 +{
    3.69 +	__asm {
    3.70 +		push        ebp
    3.71 +		mov         ebp,esp
    3.72 +		push        edi
    3.73 +		push        esi
    3.74 +		push        ebx
    3.75 +		sub         esp,0Ch
    3.76 +		mov         eax,dword ptr [ebp+10h]
    3.77 +		mov         edi,dword ptr [ebp+8]
    3.78 +		mov         ebx,eax
    3.79 +		mov         esi,eax
    3.80 +		sar         esi,1Fh
    3.81 +		mov         eax,dword ptr [ebp+8]
    3.82 +		mul         ebx
    3.83 +		imul        edi,esi
    3.84 +		mov         ecx,edx
    3.85 +		mov         dword ptr [ebp-18h],eax
    3.86 +		mov         edx,dword ptr [ebp+0Ch]
    3.87 +		add         ecx,edi
    3.88 +		imul        ebx,edx
    3.89 +		mov         eax,dword ptr [ebp-18h]
    3.90 +		lea         ebx,[ebx+ecx]
    3.91 +		mov         dword ptr [ebp-14h],ebx
    3.92 +		mov         edx,dword ptr [ebp-14h]
    3.93 +		add         esp,0Ch
    3.94 +		pop         ebx
    3.95 +		pop         esi
    3.96 +		pop         edi
    3.97 +		pop         ebp
    3.98 +		ret
    3.99 +	}
   3.100 +}
   3.101 +void __declspec(naked) _alldiv()
   3.102  {
   3.103 +	__asm {
   3.104 +		push        edi
   3.105 +		push        esi
   3.106 +		push        ebx
   3.107 +		xor         edi,edi
   3.108 +		mov         eax,dword ptr [esp+14h]
   3.109 +		or          eax,eax
   3.110 +		jge         L1
   3.111 +		inc         edi
   3.112 +		mov         edx,dword ptr [esp+10h]
   3.113 +		neg         eax
   3.114 +		neg         edx
   3.115 +		sbb         eax,0
   3.116 +		mov         dword ptr [esp+14h],eax
   3.117 +		mov         dword ptr [esp+10h],edx
   3.118 +L1:
   3.119 +		mov         eax,dword ptr [esp+1Ch]
   3.120 +		or          eax,eax
   3.121 +		jge         L2
   3.122 +		inc         edi
   3.123 +		mov         edx,dword ptr [esp+18h]
   3.124 +		neg         eax
   3.125 +		neg         edx
   3.126 +		sbb         eax,0
   3.127 +		mov         dword ptr [esp+1Ch],eax
   3.128 +		mov         dword ptr [esp+18h],edx
   3.129 +L2:
   3.130 +		or          eax,eax
   3.131 +		jne         L3
   3.132 +		mov         ecx,dword ptr [esp+18h]
   3.133 +		mov         eax,dword ptr [esp+14h]
   3.134 +		xor         edx,edx
   3.135 +		div         ecx
   3.136 +		mov         ebx,eax
   3.137 +		mov         eax,dword ptr [esp+10h]
   3.138 +		div         ecx
   3.139 +		mov         edx,ebx
   3.140 +		jmp         L4
   3.141 +L3:
   3.142 +		mov         ebx,eax
   3.143 +		mov         ecx,dword ptr [esp+18h]
   3.144 +		mov         edx,dword ptr [esp+14h]
   3.145 +		mov         eax,dword ptr [esp+10h]
   3.146 +L5:
   3.147 +		shr         ebx,1
   3.148 +		rcr         ecx,1
   3.149 +		shr         edx,1
   3.150 +		rcr         eax,1
   3.151 +		or          ebx,ebx
   3.152 +		jne         L5
   3.153 +		div         ecx
   3.154 +		mov         esi,eax
   3.155 +		mul         dword ptr [esp+1Ch]
   3.156 +		mov         ecx,eax
   3.157 +		mov         eax,dword ptr [esp+18h]
   3.158 +		mul         esi
   3.159 +		add         edx,ecx
   3.160 +		jb          L6
   3.161 +		cmp         edx,dword ptr [esp+14h]
   3.162 +		ja          L6
   3.163 +		jb          L7
   3.164 +		cmp         eax,dword ptr [esp+10h]
   3.165 +		jbe         L7
   3.166 +L6:
   3.167 +		dec         esi
   3.168 +L7:
   3.169 +		xor         edx,edx
   3.170 +		mov         eax,esi
   3.171 +L4:
   3.172 +		dec         edi
   3.173 +		jne         L8
   3.174 +		neg         edx
   3.175 +		neg         eax
   3.176 +		sbb         edx,0
   3.177 +L8:
   3.178 +		pop         ebx
   3.179 +		pop         esi
   3.180 +		pop         edi
   3.181 +		ret         10h
   3.182 +	}
   3.183  }
   3.184 -void _alldiv()
   3.185 +void __declspec(naked) _aulldiv()
   3.186  {
   3.187 +	__asm {
   3.188 +		push        ebx
   3.189 +		push        esi
   3.190 +		mov         eax,dword ptr [esp+18h]
   3.191 +		or          eax,eax
   3.192 +		jne         L1
   3.193 +		mov         ecx,dword ptr [esp+14h]
   3.194 +		mov         eax,dword ptr [esp+10h]
   3.195 +		xor         edx,edx
   3.196 +		div         ecx
   3.197 +		mov         ebx,eax
   3.198 +		mov         eax,dword ptr [esp+0Ch]
   3.199 +		div         ecx
   3.200 +		mov         edx,ebx
   3.201 +		jmp         L2
   3.202 +L1:
   3.203 +		mov         ecx,eax
   3.204 +		mov         ebx,dword ptr [esp+14h]
   3.205 +		mov         edx,dword ptr [esp+10h]
   3.206 +		mov         eax,dword ptr [esp+0Ch]
   3.207 +L3:
   3.208 +		shr         ecx,1
   3.209 +		rcr         ebx,1
   3.210 +		shr         edx,1
   3.211 +		rcr         eax,1
   3.212 +		or          ecx,ecx
   3.213 +		jne         L3
   3.214 +		div         ebx
   3.215 +		mov         esi,eax
   3.216 +		mul         dword ptr [esp+18h]
   3.217 +		mov         ecx,eax
   3.218 +		mov         eax,dword ptr [esp+14h]
   3.219 +		mul         esi
   3.220 +		add         edx,ecx
   3.221 +		jb          L4
   3.222 +		cmp         edx,dword ptr [esp+10h]
   3.223 +		ja          L4
   3.224 +		jb          L5
   3.225 +		cmp         eax,dword ptr [esp+0Ch]
   3.226 +		jbe         L5
   3.227 +L4:
   3.228 +		dec         esi
   3.229 +L5:
   3.230 +		xor         edx,edx
   3.231 +		mov         eax,esi
   3.232 +L2:
   3.233 +		pop         esi
   3.234 +		pop         ebx
   3.235 +		ret         10h
   3.236 +	}
   3.237  }
   3.238 -void _aulldiv()
   3.239 +void __declspec(naked) _allrem()
   3.240  {
   3.241 -}
   3.242 -void _allrem()
   3.243 -{
   3.244 +	__asm {
   3.245 +		push        ebx
   3.246 +		push        edi
   3.247 +		xor         edi,edi
   3.248 +		mov         eax,dword ptr [esp+10h]
   3.249 +		or          eax,eax
   3.250 +		jge         L1
   3.251 +		inc         edi
   3.252 +		mov         edx,dword ptr [esp+0Ch]
   3.253 +		neg         eax
   3.254 +		neg         edx
   3.255 +		sbb         eax,0
   3.256 +		mov         dword ptr [esp+10h],eax
   3.257 +		mov         dword ptr [esp+0Ch],edx
   3.258 +L1:
   3.259 +		mov         eax,dword ptr [esp+18h]
   3.260 +		or          eax,eax
   3.261 +		jge         L2
   3.262 +		mov         edx,dword ptr [esp+14h]
   3.263 +		neg         eax
   3.264 +		neg         edx
   3.265 +		sbb         eax,0
   3.266 +		mov         dword ptr [esp+18h],eax
   3.267 +		mov         dword ptr [esp+14h],edx
   3.268 +L2:
   3.269 +		or          eax,eax
   3.270 +		jne         L3
   3.271 +		mov         ecx,dword ptr [esp+14h]
   3.272 +		mov         eax,dword ptr [esp+10h]
   3.273 +		xor         edx,edx
   3.274 +		div         ecx
   3.275 +		mov         eax,dword ptr [esp+0Ch]
   3.276 +		div         ecx
   3.277 +		mov         eax,edx
   3.278 +		xor         edx,edx
   3.279 +		dec         edi
   3.280 +		jns         L4
   3.281 +		jmp         L8
   3.282 +L3:
   3.283 +		mov         ebx,eax
   3.284 +		mov         ecx,dword ptr [esp+14h]
   3.285 +		mov         edx,dword ptr [esp+10h]
   3.286 +		mov         eax,dword ptr [esp+0Ch]
   3.287 +L5:
   3.288 +		shr         ebx,1
   3.289 +		rcr         ecx,1
   3.290 +		shr         edx,1
   3.291 +		rcr         eax,1
   3.292 +		or          ebx,ebx
   3.293 +		jne         L5
   3.294 +		div         ecx
   3.295 +		mov         ecx,eax
   3.296 +		mul         dword ptr [esp+18h]
   3.297 +		xchg        eax,ecx
   3.298 +		mul         dword ptr [esp+14h]
   3.299 +		add         edx,ecx
   3.300 +		jb          L6
   3.301 +		cmp         edx,dword ptr [esp+10h]
   3.302 +		ja          L6
   3.303 +		jb          L7
   3.304 +		cmp         eax,dword ptr [esp+0Ch]
   3.305 +		jbe         L7
   3.306 +L6:
   3.307 +		sub         eax,dword ptr [esp+14h]
   3.308 +		sbb         edx,dword ptr [esp+18h]
   3.309 +L7:
   3.310 +		sub         eax,dword ptr [esp+0Ch]
   3.311 +		sbb         edx,dword ptr [esp+10h]
   3.312 +		dec         edi
   3.313 +		jns         L8
   3.314 +L4:
   3.315 +		neg         edx
   3.316 +		neg         eax
   3.317 +		sbb         edx,0
   3.318 +L8:
   3.319 +		pop         edi
   3.320 +		pop         ebx
   3.321 +		ret         10h
   3.322 +	}
   3.323  }
   3.324 -void _aullrem()
   3.325 +void __declspec(naked) _aullrem()
   3.326  {
   3.327 -}
   3.328 -void _alldvrm()
   3.329 -{
   3.330 +	__asm {
   3.331 +		push        ebx
   3.332 +		mov         eax,dword ptr [esp+14h]
   3.333 +		or          eax,eax
   3.334 +		jne         L1
   3.335 +		mov         ecx,dword ptr [esp+10h]
   3.336 +		mov         eax,dword ptr [esp+0Ch]
   3.337 +		xor         edx,edx
   3.338 +		div         ecx
   3.339 +		mov         eax,dword ptr [esp+8]
   3.340 +		div         ecx
   3.341 +		mov         eax,edx
   3.342 +		xor         edx,edx
   3.343 +		jmp         L2
   3.344 +L1:
   3.345 +		mov         ecx,eax
   3.346 +		mov         ebx,dword ptr [esp+10h]
   3.347 +		mov         edx,dword ptr [esp+0Ch]
   3.348 +		mov         eax,dword ptr [esp+8]
   3.349 +L3:
   3.350 +		shr         ecx,1
   3.351 +		rcr         ebx,1
   3.352 +		shr         edx,1
   3.353 +		rcr         eax,1
   3.354 +		or          ecx,ecx
   3.355 +		jne         L3
   3.356 +		div         ebx
   3.357 +		mov         ecx,eax
   3.358 +		mul         dword ptr [esp+14h]
   3.359 +		xchg        eax,ecx
   3.360 +		mul         dword ptr [esp+10h]
   3.361 +		add         edx,ecx
   3.362 +		jb          L4
   3.363 +		cmp         edx,dword ptr [esp+0Ch]
   3.364 +		ja          L4
   3.365 +		jb          L5
   3.366 +		cmp         eax,dword ptr [esp+8]
   3.367 +		jbe         L5
   3.368 +L4:
   3.369 +		sub         eax,dword ptr [esp+10h]
   3.370 +		sbb         edx,dword ptr [esp+14h]
   3.371 +L5:
   3.372 +		sub         eax,dword ptr [esp+8]
   3.373 +		sbb         edx,dword ptr [esp+0Ch]
   3.374 +		neg         edx
   3.375 +		neg         eax
   3.376 +		sbb         edx,0
   3.377 +L2:
   3.378 +		pop         ebx
   3.379 +		ret         10h
   3.380 +	}
   3.381  }
   3.382 -void _aulldvrm()
   3.383 +void __declspec(naked) _alldvrm()
   3.384  {
   3.385 +	__asm {
   3.386 +		push        edi
   3.387 +		push        esi
   3.388 +		push        ebp
   3.389 +		xor         edi,edi
   3.390 +		xor         ebp,ebp
   3.391 +		mov         eax,dword ptr [esp+14h]
   3.392 +		or          eax,eax
   3.393 +		jge         L1
   3.394 +		inc         edi
   3.395 +		inc         ebp
   3.396 +		mov         edx,dword ptr [esp+10h]
   3.397 +		neg         eax
   3.398 +		neg         edx
   3.399 +		sbb         eax,0
   3.400 +		mov         dword ptr [esp+14h],eax
   3.401 +		mov         dword ptr [esp+10h],edx
   3.402 +L1:
   3.403 +		mov         eax,dword ptr [esp+1Ch]
   3.404 +		or          eax,eax
   3.405 +		jge         L2
   3.406 +		inc         edi
   3.407 +		mov         edx,dword ptr [esp+18h]
   3.408 +		neg         eax
   3.409 +		neg         edx
   3.410 +		sbb         eax,0
   3.411 +		mov         dword ptr [esp+1Ch],eax
   3.412 +		mov         dword ptr [esp+18h],edx
   3.413 +L2:
   3.414 +		or          eax,eax
   3.415 +		jne         L3
   3.416 +		mov         ecx,dword ptr [esp+18h]
   3.417 +		mov         eax,dword ptr [esp+14h]
   3.418 +		xor         edx,edx
   3.419 +		div         ecx
   3.420 +		mov         ebx,eax
   3.421 +		mov         eax,dword ptr [esp+10h]
   3.422 +		div         ecx
   3.423 +		mov         esi,eax
   3.424 +		mov         eax,ebx
   3.425 +		mul         dword ptr [esp+18h]
   3.426 +		mov         ecx,eax
   3.427 +		mov         eax,esi
   3.428 +		mul         dword ptr [esp+18h]
   3.429 +		add         edx,ecx
   3.430 +		jmp         L4
   3.431 +L3:
   3.432 +		mov         ebx,eax
   3.433 +		mov         ecx,dword ptr [esp+18h]
   3.434 +		mov         edx,dword ptr [esp+14h]
   3.435 +		mov         eax,dword ptr [esp+10h]
   3.436 +L5:
   3.437 +		shr         ebx,1
   3.438 +		rcr         ecx,1
   3.439 +		shr         edx,1
   3.440 +		rcr         eax,1
   3.441 +		or          ebx,ebx
   3.442 +		jne         L5
   3.443 +		div         ecx
   3.444 +		mov         esi,eax
   3.445 +		mul         dword ptr [esp+1Ch]
   3.446 +		mov         ecx,eax
   3.447 +		mov         eax,dword ptr [esp+18h]
   3.448 +		mul         esi
   3.449 +		add         edx,ecx
   3.450 +		jb          L6
   3.451 +		cmp         edx,dword ptr [esp+14h]
   3.452 +		ja          L6
   3.453 +		jb          L7
   3.454 +		cmp         eax,dword ptr [esp+10h]
   3.455 +		jbe         L7
   3.456 +L6:
   3.457 +		dec         esi
   3.458 +		sub         eax,dword ptr [esp+18h]
   3.459 +		sbb         edx,dword ptr [esp+1Ch]
   3.460 +L7:
   3.461 +		xor         ebx,ebx
   3.462 +L4:
   3.463 +		sub         eax,dword ptr [esp+10h]
   3.464 +		sbb         edx,dword ptr [esp+14h]
   3.465 +		dec         ebp
   3.466 +		jns         L9
   3.467 +		neg         edx
   3.468 +		neg         eax
   3.469 +		sbb         edx,0
   3.470 +L9:
   3.471 +		mov         ecx,edx
   3.472 +		mov         edx,ebx
   3.473 +		mov         ebx,ecx
   3.474 +		mov         ecx,eax
   3.475 +		mov         eax,esi
   3.476 +		dec         edi
   3.477 +		jne         L8
   3.478 +		neg         edx
   3.479 +		neg         eax
   3.480 +		sbb         edx,0
   3.481 +L8:
   3.482 +		pop         ebp
   3.483 +		pop         esi
   3.484 +		pop         edi
   3.485 +		ret         10h
   3.486 +	}
   3.487  }
   3.488 -void _allshl()
   3.489 +void __declspec(naked) _aulldvrm()
   3.490  {
   3.491 +	__asm {
   3.492 +		push        esi
   3.493 +		mov         eax,dword ptr [esp+14h]
   3.494 +		or          eax,eax
   3.495 +		jne         L1
   3.496 +		mov         ecx,dword ptr [esp+10h]
   3.497 +		mov         eax,dword ptr [esp+0Ch]
   3.498 +		xor         edx,edx
   3.499 +		div         ecx
   3.500 +		mov         ebx,eax
   3.501 +		mov         eax,dword ptr [esp+8]
   3.502 +		div         ecx
   3.503 +		mov         esi,eax
   3.504 +		mov         eax,ebx
   3.505 +		mul         dword ptr [esp+10h]
   3.506 +		mov         ecx,eax
   3.507 +		mov         eax,esi
   3.508 +		mul         dword ptr [esp+10h]
   3.509 +		add         edx,ecx
   3.510 +		jmp         L2
   3.511 +L1:
   3.512 +		mov         ecx,eax
   3.513 +		mov         ebx,dword ptr [esp+10h]
   3.514 +		mov         edx,dword ptr [esp+0Ch]
   3.515 +		mov         eax,dword ptr [esp+8]
   3.516 +L3:
   3.517 +		shr         ecx,1
   3.518 +		rcr         ebx,1
   3.519 +		shr         edx,1
   3.520 +		rcr         eax,1
   3.521 +		or          ecx,ecx
   3.522 +		jne         L3
   3.523 +		div         ebx
   3.524 +		mov         esi,eax
   3.525 +		mul         dword ptr [esp+14h]
   3.526 +		mov         ecx,eax
   3.527 +		mov         eax,dword ptr [esp+10h]
   3.528 +		mul         esi
   3.529 +		add         edx,ecx
   3.530 +		jb          L4
   3.531 +		cmp         edx,dword ptr [esp+0Ch]
   3.532 +		ja          L4
   3.533 +		jb          L5
   3.534 +		cmp         eax,dword ptr [esp+8]
   3.535 +		jbe         L5
   3.536 +L4:
   3.537 +		dec         esi
   3.538 +		sub         eax,dword ptr [esp+10h]
   3.539 +		sbb         edx,dword ptr [esp+14h]
   3.540 +L5:
   3.541 +		xor         ebx,ebx
   3.542 +L2:
   3.543 +		sub         eax,dword ptr [esp+8]
   3.544 +		sbb         edx,dword ptr [esp+0Ch]
   3.545 +		neg         edx
   3.546 +		neg         eax
   3.547 +		sbb         edx,0
   3.548 +		mov         ecx,edx
   3.549 +		mov         edx,ebx
   3.550 +		mov         ebx,ecx
   3.551 +		mov         ecx,eax
   3.552 +		mov         eax,esi
   3.553 +		pop         esi
   3.554 +		ret         10h
   3.555 +	}
   3.556  }
   3.557 -void _aullshr()
   3.558 +void __declspec(naked) _allshl()
   3.559  {
   3.560 +	__asm {
   3.561 +		cmp         cl,40h
   3.562 +		jae         RETZERO
   3.563 +		cmp         cl,20h
   3.564 +		jae         MORE32
   3.565 +		shld        edx,eax,cl
   3.566 +		shl         eax,cl
   3.567 +		ret
   3.568 +MORE32:
   3.569 +		mov         edx,eax
   3.570 +		xor         eax,eax
   3.571 +		and         cl,1Fh
   3.572 +		shl         edx,cl
   3.573 +		ret
   3.574 +RETZERO:
   3.575 +		xor         eax,eax
   3.576 +		xor         edx,edx
   3.577 +		ret
   3.578 +	}
   3.579 +}
   3.580 +void __declspec(naked) _aullshr()
   3.581 +{
   3.582 +	__asm {
   3.583 +		cmp         cl,40h
   3.584 +		jae         RETZERO
   3.585 +		cmp         cl,20h
   3.586 +		jae         MORE32
   3.587 +		shrd        eax,edx,cl
   3.588 +		shr         edx,cl
   3.589 +		ret
   3.590 +MORE32:
   3.591 +		mov         eax,edx
   3.592 +		xor         edx,edx
   3.593 +		and         cl,1Fh
   3.594 +		shr         eax,cl
   3.595 +		ret
   3.596 +RETZERO:
   3.597 +		xor         eax,eax
   3.598 +		xor         edx,edx
   3.599 +		ret
   3.600 +	}
   3.601  }
   3.602  
   3.603  #endif /* MSC_VER */