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.
297 lines
7.9 KiB
297 lines
7.9 KiB
;-----------------------------------------------------------------------------
|
|
;
|
|
; This file contains x86 assembly attribute adders.
|
|
;
|
|
; Copyright (C) Microsoft Corporation, 1997.
|
|
;
|
|
; WARNING WARNING WARNING
|
|
; This assembly file generated from mas file.
|
|
; EDIT THE MAS FILE.
|
|
; I warned you.
|
|
; WARNING WARNING WARNING
|
|
;
|
|
;-----------------------------------------------------------------------------
|
|
|
|
include(`m4hdr.mh')dnl
|
|
include(`attrsx86.mh')dnl
|
|
.386p
|
|
.MODEL FLAT
|
|
|
|
INCLUDE offs_acp.inc
|
|
INCLUDE profile.inc
|
|
|
|
.CODE
|
|
dnl
|
|
dnl d_AddAttrs
|
|
dnl
|
|
dnl Macro to build attribute adders.
|
|
dnl
|
|
dnl $1 is one of Z_Diff, Z_Diff_Spec, Z_Diff_Tex, Z_Diff_Spec_Tex,
|
|
dnl Z_DIdx, Z_DIdx_Tex, Z_Tex.
|
|
dnl
|
|
define(`d_AddAttrs', `
|
|
@AddFloatAttrs_$1@12 PROC SYSCALL PUBLIC,
|
|
pStpCtx:DWORD
|
|
PROF_ENTRY
|
|
d_AddFloatAttrsBody(`$1')dnl
|
|
|
|
ret 4
|
|
@AddFloatAttrs_$1@12 ENDP
|
|
|
|
IFDEF STEP_FIXED
|
|
@AddFixedAttrs_$1@12 PROC SYSCALL PUBLIC,
|
|
pStpCtx:DWORD
|
|
PROF_ENTRY
|
|
d_AddFixedAttrsBody(`$1')dnl
|
|
|
|
ret 4
|
|
@AddFixedAttrs_$1@12 ENDP
|
|
ENDIF
|
|
')dnl
|
|
dnl
|
|
d_RepStr(`d_AddAttrs(AA)', `AA',
|
|
`Z_Diff', `Z_Diff_Spec',
|
|
`Z_Diff_Tex', `Z_Diff_Spec_Tex',
|
|
`Z_DIdx', `Z_DIdx_Tex', `Z_Tex')dnl
|
|
dnl
|
|
dnl d_AddScaledAttrs
|
|
dnl
|
|
dnl Macro to build attribute scaled adder.
|
|
dnl
|
|
dnl $1 is one of Z_Diff, Z_Diff_Spec, Z_Diff_Tex, Z_Diff_Spec_Tex,
|
|
dnl Z_DIdx, Z_DIdx_Tex, Z_Tex.
|
|
dnl
|
|
define(`d_AddScaledAttrs', `
|
|
@AddScaledFloatAttrs_$1@16 PROC SYSCALL PUBLIC USES ebx,
|
|
pStpCtx:DWORD, iScale:DWORD
|
|
|
|
LOCAL fScaleVal:DWORD
|
|
|
|
PROF_ENTRY
|
|
|
|
fild iScale
|
|
|
|
; Save edx around multiply.
|
|
mov ebx, edx
|
|
|
|
; Add surface pointers.
|
|
mov eax, [edx+ATTRSET_ipSurface]
|
|
imul eax, iScale
|
|
|
|
fstp fScaleVal
|
|
|
|
add eax, [ecx+ATTRSET_pSurface]
|
|
mov [ecx+ATTRSET_pSurface], eax
|
|
|
|
mov eax, [ebx+ATTRSET_ipZ]
|
|
imul eax, iScale
|
|
add eax, [ecx+ATTRSET_pZ]
|
|
mov [ecx+ATTRSET_pZ], eax
|
|
|
|
mov edx, ebx
|
|
ifelse(eval(d_index(`$1', `Pwl') >= 0), `1',
|
|
`
|
|
; Retrieve precomputed next values.
|
|
mov ebx, pStpCtx
|
|
mov eax, [ebx+SCTX_fNextOoW]
|
|
mov [ecx+ATTRSET_fOoW], eax
|
|
mov eax, [ebx+SCTX_fNextUoW1]
|
|
mov [ecx+ATTRSET_fUoW1], eax
|
|
mov eax, [ebx+SCTX_fNextVoW1]
|
|
mov [ecx+ATTRSET_fVoW1], eax
|
|
')dnl
|
|
|
|
; Do FP scaled additions.
|
|
ifelse(`$1', `Z_Diff',
|
|
`d_AddScaledAttrsCode(`ATTRSET_fZ', `ATTRSET_fB',
|
|
`ATTRSET_fG', `ATTRSET_fR',
|
|
`ATTRSET_fA')dnl
|
|
')dnl
|
|
ifelse(`$1', `Z_Diff_Spec',
|
|
`d_AddScaledAttrsCode(`ATTRSET_fZ', `ATTRSET_fB',
|
|
`ATTRSET_fG', `ATTRSET_fR')dnl
|
|
d_AddScaledAttrsCode(`ATTRSET_fA', `ATTRSET_fBS',
|
|
`ATTRSET_fGS', `ATTRSET_fRS')dnl
|
|
')dnl
|
|
ifelse(`$1', `Z_Diff_Tex',
|
|
`ifelse(eval(d_index(`$1', `Pwl') < 0), `1',
|
|
`d_AddScaledAttrsCode(`ATTRSET_fZ', `ATTRSET_fOoW')dnl
|
|
d_AddScaledUVowCode($1)
|
|
')dnl
|
|
d_AddScaledAttrsCode(`ATTRSET_fB', `ATTRSET_fG',
|
|
`ATTRSET_fR', `ATTRSET_fA')dnl
|
|
')dnl
|
|
ifelse(`$1', `Z_Diff_Spec_Tex',
|
|
`ifelse(eval(d_index(`$1', `Pwl') < 0), `1',
|
|
`d_AddScaledAttrsCode(`ATTRSET_fZ', `ATTRSET_fOoW',
|
|
`ATTRSET_fB', `ATTRSET_fG')dnl
|
|
d_AddScaledUVowCode($1)
|
|
d_AddScaledAttrsCode(`ATTRSET_fR', `ATTRSET_fA',
|
|
`ATTRSET_fBS', `ATTRSET_fGS',
|
|
`ATTRSET_fRS')dnl
|
|
',
|
|
`d_AddScaledAttrsCode(`ATTRSET_fZ', `ATTRSET_fB',
|
|
`ATTRSET_fG', `ATTRSET_fR')dnl
|
|
d_AddScaledAttrsCode(`ATTRSET_fA', `ATTRSET_fBS',
|
|
`ATTRSET_fGS', `ATTRSET_fRS')dnl
|
|
')dnl
|
|
')dnl
|
|
ifelse(`$1', `Z_DIdx',
|
|
`d_AddScaledAttrsCode(`ATTRSET_fZ', `ATTRSET_fDIdx',
|
|
`ATTRSET_fDIdxA')dnl
|
|
')dnl
|
|
ifelse(`$1', `Z_DIdx_Tex',
|
|
`ifelse(eval(d_index(`$1', `Pwl') < 0), `1',
|
|
`d_AddScaledAttrsCode(`ATTRSET_fZ', `ATTRSET_fOoW',
|
|
`ATTRSET_fDIdx', `ATTRSET_fDIdxA')dnl
|
|
d_AddScaledUVowCode($1)
|
|
',
|
|
`d_AddScaledAttrsCode(`ATTRSET_fZ',
|
|
`ATTRSET_fDIdx', `ATTRSET_fDIdxA')dnl
|
|
')dnl
|
|
')dnl
|
|
ifelse(`$1', `Z_Tex',
|
|
`ifelse(eval(d_index(`$1', `Pwl') < 0), `1',
|
|
`d_AddScaledAttrsCode(`ATTRSET_fZ', `ATTRSET_fOoW')dnl
|
|
d_AddScaledUVowCode($1)
|
|
',
|
|
`d_AddScaledAttrsCode(`ATTRSET_fZ')dnl
|
|
')dnl
|
|
')dnl
|
|
|
|
ret 8
|
|
dnl
|
|
ifelse(eval(d_index(`$1', `Pwl') < 0), `1',
|
|
`
|
|
; Avoid warning
|
|
mov eax, [pStpCtx]
|
|
')dnl
|
|
@AddScaledFloatAttrs_$1@16 ENDP
|
|
')dnl
|
|
dnl
|
|
d_RepStr(`d_AddScaledAttrs(AA)', `AA',
|
|
`Z_Diff', `Z_Diff_Spec',
|
|
`Z_Diff_Tex', `Z_Diff_Spec_Tex',
|
|
`Z_DIdx', `Z_DIdx_Tex', `Z_Tex')dnl
|
|
dnl
|
|
dnl d_FillSpanAttrs
|
|
dnl
|
|
dnl Macro to build attribute span store routines.
|
|
dnl
|
|
dnl $1 contains substrings Z, Diff, Spec, DIdx, Tex in any mix.
|
|
dnl
|
|
define(`d_FillSpanAttrs', `
|
|
@FillSpanFloatAttrs_$1@16 PROC SYSCALL PUBLIC,
|
|
pStpCtx:DWORD, cPix:DWORD
|
|
ifelse(eval(d_index(`$1', `Diff') >= 0 || d_index(`$1', `Spec') >= 0), `1',
|
|
`
|
|
LOCAL iVal:DWORD
|
|
')dnl
|
|
|
|
PROF_ENTRY
|
|
d_FillSpanFloatAttrsBody(`$1')dnl
|
|
|
|
ret 8
|
|
|
|
; Avoid warning
|
|
mov eax, pStpCtx
|
|
mov eax, cPix
|
|
@FillSpanFloatAttrs_$1@16 ENDP
|
|
|
|
IFDEF STEP_FIXED
|
|
@FillSpanFixedAttrs_$1@16 PROC SYSCALL PUBLIC,
|
|
pStpCtx:DWORD, cPix:DWORD
|
|
|
|
PROF_ENTRY
|
|
d_FillSpanFixedAttrsBody(`$1')dnl
|
|
|
|
ret 8
|
|
|
|
; Avoid warning
|
|
mov eax, pStpCtx
|
|
mov eax, cPix
|
|
@FillSpanFixedAttrs_$1@16 ENDP
|
|
ENDIF
|
|
')dnl
|
|
d_RepStr(`d_FillSpanAttrs(AA)', `AA',
|
|
`Z_Diff', `Z_Diff_Spec',
|
|
`Z_Diff_Tex', `Z_Diff_Spec_Tex',
|
|
`Z_DIdx', `Z_DIdx_Tex', `Z_Tex')dnl
|
|
dnl
|
|
dnl d_FloatAttrsToFixed
|
|
dnl
|
|
dnl Macro to build attribute converter routine.
|
|
dnl Attributes are converted in cache order.
|
|
dnl
|
|
dnl $1 contains substrings Z, Diff, Spec, Tex in any mix.
|
|
dnl
|
|
define(`d_FloatAttrsToFixed', `
|
|
IFDEF STEP_FIXED
|
|
@FloatAttrsToFixed_$1@12 PROC SYSCALL PUBLIC,
|
|
pStpCtx:DWORD
|
|
PROF_ENTRY
|
|
|
|
; Set surface pointers.
|
|
mov eax, [ecx+ATTRSET_pSurface]
|
|
mov [edx+ATTRSET_pSurface], eax
|
|
mov eax, [ecx+ATTRSET_pZ]
|
|
mov [edx+ATTRSET_pZ], eax
|
|
ifelse(eval(d_index(`$1', `Z') >= 0), `1',
|
|
`
|
|
fld DWORD PTR [ecx+ATTRSET_fZ]
|
|
fistp DWORD PTR [edx+ATTRSET_uZ]
|
|
')dnl
|
|
ifelse(eval(d_index(`$1', `Tex') >= 0), `1',
|
|
`
|
|
fld DWORD PTR [ecx+ATTRSET_fOoW]
|
|
fistp DWORD PTR [edx+ATTRSET_iOoW]
|
|
|
|
; Just in case ebx is used
|
|
push ebx
|
|
mov ebx, pStpCtx
|
|
mov ebx, [ebx + SCTX_pCtx]
|
|
xor eax, eax
|
|
Loop$1:
|
|
cmp eax, DWORD PTR[ebx + RCTX_cActTex]
|
|
je Done$1
|
|
|
|
fld DWORD PTR [ecx+ATTRSET_fUoW + 4 * eax]
|
|
fistp DWORD PTR [edx+ATTRSET_iUoW + 4 * eax]
|
|
fld DWORD PTR [ecx+ATTRSET_fVoW + 4 * eax]
|
|
fistp DWORD PTR [edx+ATTRSET_iVoW + 4 * eax]
|
|
inc eax
|
|
jmp Loop$1
|
|
Done$1:
|
|
pop ebx
|
|
')dnl
|
|
ifelse(eval(d_index(`$1', `Diff') >= 0), `1',
|
|
`
|
|
fld DWORD PTR [ecx+ATTRSET_fB]
|
|
fistp DWORD PTR [edx+ATTRSET_iB]
|
|
fld DWORD PTR [ecx+ATTRSET_fG]
|
|
fistp DWORD PTR [edx+ATTRSET_iG]
|
|
fld DWORD PTR [ecx+ATTRSET_fR]
|
|
fistp DWORD PTR [edx+ATTRSET_iR]
|
|
fld DWORD PTR [ecx+ATTRSET_fA]
|
|
fistp DWORD PTR [edx+ATTRSET_iA]
|
|
')dnl
|
|
ifelse(eval(d_index(`$1', `Spec') >= 0), `1',
|
|
`
|
|
fld DWORD PTR [ecx+ATTRSET_fBS]
|
|
fistp DWORD PTR [edx+ATTRSET_iBS]
|
|
fld DWORD PTR [ecx+ATTRSET_fGS]
|
|
fistp DWORD PTR [edx+ATTRSET_iGS]
|
|
fld DWORD PTR [ecx+ATTRSET_fRS]
|
|
fistp DWORD PTR [edx+ATTRSET_iRS]
|
|
')dnl
|
|
|
|
ret 4
|
|
@FloatAttrsToFixed_$1@12 ENDP
|
|
ENDIF
|
|
')dnl
|
|
d_RepStr(`d_FloatAttrsToFixed(AA)', `AA',
|
|
`Z_Diff', `Z_Diff_Spec',
|
|
`Z_Diff_Tex', `Z_Diff_Spec_Tex',
|
|
`Z_Tex')dnl
|
|
|
|
END
|