beautypg.com

Ssub, Subtract two signed integers with saturation ssub – Texas Instruments TMS320C67X/C67X+ DSP User Manual

Page 294

background image

SSUB

Subtract Two Signed Integers With Saturation

3-234

Instruction Set

SPRU733

Subtract Two Signed Integers With Saturation

SSUB

Syntax

SSUB (.unit) src1, 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

src1

x

op

1 1 0 s p

3

1

5

5

5

1

7

1

1

Opcode map field used...

For operand type...

Unit

Opfield

src1
src2
dst

sint
xsint
sint

.L1, .L2

000 1111

src1
src2
dst

xsint
sint
sint

.L1, .L2

001 1111

src1
src2
dst

scst5
xsint
sint

.L1, .L2

000 1110

src1
src2
dst

scst5
slong
slong

.L1, .L2

010 1100

Description

src2 is subtracted from src1 and is saturated to the result size according to the
following rules:

1) If the result is an int and src1 src2 > 2

31

− 1, then the result is 2

31

− 1.

2) If the result is an int and src1 src2 < −2

31

, then the result is −2

31

.

3) If the result is a long and src1 src2 > 2

39

− 1, then the result is 2

39

− 1.

4) If the result is a long and src1 src2 < −2

39

, then the result is −2

39

.

The result is placed in dst. If a saturate occurs, the SAT bit in CSR is set
one cycle after dst is written.

Execution

if (cond)

src1 −s src2

dst

else nop