Appendix
0
31
23 22
o
11
101000001 1
00001111000011110000111
OENORMALIZEO FLOATING NUMBER
31
23 22
o
11
1 00111101 1
11110000111100001110000
SAME NUMBER
AFTER
NORMALIZATION
Figure
0-3.
Single-Precision
Normalization
,
Normalization
for the
double
precision format
is
done
in
the same manner.
0.4
Floating
Point
Interface
Floating
point
functions
do
not
adhere
to
the C calling convention and cannot
be
called via a C function call.
Each
floating
point
function requires its argu-
ments
to
be
in
a particular order on the program stack: the
32
least-significant
bits
of
double precision numbers are pushed
onto
the stack first; the 32
most-significant bits are pushed on
last. Integer arguments and results are
passed via register
AB.
If
you
wish
to
call the
functions
directly (bypassing the C compiler), you must
do
so via TMS3401 0 assembly language.
0.4.1
Floating
Point
Conversions
The
TMS34010
C
floating-point
conversion functions can be classified
into
two
categories:
• The "exact" conversion functions: .
-
FP
-ITOD
- signed integer
to
double
-
FP
- FTOD - float
to
double
-
FP
_ UTOD - unsigned integer
to
double
•
The "best
fit"
conversion functions:
-FP-DTOF
-
double
to
float
-
FP
- FTOI - float
to
signed integer
-
FP
_ DTOI -
double
to
signed integer
-
FP
-ITOF
- signed integer
to
float
-
FP
- UTOF - unsigned integer
to
float
The "exact" conversion functions
are
such that the value
Vs
of
the number in
the source format is
exactly equal
to
Vd,
the value
of
the number
in
the desti-
nation format. Hence,
"exact" conversion functions never cause a loss
of
precision, and a
"faithful"
representation
of
the source number in the destina-
tionformat
is
one
that
has the same value (Vs = Vd).
The
"best
fit"
conversion
functions
are
those
which
cannot always make the
conversion so that
Vs
=
Vd.
Hence, they must convert
to
the closest possible
0-5