Motorola CPU32 Reference Manual page 203

Hide thumbs Also See for CPU32:
Table of Contents

Advertisement

TBLS
TBLSN
Signed table entries range from –2
and long-word tables, respectively.
Rounding of the result is optionally selected via the 'R' instruction field. If R = 0 (TBLS),
the fractional portion is rounded according to the round-to-nearest algorithm. The
rounding procedure can be summarized by the following table.
Adjusted Difference Fraction
The adjusted difference is then added to the selected table entry. The rounded result
is returned in the destination data register, Dx. Only the portion of the register corre-
sponding to the selected size is affected.
31
BYTE
UNAFFECTED
WORD
UNAFFECTED
LONG
RESULT
If R =1 (TBLSN), the result is returned in register Dx without rounding. If the size is
byte, the integer portion of the result is returned in Dx [15:8]. The integer portion of a
word result is stored in Dx [23:8]. The least significant 24 bits of a long result are stored
in Dx [31:8]. Byte and word results are sign extended to fill the entire 32-bit register.
31
BYTE
SIGN EXTENDED
WORD
SIGN EXTENDED
LONG
RESULT
A long-word result contains only the least significant 24 bits of integer
precision.
CPU32
REFERENCE MANUAL
Table Lookup and Interpolate (Signed)
n–1
to 2
n ≤ – ½
– ½ < n < ½
n ≥ ½
24 23
UNAFFECTED
UNAFFECTED
RESULT
24 23
SIGN EXTENDED
RESULT
RESULT
INSTRUCTION SET
n–1
– 1, where n is 8, 16, or 32 for byte, word,
Rounding Adjustment
–1
+0
+1
16 15
8 7
UNAFFECTED
RESULT
RESULT
16 15
8 7
RESULT
RESULT
RESULT
NOTE
TBLS
TBLSN
0
RESULT
RESULT
RESULT
0
FRACTION
FRACTION
FRACTION
MOTOROLA
4-155

Advertisement

Table of Contents
loading

Table of Contents