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.

87 lines
4.0 KiB

  1. Status of general MMX span routines.
  2. 09/08/97 Checked in MMX code.
  3. There is no way that the current code will compile and run. I haven't
  4. even tried to compile it. This is primarily to have it backed up and
  5. to let anyone that is interested see what has been done.
  6. The orginal C (or MCP) code are comments of these ASM or MAS files.
  7. The ACP directory contains a program that generates the .INC file
  8. for offsets to all the data. This program was used by Drew and
  9. seems to work better than H2INC. We should probably only have one
  10. of these that would go in the inc directory, but it's not done that
  11. way now (Plus, my code doesn't generate it based on a makefile.
  12. Three regular registers have been set aside for use to access the data.
  13. Since these are passed to every routine, I don't have to pass anything
  14. on the stack as long as I don't modify them. I have modified them a
  15. couple of times before I added this and they need to be changed to esi,
  16. edi, ebp or eax (eax is usually used for the next indirect jump).
  17. ebx is a pointer to the D3DI_SPANITER data (Also Accesses the SI stuff
  18. inside it).
  19. ecx is a pointer to the D3DI_RASTPRIM data.
  20. edx is a pointer to tge D3DI_RASTSPAN data.
  21. There are a few very useful m4 macros to acess this data in
  22. readable way (It also made converting C code easier):
  23. define(`XpCtxSI',`[ebx+D3DI_SPANITER_$1]')dnl
  24. define(`XpCtx',`[ebx+D3DI_RASTCTX_$1]')dnl
  25. define(`XpP', `[ecx+D3DI_RASTPRIM_$1]')dnl
  26. define(`XpS', `[edx+D3DI_RASTSPAN_$1]')dnl
  27. Things that need to be done.
  28. 1) New Special W divide. MMX newton's method code has already
  29. been written, but it was very specialized (I negated the
  30. OoW and OoWDX so that 2 - Oow*iW could be done with a pmadd
  31. and a few other things.) Code shouldn't have to change much.
  32. 2) Assembly equivalents to the ACMP, ZCMP macros. A version of
  33. these has also been written, but most compares were done in
  34. a reverse order (to preserve registers). The MMX Alpha and
  35. Z setup will most likely have to be different. This means
  36. that the atest.asm has not been coded. A test.mas file is
  37. written, and is missing ZCMP16 and ZCMP32. The other 4
  38. specific code cases are done exactly like the C version
  39. except the iXorMask always seems to be inverted do to how
  40. the comparison is done.
  41. 3) BufWrite is not implemented. The code for doing this has
  42. been done in APP notes. The 16 bit cases use a pmaddw
  43. to combine the colors more quickly than shifting. There
  44. is also work beening done on a quick dithering routine.
  45. The MMX dithering routine will use a pcmpgtw to compare
  46. with the dither table and the do a psubssw since if the
  47. color value is to be incremented, then the mask will be
  48. all ones (= -1). Subtracting it will increment the color.
  49. The saturation is used to not increase too much. The
  50. only problem to this is that the color is unsigned so
  51. it has to be shifted down by one to saturate to 7fff.
  52. 4) BuffRead is not done. It uses almost identical routines
  53. as those in texread.
  54. 5) Lots of clean up and 64 bit constants that need to be in
  55. memory. I have to figure out what registers get passed
  56. to routines that are called and what is passed back.
  57. In some cases, it may be possible to pass data from one
  58. bead to the next using registers. This maybe difficult
  59. though.
  60. 6) ColorBld conversion. Mostly ROP stuff and calling of
  61. bldfuncs.asm. ROP stuff should be pretty easy.
  62. 7) Since function names are the same, if I made a header
  63. file declaring them extern "C" { }, the assembly code
  64. could concievably execute in place of the current c code.
  65. This is where the true bomb test is.
  66. 8) There's probably more, but there is always more.