Subc – Texas Instruments TMS320C67X/C67X+ DSP User Manual

Page 318

Advertising
background image

SUBC

Subtract Conditionally and Shift−Used for Division

3-258

Instruction Set

SPRU733

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
src2
dst

uint
xuint
uint

.L1, .L2

Description

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.

Execution

if (cond)

{
if (src1 src2 w 0)

( (src1src2)

<<

1) + 1

dst

else src1

<<

1

dst

}

else nop

Pipeline
Stage

E1

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

Pipeline

Advertising