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.
Shaswata Das
5c6fe3db62
|
4 years ago | |
---|---|---|
.. | ||
i386 | 4 years ago | |
atest.mas | 4 years ago | |
atest_mh.mh | 4 years ago | |
beadtbl.mcp | 4 years ago | |
bldfuncs.h | 4 years ago | |
bldfuncs.mas | 4 years ago | |
bufread.h | 4 years ago | |
bufread.mas | 4 years ago | |
bufwrite.h | 4 years ago | |
bufwrite.mas | 4 years ago | |
bufwrite.mh | 4 years ago | |
clrbd_mh.mh | 4 years ago | |
clrgn_mh.mh | 4 years ago | |
colorbld.mas | 4 years ago | |
colorgen.mas | 4 years ago | |
colorgen.mh | 4 years ago | |
cvars.mh | 4 years ago | |
i386src.inc | 4 years ago | |
iammx.inc | 4 years ago | |
loop.h | 4 years ago | |
makefile | 4 years ago | |
makefile.inc | 4 years ago | |
ml1.mas | 4 years ago | |
ml2.mas | 4 years ago | |
ml3.mas | 4 years ago | |
ml4.mas | 4 years ago | |
ml5.mas | 4 years ago | |
ml6.mas | 4 years ago | |
ml7.mas | 4 years ago | |
ml8.mas | 4 years ago | |
ml9.mas | 4 years ago | |
ml10.mas | 4 years ago | |
ml11.mas | 4 years ago | |
ml12.mas | 4 years ago | |
ml13.mas | 4 years ago | |
ml14.mas | 4 years ago | |
ml15.mas | 4 years ago | |
ml16.mas | 4 years ago | |
ml17.mas | 4 years ago | |
ml18.mas | 4 years ago | |
ml19.mas | 4 years ago | |
ml20.mas | 4 years ago | |
ml21.mas | 4 years ago | |
ml22.mas | 4 years ago | |
ml23.mas | 4 years ago | |
ml24.mas | 4 years ago | |
ml25.mas | 4 years ago | |
ml26.mas | 4 years ago | |
ml27.mas | 4 years ago | |
ml28.mas | 4 years ago | |
monolith.txt | 4 years ago | |
nommxsrc.inc | 4 years ago | |
offs_acp.acp | 4 years ago | |
readme.txt | 4 years ago | |
sources | 4 years ago | |
spanpars.h | 4 years ago | |
spanpars.mas | 4 years ago | |
spanutil.cpp | 4 years ago | |
spanutil.h | 4 years ago | |
stp_base.h | 4 years ago | |
test.mas | 4 years ago | |
test.mh | 4 years ago | |
test_mh.mh | 4 years ago | |
tex1a_mh.mh | 4 years ago | |
tex1addr.mas | 4 years ago | |
tex1addr.mh | 4 years ago | |
tex2a_mh.mh | 4 years ago | |
tex2addr.mas | 4 years ago | |
texa_mh.mh | 4 years ago | |
texaddr.mas | 4 years ago | |
texaddra.mh | 4 years ago | |
texbd_mh.mh | 4 years ago | |
texblend.mas | 4 years ago | |
texblend.mh | 4 years ago | |
texrd_mh.mh | 4 years ago | |
texread.mas | 4 years ago | |
texread.mh | 4 years ago | |
tstf_mh.mh | 4 years ago | |
tstfail.mas | 4 years ago | |
tstfail.mh | 4 years ago |
readme.txt
Status of general MMX span routines.
09/08/97 Checked in MMX code.
There is no way that the current code will compile and run. I haven't
even tried to compile it. This is primarily to have it backed up and
to let anyone that is interested see what has been done.
The orginal C (or MCP) code are comments of these ASM or MAS files.
The ACP directory contains a program that generates the .INC file
for offsets to all the data. This program was used by Drew and
seems to work better than H2INC. We should probably only have one
of these that would go in the inc directory, but it's not done that
way now (Plus, my code doesn't generate it based on a makefile.
Three regular registers have been set aside for use to access the data.
Since these are passed to every routine, I don't have to pass anything
on the stack as long as I don't modify them. I have modified them a
couple of times before I added this and they need to be changed to esi,
edi, ebp or eax (eax is usually used for the next indirect jump).
ebx is a pointer to the D3DI_SPANITER data (Also Accesses the SI stuff
inside it).
ecx is a pointer to the D3DI_RASTPRIM data.
edx is a pointer to tge D3DI_RASTSPAN data.
There are a few very useful m4 macros to acess this data in
readable way (It also made converting C code easier):
define(`XpCtxSI',`[ebx+D3DI_SPANITER_$1]')dnl
define(`XpCtx',`[ebx+D3DI_RASTCTX_$1]')dnl
define(`XpP', `[ecx+D3DI_RASTPRIM_$1]')dnl
define(`XpS', `[edx+D3DI_RASTSPAN_$1]')dnl
Things that need to be done.
1) New Special W divide. MMX newton's method code has already
been written, but it was very specialized (I negated the
OoW and OoWDX so that 2 - Oow*iW could be done with a pmadd
and a few other things.) Code shouldn't have to change much.
2) Assembly equivalents to the ACMP, ZCMP macros. A version of
these has also been written, but most compares were done in
a reverse order (to preserve registers). The MMX Alpha and
Z setup will most likely have to be different. This means
that the atest.asm has not been coded. A test.mas file is
written, and is missing ZCMP16 and ZCMP32. The other 4
specific code cases are done exactly like the C version
except the iXorMask always seems to be inverted do to how
the comparison is done.
3) BufWrite is not implemented. The code for doing this has
been done in APP notes. The 16 bit cases use a pmaddw
to combine the colors more quickly than shifting. There
is also work beening done on a quick dithering routine.
The MMX dithering routine will use a pcmpgtw to compare
with the dither table and the do a psubssw since if the
color value is to be incremented, then the mask will be
all ones (= -1). Subtracting it will increment the color.
The saturation is used to not increase too much. The
only problem to this is that the color is unsigned so
it has to be shifted down by one to saturate to 7fff.
4) BuffRead is not done. It uses almost identical routines
as those in texread.
5) Lots of clean up and 64 bit constants that need to be in
memory. I have to figure out what registers get passed
to routines that are called and what is passed back.
In some cases, it may be possible to pass data from one
bead to the next using registers. This maybe difficult
though.
6) ColorBld conversion. Mostly ROP stuff and calling of
bldfuncs.asm. ROP stuff should be pretty easy.
7) Since function names are the same, if I made a header
file declaring them extern "C" { }, the assembly code
could concievably execute in place of the current c code.
This is where the true bomb test is.
8) There's probably more, but there is always more.