Texas Instruments TMS320C67X/C67X+ DSP manual Saturate a 40-Bit Integer to a 32-Bit Integer

Models: TMS320C67X/C67X+ DSP

1 465
Download 465 pages 63.87 Kb
Page 268
Image 268

SAT Saturate a 40-Bit Integer to a 32-Bit Integer

 

 

 

 

Saturate a 40-Bit Integer to a 32-Bit Integer

 

 

 

 

 

 

SAT

 

 

 

 

 

 

 

 

 

Syntax

 

 

 

 

SAT (.unit) src2, dst

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

.unit = .L1 or .L2

 

 

 

 

 

 

 

 

 

 

 

Compatibility

 

 

C62x, C64x, C67x, and C67x+ CPU

 

 

 

 

 

 

 

 

 

Opcode

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

31

29

28

27

23

22

18

17

13

12

11

5

4

3

2

1

0

creg

z

dst

src2

0 0 0 0 0 x 1 0 0 0 0 0 0 1 1 0 s p

3

1

5

5

1

1

1

 

 

 

 

 

 

 

 

 

 

Opcode map field used...

For operand type...

Unit

 

 

 

 

 

 

 

 

 

 

 

src2

slong

.L1, .L2

 

 

 

 

dst

sint

 

 

 

 

 

 

 

 

 

Description

Execution

Pipeline

A 40-bit src2 value is converted to a 32-bit value. If the value in src2 is greater than what can be represented in 32-bits, src2 is saturated. The result is placed in dst. If a saturate occurs, the SAT bit in the control status register (CSR) is set one cycle after dst is written.

if (cond)

{

 

if (src2 > (231 − 1) )

 

(231 − 1) dst

 

else if (src2 < −231)

 

−231 dst

 

else src231..0 dst

 

}

else nop

Pipeline

E1

Stage

 

 

Read

src2

Written

dst

Unit in use

.L

 

 

Instruction Type

Single-cycle

Delay Slots

0

3-208

Instruction Set

SPRU733

Page 268
Image 268
Texas Instruments TMS320C67X/C67X+ DSP manual Saturate a 40-Bit Integer to a 32-Bit Integer