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.

301 lines
8.3 KiB

  1. ;-----------------------------------------------------------------------------
  2. ;
  3. ; This file contains x86 assembly attribute adders.
  4. ;
  5. ; Copyright (C) Microsoft Corporation, 1997.
  6. ;
  7. ; WARNING WARNING WARNING
  8. ; This assembly file generated from mas file.
  9. ; EDIT THE MAS FILE.
  10. ; I warned you.
  11. ; WARNING WARNING WARNING
  12. ;
  13. ;-----------------------------------------------------------------------------
  14. include(`m4hdr.mh')dnl
  15. include(`attrsx86.mh')dnl
  16. .386p
  17. .MODEL FLAT
  18. INCLUDE offs_acp.inc
  19. INCLUDE profile.inc
  20. .CODE
  21. dnl
  22. dnl d_AddAttrs
  23. dnl
  24. dnl Macro to build attribute adders.
  25. dnl
  26. dnl $1 is one of Z_Diff, Z_Diff_Spec, Z_Diff_Tex1, Z_Diff_Spec_Tex1,
  27. dnl Z_Tex1_Tex2, Z_DIdx, Z_DIdx_Tex1, Z_Tex1.
  28. dnl
  29. define(`d_AddAttrs', `
  30. @AddFloatAttrs_$1@12 PROC SYSCALL PUBLIC
  31. PROF_ENTRY
  32. d_AddFloatAttrsBody(`$1')dnl
  33. ret 4
  34. @AddFloatAttrs_$1@12 ENDP
  35. IFDEF STEP_FIXED
  36. @AddFixedAttrs_$1@12 PROC SYSCALL PUBLIC
  37. PROF_ENTRY
  38. d_AddFixedAttrsBody(`$1')dnl
  39. ret 4
  40. @AddFixedAttrs_$1@12 ENDP
  41. ENDIF
  42. ')dnl
  43. dnl
  44. d_RepStr(`d_AddAttrs(AA)', `AA',
  45. `Z_Diff', `Z_Diff_Spec',
  46. `Z_Diff_Tex1', `Z_Diff_Spec_Tex1',
  47. `Z_Tex1_Tex2',
  48. `Z_DIdx', `Z_DIdx_Tex1', `Z_Tex1')dnl
  49. dnl
  50. dnl d_AddScaledAttrs
  51. dnl
  52. dnl Macro to build attribute scaled adder.
  53. dnl
  54. dnl $1 is one of Z_Diff, Z_Diff_Spec, Z_Diff_Tex1, Z_Diff_Spec_Tex1,
  55. dnl Z_Tex1_Tex2, Z_DIdx, Z_DIdx_Tex1, Z_Tex1.
  56. dnl
  57. define(`d_AddScaledAttrs', `
  58. @AddScaledFloatAttrs_$1@16 PROC SYSCALL PUBLIC USES ebx,
  59. pStpCtx:DWORD, iScale:DWORD
  60. LOCAL fScaleVal:DWORD
  61. PROF_ENTRY
  62. fild iScale
  63. ; Save edx around multiply.
  64. mov ebx, edx
  65. ; Add surface pointers.
  66. mov eax, [edx+ATTRSET_ipSurface]
  67. imul eax, iScale
  68. fstp fScaleVal
  69. add eax, [ecx+ATTRSET_pSurface]
  70. mov [ecx+ATTRSET_pSurface], eax
  71. mov eax, [ebx+ATTRSET_ipZ]
  72. imul eax, iScale
  73. add eax, [ecx+ATTRSET_pZ]
  74. mov [ecx+ATTRSET_pZ], eax
  75. mov edx, ebx
  76. ifelse(eval(d_index(`$1', `Pwl') >= 0), `1',
  77. `
  78. ; Retrieve precomputed next values.
  79. mov ebx, pStpCtx
  80. mov eax, [ebx+SCTX_fNextOoW]
  81. mov [ecx+ATTRSET_fOoW], eax
  82. mov eax, [ebx+SCTX_fNextUoW1]
  83. mov [ecx+ATTRSET_fUoW1], eax
  84. mov eax, [ebx+SCTX_fNextVoW1]
  85. mov [ecx+ATTRSET_fVoW1], eax
  86. ')dnl
  87. ; Do FP scaled additions.
  88. ifelse(`$1', `Z_Diff',
  89. `d_AddScaledAttrsCode(`ATTRSET_fZ', `ATTRSET_fB',
  90. `ATTRSET_fG', `ATTRSET_fR',
  91. `ATTRSET_fA')dnl
  92. ')dnl
  93. ifelse(`$1', `Z_Diff_Spec',
  94. `d_AddScaledAttrsCode(`ATTRSET_fZ', `ATTRSET_fB',
  95. `ATTRSET_fG', `ATTRSET_fR')dnl
  96. d_AddScaledAttrsCode(`ATTRSET_fA', `ATTRSET_fBS',
  97. `ATTRSET_fGS', `ATTRSET_fRS')dnl
  98. ')dnl
  99. ifelse(`$1', `Z_Diff_Tex1',
  100. `ifelse(eval(d_index(`$1', `Pwl') < 0), `1',
  101. `d_AddScaledAttrsCode(`ATTRSET_fZ', `ATTRSET_fOoW',
  102. `ATTRSET_fUoW1', `ATTRSET_fVoW1')dnl
  103. ')dnl
  104. d_AddScaledAttrsCode(`ATTRSET_fB', `ATTRSET_fG',
  105. `ATTRSET_fR', `ATTRSET_fA')dnl
  106. ')dnl
  107. ifelse(`$1', `Z_Diff_Spec_Tex1',
  108. `ifelse(eval(d_index(`$1', `Pwl') < 0), `1',
  109. `d_AddScaledAttrsCode(`ATTRSET_fZ', `ATTRSET_fOoW',
  110. `ATTRSET_fUoW1', `ATTRSET_fVoW1',
  111. `ATTRSET_fB', `ATTRSET_fG')dnl
  112. d_AddScaledAttrsCode(`ATTRSET_fR', `ATTRSET_fA',
  113. `ATTRSET_fBS', `ATTRSET_fGS',
  114. `ATTRSET_fRS')dnl
  115. ',
  116. `d_AddScaledAttrsCode(`ATTRSET_fZ', `ATTRSET_fB',
  117. `ATTRSET_fG', `ATTRSET_fR')dnl
  118. d_AddScaledAttrsCode(`ATTRSET_fA', `ATTRSET_fBS',
  119. `ATTRSET_fGS', `ATTRSET_fRS')dnl
  120. ')dnl
  121. ')dnl
  122. ifelse(`$1', `Z_DIdx',
  123. `d_AddScaledAttrsCode(`ATTRSET_fZ', `ATTRSET_fDIdx',
  124. `ATTRSET_fDIdxA')dnl
  125. ')dnl
  126. ifelse(`$1', `Z_DIdx_Tex1',
  127. `ifelse(eval(d_index(`$1', `Pwl') < 0), `1',
  128. `d_AddScaledAttrsCode(`ATTRSET_fZ', `ATTRSET_fOoW',
  129. `ATTRSET_fUoW1', `ATTRSET_fVoW1',
  130. `ATTRSET_fDIdx', `ATTRSET_fDIdxA')dnl
  131. ',
  132. `d_AddScaledAttrsCode(`ATTRSET_fZ',
  133. `ATTRSET_fDIdx', `ATTRSET_fDIdxA')dnl
  134. ')dnl
  135. ')dnl
  136. ifelse(`$1', `Z_Tex1',
  137. `ifelse(eval(d_index(`$1', `Pwl') < 0), `1',
  138. `d_AddScaledAttrsCode(`ATTRSET_fZ', `ATTRSET_fOoW',
  139. `ATTRSET_fUoW1', `ATTRSET_fVoW1')dnl
  140. ',
  141. `d_AddScaledAttrsCode(`ATTRSET_fZ')dnl
  142. ')dnl
  143. ')dnl
  144. ifelse(`$1', `Z_Tex1_Tex2',
  145. `ifelse(eval(d_index(`$1', `Pwl') < 0), `1',
  146. `d_AddScaledAttrsCode(`ATTRSET_fZ', `ATTRSET_fOoW',
  147. `ATTRSET_fUoW1', `ATTRSET_fVoW1',
  148. `ATTRSET_fUoW2', `ATTRSET_fVoW2')dnl
  149. ',
  150. `d_AddScaledAttrsCode(`ATTRSET_fZ',
  151. `ATTRSET_fUoW2', `ATTRSET_fVoW2')dnl
  152. ')dnl
  153. ')dnl
  154. ret 8
  155. dnl
  156. ifelse(eval(d_index(`$1', `Pwl') < 0), `1',
  157. `
  158. ; Avoid warning
  159. mov eax, [pStpCtx]
  160. ')dnl
  161. @AddScaledFloatAttrs_$1@16 ENDP
  162. ')dnl
  163. dnl
  164. d_RepStr(`d_AddScaledAttrs(AA)', `AA',
  165. `Z_Diff', `Z_Diff_Spec',
  166. `Z_Diff_Tex1', `Z_Diff_Spec_Tex1',
  167. `Z_Tex1_Tex2',
  168. `Z_DIdx', `Z_DIdx_Tex1', `Z_Tex1')dnl
  169. dnl
  170. dnl d_FillSpanAttrs
  171. dnl
  172. dnl Macro to build attribute span store routines.
  173. dnl
  174. dnl $1 contains substrings Z, Diff, Spec, DIdx, Tex1 and Tex2 in any mix.
  175. dnl
  176. define(`d_FillSpanAttrs', `
  177. @FillSpanFloatAttrs_$1@16 PROC SYSCALL PUBLIC,
  178. pStpCtx:DWORD, cPix:DWORD
  179. ifelse(eval(d_index(`$1', `Diff') >= 0 || d_index(`$1', `Spec') >= 0), `1',
  180. `
  181. LOCAL iVal:DWORD
  182. ')dnl
  183. PROF_ENTRY
  184. d_FillSpanFloatAttrsBody(`$1')dnl
  185. ret 8
  186. ; Avoid warning
  187. mov eax, pStpCtx
  188. mov eax, cPix
  189. @FillSpanFloatAttrs_$1@16 ENDP
  190. IFDEF STEP_FIXED
  191. @FillSpanFixedAttrs_$1@16 PROC SYSCALL PUBLIC,
  192. pStpCtx:DWORD, cPix:DWORD
  193. PROF_ENTRY
  194. d_FillSpanFixedAttrsBody(`$1')dnl
  195. ret 8
  196. ; Avoid warning
  197. mov eax, pStpCtx
  198. mov eax, cPix
  199. @FillSpanFixedAttrs_$1@16 ENDP
  200. ENDIF
  201. ')dnl
  202. d_RepStr(`d_FillSpanAttrs(AA)', `AA',
  203. `Z_Diff', `Z_Diff_Spec',
  204. `Z_Diff_Tex1', `Z_Diff_Spec_Tex1',
  205. `Z_Tex1_Tex2',
  206. `Z_DIdx', `Z_DIdx_Tex1', `Z_Tex1')dnl
  207. dnl
  208. dnl d_FloatAttrsToFixed
  209. dnl
  210. dnl Macro to build attribute converter routine.
  211. dnl Attributes are converted in cache order.
  212. dnl
  213. dnl $1 contains substrings Z, Diff, Spec, Tex1 and Tex2 in any mix.
  214. dnl
  215. define(`d_FloatAttrsToFixed', `
  216. IFDEF STEP_FIXED
  217. @FloatAttrsToFixed_$1@12 PROC SYSCALL PUBLIC
  218. PROF_ENTRY
  219. ; Set surface pointers.
  220. mov eax, [ecx+ATTRSET_pSurface]
  221. mov [edx+ATTRSET_pSurface], eax
  222. mov eax, [ecx+ATTRSET_pZ]
  223. mov [edx+ATTRSET_pZ], eax
  224. ifelse(eval(d_index(`$1', `Z') >= 0), `1',
  225. `
  226. fld DWORD PTR [ecx+ATTRSET_fZ]
  227. fistp DWORD PTR [edx+ATTRSET_uZ]
  228. ')dnl
  229. ifelse(eval(d_index(`$1', `Tex') >= 0), `1',
  230. `
  231. fld DWORD PTR [ecx+ATTRSET_fOoW]
  232. fistp DWORD PTR [edx+ATTRSET_iOoW]
  233. fld DWORD PTR [ecx+ATTRSET_fUoW1]
  234. fistp DWORD PTR [edx+ATTRSET_iUoW1]
  235. fld DWORD PTR [ecx+ATTRSET_fVoW1]
  236. fistp DWORD PTR [edx+ATTRSET_iVoW1]
  237. ')dnl
  238. ifelse(eval(d_index(`$1', `Tex2') >= 0), `1',
  239. `
  240. fld DWORD PTR [ecx+ATTRSET_fUoW2]
  241. fistp DWORD PTR [edx+ATTRSET_iUoW2]
  242. fld DWORD PTR [ecx+ATTRSET_fVoW2]
  243. fistp DWORD PTR [edx+ATTRSET_iVoW2]
  244. ')dnl
  245. ifelse(eval(d_index(`$1', `Diff') >= 0), `1',
  246. `
  247. fld DWORD PTR [ecx+ATTRSET_fB]
  248. fistp DWORD PTR [edx+ATTRSET_iB]
  249. fld DWORD PTR [ecx+ATTRSET_fG]
  250. fistp DWORD PTR [edx+ATTRSET_iG]
  251. fld DWORD PTR [ecx+ATTRSET_fR]
  252. fistp DWORD PTR [edx+ATTRSET_iR]
  253. fld DWORD PTR [ecx+ATTRSET_fA]
  254. fistp DWORD PTR [edx+ATTRSET_iA]
  255. ')dnl
  256. ifelse(eval(d_index(`$1', `Spec') >= 0), `1',
  257. `
  258. fld DWORD PTR [ecx+ATTRSET_fBS]
  259. fistp DWORD PTR [edx+ATTRSET_iBS]
  260. fld DWORD PTR [ecx+ATTRSET_fGS]
  261. fistp DWORD PTR [edx+ATTRSET_iGS]
  262. fld DWORD PTR [ecx+ATTRSET_fRS]
  263. fistp DWORD PTR [edx+ATTRSET_iRS]
  264. ')dnl
  265. ret 4
  266. @FloatAttrsToFixed_$1@12 ENDP
  267. ENDIF
  268. ')dnl
  269. d_RepStr(`d_FloatAttrsToFixed(AA)', `AA',
  270. `Z_Diff', `Z_Diff_Spec',
  271. `Z_Diff_Tex1', `Z_Diff_Spec_Tex1',
  272. `Z_Tex1_Tex2')dnl
  273. END