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

Program Flow Prediction

5.3Return stack

A return stack is used for predicting the class of program flow changes that includes loads, moves, and ALU operations, writing to the PC that can be identified as being likely to be a procedure call or return.

The return stack is a three-entry circular buffer used for the prediction of procedure calls and procedure returns. Only unconditional procedure returns are predicted.

When a procedure call instruction is predicted, the return address is taken from the Execute stage of the pipeline and pushed onto the return stack. The instructions recognized as procedure calls are:

BL <dest>

BLX <dest>

BLX <reg>.

The first two instructions are predicted by the BTAC, unless they result in a BTAC miss. The third instruction is not predicted. The SBP predicts unconditional procedure calls as taken, and conditional procedure calls as not taken.

When a procedure return instruction is predicted, an instruction fetch from the location at the top of the return stack occurs, and the return stack is popped. The instructions recognized as procedure returns are:

BX R14

LDM sp!, {...,pc}

LDR pc, [sp...].

The SBP only predicts procedure returns that are always predicted as taken.

Two classes of return stack mispredictions can exist:

condition code failures of the return operation

incorrect return location.

In addition, an empty return stack gives no prediction.

ARM DDI 0333H

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

5-7

ID012410

Non-Confidential, Unrestricted Access

 

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