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.

55 lines
1.6 KiB

  1. /******************************Module*Header*******************************\
  2. * Module Name: srcalign.hxx
  3. *
  4. * This contains declrations that can be used to do source aligned reads. This
  5. * will improve performance when reading from non cached video memory resident
  6. * surfaces.
  7. *
  8. * Created: 04-May-1999
  9. * Author: Pravin Santiago pravins.
  10. *
  11. * Copyright (c) 1999 Microsoft Corporation
  12. *
  13. \**************************************************************************/
  14. #ifndef __SRCALIGN_HXX__
  15. #define __SRCALIGN_HXX__
  16. ///////////////////////////////////////////////////////////////////////////
  17. //
  18. // The idea behind using MMX instructions to do loads and stores is they
  19. // provide QuadWord (64 bit) access to memory. With regular instructions the
  20. // largest datum that can be loaded is a Dword (32 bits).
  21. //
  22. ///////////////////////////////////////////////////////////////////////////
  23. #if defined (_X86_)
  24. #define HasMMX gbMMXProcessor
  25. #pragma warning(disable:4799) // Disable no EMMS warning.
  26. #else
  27. #define HasMMX 0
  28. #endif
  29. void vSrcAlignCopyMemory(PBYTE pjDst, PBYTE pjSrc, ULONG c);
  30. #if defined(_AMD64_) || defined(_X86_)
  31. #define UNALIGNED_WORD_POINTER(p) ((WORD *)(p))
  32. #define UNALIGNED_DWORD_POINTER(p) ((ULONG *)(p))
  33. #define UNALIGNED_QWORD_POINTER(p) ((ULONGLONG *)(p))
  34. #elif defined(_IA64_)
  35. #define UNALIGNED_WORD_POINTER(p) ((WORD UNALIGNED *)(p))
  36. #define UNALIGNED_DWORD_POINTER(p) ((ULONG UNALIGNED *)(p))
  37. #define UNALIGNED_QWORD_POINTER(p) ((ULONGLONG UNALIGNED *)(p))
  38. #else
  39. //#error "No target Architecture"
  40. #endif
  41. #endif /* __SRCALIGN_HXX__ */