
MOTOROLA
4-158
INSTRUCTION SET
CPU32
REFERENCE MANUAL
TBLU
TBLUN
Table Lookup and Interpolate (Unsigned)
TBLU
TBLUN
Operation:
Rounded:
ENTRY
(n)
+ {(ENTRY
(n + 1)
– ENTRY
(n)
)
Dx [7:0]} / 256
→
Dx
Unrounded:
ENTRY
(n)
256 + {(ENTRY
(n + 1)
– ENTRY
(n)
)
Dx [7:0]}
→
Dx
Where ENTRY
(n)
and ENTRY
(n + 1)
are either:
1. Consecutive entries in the table pointed to by the
ea
and
indexed by Dx [15:8]
size or,
2. The registers Dym, Dyn respectively
Assembler
Syntax:
TBLU.
size
ea
,Dx(Result rounded)
TBLUN.
size
ea
,Dx(Result not rounded)
TBLU.
size
Dym:Dyn,Dx(Result rounded)
TBLUN.
size
Dym:Dyn, Dx(Result not rounded)
Size = (Byte, Word, Long)
The signed table lookup and interpolate instruction, TBLU, allows
the efficient use of compressed linear data tables to model complex functions. The
TBLU instruction has two modes of operation: table lookup and interpolate mode, and
data register interpolate mode.
For table lookup and interpolate mode, data register Dx [15:0] contains the indepen-
dent variable X. The effective address points to the start of a signed byte, word, or
long-word table containing a linear representation of the dependent variable, Y, as a
function of X. In general, the independent variable, located in the low-order word of Dx,
consists of an 8-bit integer part and an 8-bit fractional part. An assumed radix point is
located between bits 7 and 8. The integer part, Dx [15:8], is scaled by the operand size
and is used as an offset into the table. The selected entry in the table is subtracted
from the next consecutive entry. A fractional portion of this difference is taken by mul-
tiplying by the interpolation fraction, Dx [7:0]. The adjusted difference is then added to
the selected table entry. The result is returned in the destination data register, Dx.
Attributes:
Description:
For register interpolate mode, the interpolation occurs using the Dym and Dyn regis-
ters in place of the two table entries. For this mode, only the fractional portion, Dx [7:0],
is used in the interpolation, and the integer portion, Dx [15:8], is ignored. The register
interpolation mode may be used with several table lookup and interpolations to model
multidimensional functions.
F
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
.