Convert Single-Precision Floating-Point Value to Integer With Truncation
Syntax
Opcode
31
29 28 27
creg
z
dst
3
5
Description
Execution
Pipeline
Instruction Type
Delay Slots
SPTRUNC (.unit) src2 , dst
.unit = .L1 or .L2
Opcode map field used...
src2
dst
23 22
18 17
src2
5
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.
int( src2 )
if (cond)
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
–2
.
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
Read
src2
Written
Unit in use
.L
4-cycle
3
For operand type...
xsp
sint
13 12 11
0 0 0 0 0
x
0 0 0 1 0 1 1
5
dst
E2
TMS320C67x Floating-Point Instruction Set
SPTRUNC
Unit
.L1, .L2
5
4
3
2
1
1
0
7
31
– 1 or less than
E3
E4
dst
1
0
s
p
4-75
Need help?
Do you have a question about the TMS320C6000 Series and is the answer not in the manual?