Convert Double-Precision Floating-Point Value to Integer With Truncation
DPTRUNC
4-45
TMS320C67x Floating-Point Instruction Set
Syntax
DPTRUNC (.unit)
src2, dst
.unit = .L1 or .L2
Opcode map field used...
For operand type...
Unit
src2
dst
dp
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 0 0 0 1
1
1
0
s
p
3
5
5
5
7
src2
0 0 0 0 0
Description
The 64-bit double-precision value in
src2 is converted to an integer and placed
in
dst. This instruction operates like DPINT except that the rounding modes in
the FADCR are ignored; round toward zero (truncate) is always used. The
64-bit operand is read in one cycle by using the
src2 port for the 32 MSBs and
the src1 port for the 32 LSBs.
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 the INEX and
DEN2 bits are set.
4) If rounding is performed, the INEX bit is set.
Pipeline
Stage
E1
E2
E3
E4
Read
src2_l
src2_h
Written
dst
Unit in use
.L
Instruction Type
4-cycle
Pipeline