System and method of maintaining and utilizing multiple return stack buffers
First Claim
Patent Images
1. An instruction pipeline in a microprocessor, comprising:
- an instruction fetch unit for fetching a plurality of macro-code instructions from a memory device, each of the plurality of macro-code instructions corresponding to at least one micro-code instruction, the instruction fetch unit capable of recognizing a subroutine CALL macro-code instruction, the instruction fetch unit determining a respective first return address for each subroutine CALL macro-code instruction recognized by the instruction fetch unit, the instruction fetch unit further capable of recognizing a RETURN FROM SUBROUTINE macro-code instruction;
a first return address stack, coupled to the instruction fetch unit, the instruction fetch unit pushing each respective first return address onto the first return address stack, wherein the instruction fetch unit pops one respective first return address from the first return address stack for each RETURN FROM SUBROUTINE macro-code instruction the instruction fetch unit recognizes;
a decode unit for decoding the each of the plurality of macro-code instructions into the at least one corresponding micro-code instruction, the decode unit capable of recognizing a subroutine CALL macro-code instruction, the decode unit determining a respective second return address for each subroutine CALL macro-code instruction recognized by the decode unit, the decode unit further capable of recognizing a RETURN FROM SUBROUTINE macro-code instruction;
a second return address stack, coupled to the decode unit, the decode unit pushing each respective second return address onto the second return address stack, and wherein the decode unit pops one respective second return address from the second return address stack for each RETURN FROM SUBROUTINE macro-code instruction the decode unit recognizes;
a third unit for executing each of the plurality of micro-code instructions;
a fourth unit for retiring each macro-code instruction corresponding to the executed plurality of micro-code instructions, the fourth unit capable of recognizing a subroutine CALL macro-code instruction, the fourth unit determining a respective third return address for each CALL macro-code instruction recognized by the fourth unit, the fourth unit further capable of recognizing a RETURN FROM SUBROUTINE macro-code instruction; and
a third return address stack, coupled to the fourth unit, the fourth unit pushing each third respective third return address onto the third return address stack, and wherein the fourth unit pops one respective third return address from the third return address stack for each RETURN FROM SUBROUTINE macro-code instruction the fourth unit recognizes.
1 Assignment
0 Petitions
Accused Products
Abstract
An instruction pipeline in a microprocessor is provided. The instruction pipeline includes a plurality of pipeline units, each of the plurality of pipeline units processing a plurality of instructions. At least two of the plurality of pipeline units are a source of at least some of the instructions for the pipeline. The pipeline further includes at least two speculative return address stacks, each of the speculative return address stacks coupled is coupled to at least one of the instruction source units. Each of the speculative return return address stacks are capable of storing at least two speculative return addresses.
102 Citations
6 Claims
-
1. An instruction pipeline in a microprocessor, comprising:
-
an instruction fetch unit for fetching a plurality of macro-code instructions from a memory device, each of the plurality of macro-code instructions corresponding to at least one micro-code instruction, the instruction fetch unit capable of recognizing a subroutine CALL macro-code instruction, the instruction fetch unit determining a respective first return address for each subroutine CALL macro-code instruction recognized by the instruction fetch unit, the instruction fetch unit further capable of recognizing a RETURN FROM SUBROUTINE macro-code instruction; a first return address stack, coupled to the instruction fetch unit, the instruction fetch unit pushing each respective first return address onto the first return address stack, wherein the instruction fetch unit pops one respective first return address from the first return address stack for each RETURN FROM SUBROUTINE macro-code instruction the instruction fetch unit recognizes; a decode unit for decoding the each of the plurality of macro-code instructions into the at least one corresponding micro-code instruction, the decode unit capable of recognizing a subroutine CALL macro-code instruction, the decode unit determining a respective second return address for each subroutine CALL macro-code instruction recognized by the decode unit, the decode unit further capable of recognizing a RETURN FROM SUBROUTINE macro-code instruction; a second return address stack, coupled to the decode unit, the decode unit pushing each respective second return address onto the second return address stack, and wherein the decode unit pops one respective second return address from the second return address stack for each RETURN FROM SUBROUTINE macro-code instruction the decode unit recognizes; a third unit for executing each of the plurality of micro-code instructions; a fourth unit for retiring each macro-code instruction corresponding to the executed plurality of micro-code instructions, the fourth unit capable of recognizing a subroutine CALL macro-code instruction, the fourth unit determining a respective third return address for each CALL macro-code instruction recognized by the fourth unit, the fourth unit further capable of recognizing a RETURN FROM SUBROUTINE macro-code instruction; and a third return address stack, coupled to the fourth unit, the fourth unit pushing each third respective third return address onto the third return address stack, and wherein the fourth unit pops one respective third return address from the third return address stack for each RETURN FROM SUBROUTINE macro-code instruction the fourth unit recognizes.
-
-
2. A method for maintaining return address information in an instruction pipeline of a micro-processor, comprising the steps of:
-
fetching, by a first pipeline unit, a plurality of instructions from a memory device, the plurality of instructions including a subroutine CALL instruction; detecting, by the first pipeline unit, the subroutine CALL instruction; determining, by the first pipeline unit, a respective first return address as a function of the detected subroutine CALL macro-code instruction; pushing the respective first return address onto a first return address stack; transmitting the plurality of instructions to a second pipeline unit; detecting, by the second pipeline unit, the subroutine CALL macro-code instruction; determining, by the second pipeline unit, a respective second return address as a function of the detected subroutine CALL instruction; pushing the respective second return address onto a second return address stack; transmitting the plurality of instructions to a third pipeline unit; detecting, by the third pipeline unit, the subroutine CALL instruction; determining, by the third pipeline unit, a respective third return address as a function of the detected subroutine CALL instruction; and pushing the respective third return address onto a third return address stack. - View Dependent Claims (3, 4, 5, 6)
-
Specification