Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
CS 220 / ARM / ARM1176JZ-S Technical Reference Mmanual.pdf
Источник:
Скачиваний:
45
Добавлен:
16.04.2015
Размер:
4.47 Mб
Скачать

Cycle Timings and Interlock Behavior

16.3Data processing instructions

This section describes the cycle timing behavior for the AND, EOR, SUB, RSB, ADD, ADC, SBC, RSC, CMN, ORR, MOV, BIC, MVN, TST, TEQ, CMP, and CLZ instructions.

16.3.1Cycle counts if destination is not PC

Table 16-4 lists the cycle timing behavior for data processing instructions if its destination is not the PC. You can substitute ADD with any of the data processing instructions identified in the opening paragraph of this section.

Table 16-4 Data Processing Instruction cycle timing behavior if destination is not PC

 

Cycle

Earl

Late

Result

 

Example Instruction

y

Comment

s

Reg

Latency

 

Reg

 

 

 

 

 

 

 

 

 

 

 

 

ADD <Rd>, <Rn>, <Rm.

1

-

-

1

Normal case.

 

 

 

 

 

 

ADD <Rd>, <Rn>, <Rm>, LSL #<immed>

1

<Rm>

-

1

Requires a shifted source register.

 

 

 

 

 

 

ADD <Rd>, <Rn>, <Rm>, LSL <Rs>

2

<Rs>

<Rn>

2

Requires a register controlled shifted

 

 

 

 

 

source register. Instruction takes two

issue cycles. In the first cycle the shift distance Rs is sampled. In the second cycle the actual shift of Rm and the ADD instruction occurs.

16.3.2Cycle counts if destination is the PC

Table 16-5 lists the cycle timing behavior for data processing instructions if its destination is the PC. You can substitute ADD with any data processing instruction except for a MOV and CLZ. A CLZ with the PC as the destination is an Unpredictable instruction.

The timings for a MOV instruction are given separately in the table.

For condition code failing cycle counts, the cycles for the non-PC destination variants must be used.

Table 16-5 Data Processing Instruction cycle timing behavior if destination is the PC

 

Cycle

Earl

Late

Result

 

Example Instruction

y

Comment

s

Reg

Latency

 

Reg

 

 

 

 

 

 

 

 

 

 

 

 

MOV pc, lr

4

-

-

-

Correctly return stack

 

 

 

 

 

predicted MOV pc, lr

 

 

 

 

 

 

MOV pc, lr

7

-

-

-

Incorrectly return stack

 

 

 

 

 

predicted MOV pc, lr

 

 

 

 

 

 

MOV <cond> pc, lr

5-7a

-

-

-

Conditional return, or return

 

 

 

 

 

when return stack is empty

 

 

 

 

 

 

MOV pc, <Rd>

5

-

-

-

MOV to PC, no shift required

 

 

 

 

 

 

MOV <cond> pc, <Rd>

5-7a

-

-

-

Conditional MOV to PC, no

 

 

 

 

 

shift required

 

 

 

 

 

 

MOV pc, <Rn>, <Rm>, LSL #<immed>

6

<Rm>

-

-

Conditional MOV to PC, with a

 

 

 

 

 

shifted source register

ARM DDI 0333H

Copyright © 2004-2009 ARM Limited. All rights reserved.

16-7

ID012410

Non-Confidential, Unrestricted Access

 

Cycle Timings and Interlock Behavior

Table 16-5 Data Processing Instruction cycle timing behavior if destination is the PC (continued)

Example Instruction

Cycle

Earl

Late

Result

 

y

Comment

s

Reg

Latency

 

Reg

 

 

 

 

 

 

 

 

 

 

 

 

MOV <cond> pc, <Rn>, <Rm>, LSL #<immed>

6-7a

-

-

-

Conditional MOV to PC, with a

 

 

 

 

 

shifted source register

 

 

 

 

 

 

MOV pc, <Rn>, <Rm>, LSL <Rs>

7

<Rs>

<Rn>

-

MOV to pc, with a register

 

 

 

 

 

controlled shifted source

 

 

 

 

 

register

 

 

 

 

 

 

ADD pc, <Rd>, <Rm>

7

-

-

-

Normal case to PC

 

 

 

 

 

 

ADD pc, <Rn>, <Rm>, LSL #<immed>

7

<Rm>

-

-

Requires a shifted source

 

 

 

 

 

register

 

 

 

 

 

 

ADD pc, <Rn>, <Rm>, LSL <Rs>

8

<Rs>

<Rn>

-

Requires a register controlled

 

 

 

 

 

shifted source register

a.If the instruction is conditional and passes conditional checks it takes MAX (MaxCycles - FlagCycleDistance, MinCycles), If the instruction is unconditional it takes Min Cycles.

16.3.3Example interlocks

Most data processing instructions are single-cycle and can be executed back-to-back without interlock cycles, even if there are data dependencies between them. The exceptions to this are when the Shifter or Register controlled shifts are used.

Shifter

The shifter is in a separate pipeline stage from the ALU. A register required by the shifter is an Early Reg and requires an additional cycle of result availability before use. For example, the following sequence introduces a one-cycle interlock, and takes three cycles to execute:

ADD R1,R2,R3

ADD R4,R5,R1 LSL #1

The second source register, that is not shifted, does not incur an extra data dependency check. Therefore, the following sequence takes two cycles to execute:

ADD R1,R2,R3

ADD R4,R1,R9 LSL #1

Register controlled shifts

Register controlled shifts take two cycles to execute:

the register containing the shift distance is read in the first cycle

the shift is performed in the second cycle

The final operand is not required until the ALU stage for the second cycle.

Because a shift distance is required, the register containing the shift distance is an Early Reg and incurs an extra interlock penalty. For example, the following sequence takes four cycles to execute:

ADD R1, R2, R3

ADD R4, R2, R4, LSL R1

ARM DDI 0333H

Copyright © 2004-2009 ARM Limited. All rights reserved.

16-8

ID012410

Non-Confidential, Unrestricted Access

 

Соседние файлы в папке ARM