
DEVELOPMENT NOTES

Author:  Brian L. Evans

Version: @(#)README	1.7	01/25/97


1.0 Files

Here are the files that are borrowed from the C30 DSK release:

assm_fun.h
dasmc40.cpp
dsk.h
errormsg.h
opcodes.h
opcodes1.cpp
opcodes2.cpp
symbols.cpp
symbols.h
tmsfloat.cpp
tmsfloat.h
typedefs.h

Minor changes to the following files (search for C30SIM):

assm_fun.h
dsk.h
opcodes.h
symbols.h
symbols.cpp
tmsfloat.cpp

Major changes to the following files:

dasmc40.cpp
opcodes2.cpp

Chris made two types of changes to opcodes2.cpp:

1. commented out all of the AForm functions.  I am not sure why he did so,
   other than the fact that he doesn't need the assembler.
2. added a function for each opcode that would simulate the instruction.

Grep for 'FIXME' for on-going problems and questions.

To see the differences in the current files and the latest TI release,

diff -r ~c30user/dsk/1.15a/src . >& diff.c30.rel


2.0 Preprocessor constants

_BCPLUSCPLUS for the Borland C++ compiler
__TINY__ the tiny memory model
__SMALL__ the small memory model
__MEDIUM__ the medium memory model
__COMPACT__ the compact memory model
__LARGE__ the large memory model
__HUGE__ the huge memory model


3.0 Floating point simulation

The C30 does not use IEEE floating point, but instead, uses its own
floating point format:

"For floating-point operations I've converted to IEEE using Keith's
routine. Then I convert back again. The only problem with that is that the
value loses some precision, because the C30 produces 40-bit results. So
even when I get it working, it won't be 100% compatible. The only way I
can think of achieving 100% accuracy is to simulate the alu at the bit
level. But then there's a huge speed penalty. So as we progress with this
project, we can add an option to run fast or accurate. It's up to you if
we implement this."

Keith says:

"Chris is right about significant differences, but they are not
insurmountable.  Basically for a DSP floating point errors need to be cleaned
up automaticaly, so the operation is not IEEE compliant.  For example
overflow and underflow, NAN and other conditions do not exist, nor would you
want them to exist.  Overflows result in the max value, underflows with zero
and NAN simply does not exist.  This means that the available number space
of the DSP is bigger than that of the host x86."

Suggestions:
- Convert all numbers to double precision IEEE
- Compare +HUGE_VAL, -HUGE_VAL, +MIN_VAL, -MIN_VAL and clip accordingly
- Detect errors like NAN etc...
- Convert back to 32/40 bit float
