Convert Single-Precision Floating-Point Value to Integer With Truncation
SPTRUNC
4-75
TMS320C67x Floating-Point Instruction Set
Syntax
SPTRUNC (.unit)
src2, dst
.unit = .L1 or .L2
Opcode map field used...
For operand type...
Unit
src2
dst
xsp
sint
.L1, .L2
Opcode
31
29 28 27
23 22
18 17
creg
z
dst
13 12 11
5
4
3
2
1
0
x
0 0 0 1 0 1 1
1
1
0
s
p
3
5
5
5
7
src2
0 0 0 0 0
Description
The single-precision value in
src2 is converted to an integer and placed in dst.
This instruction operates like SPINT except that the rounding modes in the
FADCR are ignored, and round toward zero (truncate) is always used.
Execution
if (cond)
int(
src2)
→
dst
else
nop
Notes:
1) If
src2 is NaN, the maximum signed integer (7FFF FFFFh or
8000 0000h) is placed in
dst and the INVAL bit is set.
2) If
src2 is signed infinity or if overflow occurs, the maximum signed integer
(7FFF FFFFh or 8000 0000h) is placed in
dst and the INEX and OVER
bits are set. Overflow occurs if
src2 is greater than 2
31
– 1 or less than
–2
31
.
3) If
src2 is denormalized, 0000 0000h is placed in dst and INEX and DEN2
bits are set.
4) If rounding is performed, the INEX bit is set.
Pipeline
Stage
E1
E2
E3
E4
Read
src2
Written
dst
Unit in use
.L
Instruction Type
4-cycle
Delay Slots
3
Pipeline