PROCEDURE CALLS
7-7
7
7.1.3.2
Return Operation
A return from any call type — explicit or implicit — is always initiated with a return (
ret
)
instruction. On a return, the processor performs these operations:
1.
The current stack frame and local registers are deallocated by loading the FP register with
the value of the PFP register.
2.
The local registers for the return target procedure are retrieved. The registers are usually read
from the local register cache; however, in some cases, these registers have been flushed from
register cache to memory and must be read directly from the save area in the stack frame.
3.
The processor sets the instruction pointer to the value of the RIP register.
Upon completion of these steps, the processor executes the instruction to which it returns. The
frames created before the
ret
instruction was executed are overwritten by later implicit or explicit
call operations.
7.1.4
Caching
Local Register Sets
Actual implementations of the i960 architecture may cache some number of local register sets
within the processor to improve performance. Local registers are typically saved and restored from
the local register cache when calls and returns are executed. Other overhead associated with a call
or return is performed in parallel with this data movement.
When the number of nested procedures exceeds local register cache size, local register sets must at times
be saved to (and restored from) their associated save areas in the procedure stack. Because these
operations require access to external memory, this local cache miss affects call and return performance.
When a call is made and no frames are available in the register cache, a register set in the cache must
be saved to external memory to make room for the current set of local registers in the cache (see
section 4.2, “LOCAL REGISTER CACHE” (pg. 4-2)
). This action is referred to as a frame spill.
The oldest set of local registers stored in the cache is spilled to the associated local register save area
in the procedure stack.
Figure 7-2
illustrates a call operation with and without a frame spill.
Similarly, when a return is made and the local register set for the target procedure is not available
in the cache, these local registers must be retrieved from the procedure stack in memory. This
operation is referred to as a frame fill.
Figure 7-3
illustrates return operations with and without
frame fills.
The
flushreg
instruction (described in
section 6.2.30, “flushreg” (pg. 6-54)
) writes all local register
sets (except the current one) to their associated stack frames in memory. The register cache is then
invalidated, meaning that all flushed register sets must be restored from their save areas in memory.
Содержание i960 Jx
Страница 1: ...Release Date December 1997 Order Number 272483 002 i960 Jx Microprocessor Developer s Manual ...
Страница 24: ......
Страница 25: ...1 INTRODUCTION ...
Страница 26: ......
Страница 35: ...2 DATA TYPES AND MEMORY ADDRESSING MODES ...
Страница 36: ......
Страница 46: ......
Страница 47: ...3 PROGRAMMING ENVIRONMENT ...
Страница 48: ......
Страница 73: ...4 CACHE AND ON CHIP DATA RAM ...
Страница 74: ......
Страница 85: ...5 INSTRUCTION SET OVERVIEW ...
Страница 86: ......
Страница 111: ...6 INSTRUCTION SET REFERENCE ...
Страница 112: ......
Страница 195: ...INSTRUCTION SET REFERENCE 6 83 6 Opcode mov 5CCH REG movl 5DCH REG movt 5ECH REG movq 5FCH REG See Also LOAD STORE lda ...
Страница 233: ...7 PROCEDURE CALLS ...
Страница 234: ......
Страница 256: ......
Страница 257: ...8 FAULTS ...
Страница 258: ......
Страница 291: ...9 TRACING AND DEBUGGING ...
Страница 292: ......
Страница 309: ...10 TIMERS ...
Страница 310: ......
Страница 324: ......
Страница 325: ...11 INTERRUPTS ...
Страница 326: ......
Страница 369: ...12 INITIALIZATION AND SYSTEM REQUIREMENTS ...
Страница 370: ......
Страница 412: ......
Страница 413: ...13 MEMORY CONFIGURATION ...
Страница 414: ......
Страница 429: ...14 EXTERNAL BUS ...
Страница 430: ......
Страница 468: ......
Страница 469: ...15 TEST FEATURES ...
Страница 470: ......
Страница 493: ...A CONSIDERATIONS FOR WRITING PORTABLE CODE ...
Страница 494: ......
Страница 502: ......
Страница 503: ...B OPCODES AND EXECUTION TIMES ...
Страница 504: ......
Страница 515: ...C MACHINE LEVEL INSTRUCTION FORMATS ...
Страница 516: ......
Страница 523: ...D REGISTER AND DATA STRUCTURES ...
Страница 524: ......
Страница 550: ......
Страница 551: ...GLOSSARY ...
Страница 552: ......
Страница 561: ...INDEX ...
Страница 562: ......
Страница 578: ......