SUBC Subtract Conditionally and Shift−Used for Division

 

 

 

 

Subtract Conditionally and Shift—Used for Division

 

 

 

 

 

 

SUBC

 

 

 

 

 

 

 

 

 

Syntax

 

 

 

 

SUBC (.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

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

3

1

5

5

5

1

1

1

 

 

 

 

 

 

 

 

 

 

Opcode map field used...

For operand type...

Unit

 

 

 

 

 

 

 

 

 

 

 

 

src1

uint

 

.L1, .L2

 

 

 

 

src2

xuint

 

 

 

 

 

 

dst

uint

 

 

 

 

 

 

 

 

 

 

 

Description

Execution

Pipeline

Subtract src2 from src1. If result is greater than or equal to 0, left shift result by 1, add 1 to it, and place it in dst. If result is less than 0, left shift src1 by 1, and place it in dst. This step is commonly used in division.

if (cond)

{

 

 

if (src1 src2 w 0)

 

( (src1src2) << 1) + 1 dst

 

else src1 << 1 dst

 

}

 

else nop

 

 

 

 

 

Pipeline

E1

Stage

 

 

 

Read

src1, src2

Written

dst

Unit in use

.L

 

 

 

Instruction Type

Single-cycle

Delay Slots

0

See Also

ADD, SSUB, SUB, SUBDP, SUBSP, SUBU, SUB2

3-258

Instruction Set

SPRU733

Page 318
Image 318
Texas Instruments TMS320C67X/C67X+ DSP manual Subtract Conditionally and Shift-Used for Division, Subc