Leftmost Bit Detection

 

LMBD

 

 

 

 

Leftmost Bit Detection

 

 

 

 

 

 

 

 

 

LMBD

 

 

 

 

 

 

 

 

 

 

 

 

Syntax

 

 

 

 

LMBD (.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/cst5

x

op

1

1

0s

p

3 1555171 1

Opcode map field used...

For operand type...

Unit

Opfield

 

 

 

 

src1

uint

.L1, .L2

110 1011

src2

xuint

 

 

dst

uint

 

 

src1

cst5

.L1, .L2

110 1010

src2

xuint

 

 

dst

uint

 

 

 

 

 

 

Description

The LSB of the src1 operand determines whether to search for a leftmost 1 or 0

 

in src2. The number of bits to the left of the first 1 or 0 when searching for a 1

 

or 0, respectively, is placed in dst.

 

The following diagram illustrates the operation of LMBD for several cases.

 

When searching for 0 in src2, LMBD returns 0:

0 1 x x x x x x x x x x x x x x x x x x

x x

x

x x x x

x x x x x

31

30 29

28 27 26

25 24 23

22

21

20 19

18

17

16

15

14

13

12

11 10

9

8

7

6

5

4

3

2

1

0

When searching for 1 in src2, LMBD returns 4:

0 0 0 0 1 x x x x x x x x x x x x x x x

x x

x

x x x x

x x x x x

31

30 29

28 27 26

25 24 23

22

21

20 19

18

17

16

15

14

13

12

11 10

9

8

7

6

5

4

3

2

1

0

When searching for 0 in src2, LMBD returns 32:

1 1

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

1

1

1 1 1 1

1 1 1

1 1

31

30 29

28 27 26

25 24 23

22

21

20 19

18

17

16

15

14

13

12

11 10

9

8

7

6

5

4

3

2

1

0

SPRU733

Instruction Set

3-141

Page 201
Image 201
Texas Instruments TMS320C67X/C67X+ DSP manual Lmbd, Leftmost Bit Detection