IP Library Granted Patent US 10,360,037
Granted Patent B2
US 10,360,037 · App. 15/281,661 · Granted Jul 23, 2019

Fetch unit for predicting target for subroutine return instructions

Inventor: Philip Day (London, GB)
Assignee: MIPS Tech, LLC
G06F9/3802G06F9/3016G06F9/30054G06F9/3806G06F9/30134G06F9/30163G06F9/382G06F9/3808G06F12/0875
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,360,037
App. No.
15/281,661
Granted
Jul 23, 2019
Kind
B2
Abstract

A fetch unit configured to, in response to detecting a subroutine call and link instruction, calculate and store a predicted target address for the corresponding subroutine return instruction in a prediction stack, and if certain conditions are met, also cause to be stored in the prediction stack a predicted target instruction bundle. The fetch unit is also configured to, in response to detecting a subroutine return instruction, use the predicted target address in the prediction stack to determine the address of the next instruction bundle to be fetched, and if certain conditions are met, cause any valid predicted target instruction bundle in the prediction stack to be the next bundle to be decoded.

Claims (40)

1. A multi-stage fetch unit for use in a processor, the multi-stage fetch unit comprising:

a return prediction stack storing a predicted target set of one or more instructions;

partial decode logic in communication with the return prediction stack, the partial decode logic configured to, in a cycle:

receive a set of one or more instructions for execution;

at least partially decode the received set of one or more instructions to determine whether the received set of one or more instructions comprises a subroutine call and link instruction or a subroutine return instruction;

in response to determining that the received set of one or more instructions comprises a subroutine call and link instruction, cause a predicted target set of one or more instructions for a corresponding subroutine return instruction to be stored in the return prediction stack; and

in response to determining that the received set of one or more instructions comprises a subroutine return instruction, cause said predicted target set of one or more instructions stored in the return prediction stack to be the received set of one or more instructions in a next cycle; and

an instruction memory module; and wherein the partial decode logic is configured to cause a predicted target set of one or more instructions stored in the return prediction stack to be the received set of one or more instructions in the next cycle by storing the predicted target set of one or more instructions in the instruction memory module.

2. The fetch unit of claim 1 , wherein the partial decode logic is further configured to, in response to determining that the received set of one or more instructions comprises a subroutine call and link instruction, predict a target address for the corresponding subroutine return instruction and store the predicted target address in the return prediction stack.

3. The fetch unit of claim 2 , wherein the partial decode logic is configured to cause the predicted target set of one or more instructions for the corresponding subroutine return instruction to be stored in the return prediction stack by:

determining whether the predicted target set of one or more instructions is a set of one or more instructions immediately following the received set of one or more instructions; and

in response to determining that the predicted target set of one or more instructions is the set of one or more instructions immediately following the received set of one or more instructions, causing the received set of one or more instructions in a next cycle to be stored in the return prediction stack.

4. The fetch unit of claim 3 , wherein the partial decode logic is further configured to determine whether a cache stage of the fetch-unit is fetching a set of one or more instructions in the current cycle; and the partial decode logic only causes the received set of one or more instructions in the next cycle to be stored in the return prediction stack if it is determined that the cache stage of the fetch unit is fetching a set of one or more instructions in the current cycle.

5. The fetch unit of claim 3 , wherein the partial decode logic is configured to determine whether the predicted target set of one or more instructions is a set of one or more instructions immediately following the received set of one or more instructions based on a format of the received set of one or more instructions.

6. The fetch unit of claim 3 , wherein the partial decode logic is configured to determine whether the predicted target set of one or more instructions is a set of one or more instructions immediately following the received set of one or more instructions based on the predicted target address.

7. The fetch unit of claim 3 , further comprising a flag; and wherein the partial decode logic is configured to cause the received set of one or more instructions in the next cycle to be stored in the return prediction stack by setting the flag.

8. The fetch unit of claim 7 , wherein the partial decode logic is further configured to determine whether the flag is set, and in response to determining that the flag is set, store the received set of one or more instructions in the return prediction stack.

9. The fetch unit of claim 3 , wherein the partial decode logic is configured to cause the predicted target set of one or more instructions for the corresponding subroutine return instruction to be stored in the return prediction stack by further:

determining whether the predicted target set of one or more instructions is the received set of one or more instructions; and

in response to determining that the predicted target set of one or more instructions is the received set of one or more instructions, storing the received set of one or more instructions in the return prediction stack.

10. The fetch unit of claim 2 , wherein the partial decode logic is configured to cause a predicted target set of one or more instructions stored in the return prediction stack to be the received set of one or more instructions in a next cycle by:

determining whether the return prediction stack comprises a valid predicted target set of one or more instructions; and

in response to determining that the return prediction stack comprises a valid predicted target set of one or more instructions, cause the valid predicted target set of one or more instructions in the return prediction stack to be the received set of one or more instructions in the next cycle.

11. The fetch unit of claim 10 , further comprising next bundle logic configured to, in response to the partial decode logic determining that the set of one or more instructions comprises a subroutine return instruction, generate an address for a next set of one or more instructions to be fetched based on a predicted target address stored in the return prediction stack.

12. The fetch unit of claim 11 , wherein the next bundle logic is configured to:

in response to the partial decode logic determining that the return prediction stack comprises a valid predicted target set of one or more instructions, generate the address for the next set of instructions to be fetched to be an address offset from the predicted target address stored in the return prediction stack; and in response to the partial decode logic determining that the return prediction stack does not comprise a valid predicted target set of one or more instructions, generate the address for the next set of one or more instructions to be fetched to be the predicted target address stored in the return prediction stack.

13. The fetch unit of claim 1 , wherein the partial decode logic is further configured to determine if the instruction memory module comprises a valid set of one or more instructions, and in response to determining that the instruction memory module comprises a valid set of one or more instructions, using the valid set of one or more instructions as the received set of one or more instructions.

14. The fetch unit of claim 1 , further comprising a return prediction stack controller configured to monitor updates to sets of one or more instructions in an instruction cache to determine if the updates affect one or more predicted target sets of one or more instructions stored in the return prediction stack; and in response to determining that an update affects one or more predicted target sets of one or more instructions stored in the return prediction stack, invalidate the one or more predicted sets of one or more instructions stored in the return prediction stack.

15. The fetch unit of claim 1 , wherein the received set of one or more instructions is an instruction bundle comprising two or more instructions.

16. A non-transitory computer readable storage medium having stored thereon computer readable program instructions that, when processed at a computer system cause the computer system to generate a representation of a processor comprising the fetch unit as set forth in claim 1 .

17. A method of fetching instructions in a multi-stage fetch unit of a processor, the method comprising, in a cycle:

receiving a set of one or more instructions for execution;

at least partially decoding the received set of one or more instructions to determine whether the received set of one or more instructions comprises a subroutine call and link instruction or a subroutine return instruction;

in response to determining that the received set of one or more instructions comprises a subroutine call and link instruction, causing a predicted target set of one or more instructions for a corresponding subroutine return instruction to be stored in a return prediction stack; and

in response to determining that the received set of one or more instructions comprises a subroutine return instruction, causing a predicted target set of one or more instructions stored in the return prediction stack to be the received set of one or more instructions in a next cycle, wherein causing a predicted target set of one or more instructions stored in the return prediction stack to be the received set of one or more instructions in a next cycle comprises storing the predicted target set of one or more instructions in an instruction memory module.

18. A non-transitory computer readable storage medium having stored thereon computer readable program instructions configured to perform the following steps in a cycle when the instructions are run on a computer:

receive a set of one or more instructions for execution;

at least partially decode the received set of one or more instructions to determine whether the received set of one or more instructions comprises a subroutine call and link instruction or a subroutine return instruction;

in response to determining that the received set of one or more instructions comprises a subroutine call and link instruction, cause a predicted target set of one or more instructions for a corresponding subroutine return instruction to be stored in a return prediction stack; and

in response to determining that the received set of one or more instructions comprises a subroutine return instruction, cause a predicted target set of one or more instructions stored in the return prediction stack to be the received set of one or more instructions in a next cycle, wherein causing a predicted target set of one or more instructions stored in the return prediction stack to be the received set of one or more instructions in a next cycle comprises storing the predicted target set of one or more instructions in an instruction memory module.

Assignments (7)
RELEASE OF SECURITY INTEREST Recorded Dec 29, 2022
From: CAPITAL FINANCE ADMINISTRATION, LLC, AS ADMINISTRATIVE AGENT
To: MIPS TECH, LLC; WAVE COMPUTING INC.
Reel/Frame 062251/0251 →
SECURITY INTEREST Recorded Jun 14, 2021
From: MIPS TECH, LLC; WAVE COMPUTING, INC.
To: CAPITAL FINANCE ADMINISTRATION, LLC
Reel/Frame 056558/0903 →
RELEASE OF SECURITY INTEREST Recorded Jun 14, 2021
From: WAVE COMPUTING LIQUIDATING TRUST
To: MIPS TECH, INC.; HELLOSOFT, INC.; WAVE COMPUTING (UK) LIMITED; IMAGINATION TECHNOLOGIES, INC.; CAUSTIC GRAPHICS, INC.; MIPS TECH, LLC; WAVE COMPUTING, INC.
Reel/Frame 056589/0606 →
SECURITY INTEREST Recorded Feb 26, 2021
From: WAVE COMPUTING, INC.; MIPS TECH, LLC; MIPS TECH, INC.; HELLOSOFT, INC.; WAVE COMPUTING (UK) LIMITED; IMAGINATION TECHNOLOGIES, INC.; CAUSTIC GRAPHICS, INC.
To: WAVE COMPUTING LIQUIDATING TRUST
Reel/Frame 055429/0532 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Apr 19, 2018
From: MIPS TECH LIMITED
To: MIPS TECH, LLC
Reel/Frame 045593/0662 →
CHANGE OF NAME Recorded Jan 26, 2018
From: HELLOSOFT LIMITED
To: MIPS TECH LIMITED
Reel/Frame 045168/0922 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 24, 2018
From: IMAGINATION TECHNOLOGIES LIMITED
To: HELLOSOFT LIMITED
Reel/Frame 045136/0975 →
Priority Claims (1)
GB 1517321.4 · Sep 30, 2015 · national
Continuity (1)
Related Publication 20170090933A1 · Mar 30, 2017