Motorola MCF5281, MCF5282 user manual Find First One in Register, Old Dx310 New Dx310

Models: MCF5282 MCF5281

1 816
Download 816 pages 28.97 Kb
Page 103
Image 103

ColdFire Instruction Set Architecture Enhancements

FF1

Find First One in Register

FF1

 

(Supported Starting with ISA A+)

 

Operation:

Bit Offset of the First Logical One in Register Destination

Assembler Syntax:

FF1.L Dx

 

Attributes:

Size = longword

 

Instruction Format:

15

14

13

12

11

10

9

8

7

6

5

4

3

2

1

0

0

0

0

0

0

1

0

0

1

1

0

0

0

 

Destination

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Register, Dx

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The data register, Dx, is scanned, beginning from the most-significant bit (Dx[31]) and ending with the least-significant bit (Dx[0]), searching for the first set bit. The data register is then loaded with the offset count from bit 31 where the first set bit appears, as shown below. If the source data is zero, then an offset of 32 is returned.

Condition Codes:

 

 

 

 

 

Old Dx[31:0]

 

New Dx[31:0]

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0b1---- . . . ----

 

0x0000 0000

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0b01--- . . . ----

 

0x0000 0001

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0b001-- . . . ----

 

0x0000 0002

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

...

 

 

...

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0b00000 . . . 0010

 

0x0000 001E

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0b00000 . . . 0001

 

0x0000 001F

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0b00000 . . . 0000

 

0x0000 0020

 

 

 

 

 

 

 

 

 

 

 

 

 

X

N

Z

 

V

 

C

X

Not affected

 

 

 

 

 

 

 

 

 

N

Set if the msb of the source operand is set; cleared

 

 

0

 

0

 

 

 

 

 

 

 

 

 

 

 

otherwise

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Z Set if the source operand is zero; cleared otherwise

 

 

 

 

 

 

 

 

 

V

Always cleared

 

 

 

 

 

 

 

 

 

C

Always cleared

Instruction Field:

Destination Register field—Specifies the destination data register, Dx.

 

FF1

V2, V3 Core (ISA_A)

V4 Core (ISA_B)

V2 Core (ISA_A+)

 

 

 

 

 

 

 

 

Opcode present

No

No

Yes

 

 

 

 

 

 

 

 

 

 

 

 

 

MOTOROLA

Chapter 2. ColdFire Core

2-31

Page 103
Image 103
Motorola MCF5281, MCF5282 user manual Find First One in Register, Old Dx310 New Dx310