Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
975 B

  1. .XMM
  2. CODESEG
  3. ALIGN 4
  4. ifdef _NTSUBSET_
  5. ifdef _FUNC_DEF_EXTERN_
  6. extrn _FUNC_DEF_:proc
  7. endif
  8. PUBLIC _FUNC_
  9. _FUNC_ PROC NEAR
  10. jmp _FUNC_DEF_ ; jmp to old code
  11. _FUNC_ ENDP
  12. else
  13. extrn __use_sse2_mathfcns:dword
  14. ifdef _FUNC_DEF_EXTERN_
  15. extrn _FUNC_DEF_:proc
  16. endif
  17. ifdef _FUNC_P4_EXTERN_
  18. extrn _FUNC_P4_:proc
  19. endif
  20. PUBLIC _FUNC_
  21. _FUNC_ PROC NEAR
  22. cmp DWORD PTR __use_sse2_mathfcns, 0
  23. je _FUNC_DEF_ ; not P4 go to MS code
  24. sub esp, 8
  25. stmxcsr dword ptr [esp+4]
  26. mov eax, dword ptr [esp+4]
  27. and eax, 01f80h ;mscxr mask
  28. cmp eax, 01f80h
  29. jne short jnedef ;if unmasked, we vector off to the MS code
  30. ;check if any x87 FP exceptions are unmasked
  31. fnstcw word ptr [esp]
  32. mov ax, word ptr [esp]
  33. and ax, 07fh
  34. cmp ax, 07fh
  35. jnedef: lea esp, [esp+8] ;(release stack, preserve CC)
  36. jne _FUNC_DEF_ ;if unmasked, we vector off to the MS code
  37. jmp _FUNC_P4_ ; ok to go to Intel code
  38. _FUNC_ ENDP
  39. endif