Saturate a 40-bit integer to a 32-bit integer sat – Texas Instruments TMS320C67X/C67X+ DSP User Manual

Page 268

Advertising
background image

SAT

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

3-208

Instruction Set

SPRU733

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
dst

slong
sint

.L1, .L2

Description

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.

Execution

if (cond)

{
if (src2

>

(2

31

− 1) )

(2

31

− 1)

dst

else if (src2

<

−2

31

)

−2

31

dst

else src2

31..0

dst

}

else nop

Pipeline
Stage

E1

Read

src2

Written

dst

Unit in use

.L

Instruction Type

Single-cycle

Delay Slots

0

Pipeline

Advertising