IP Library Granted Patent US 9,483,272
Granted Patent B2
US 9,483,272 · App. 14/502,027 · Granted Nov 1, 2016

Systems and methods for managing return stacks in a multi-threaded data processing system

Inventors: Jeffrey W. Scott (Austin, TX); William C. Moyer (Austin, TX); Alistair P. Robertson (Glasgow, GB)
Assignee: FREESCALE SEMICONDUCTOR, INC.
G06F9/3806G06F9/322
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 9,483,272
App. No.
14/502,027
Granted
Nov 1, 2016
Kind
B2
Abstract

A processor is configured to execute instructions of a first thread and a second thread. A first return stack corresponds to the first thread, and a second return stack to the second thread. Control circuitry pushes a return address to the first return stack in response to a branch to subroutine instruction in the first thread. If the first return stack is full and borrowing is not enabled by the borrow enable indicator, the control circuitry removes an oldest return address from the first return stack and not store the removed oldest return address in the second return stack. If the first return stack is full and borrowing is enabled by the borrow enable indicator and the second thread is not enabled, the control circuitry removes the oldest return address from the first return stack and push the removed oldest return address onto the second return stack.

Claims (50)

1. A data processing system, comprising:

a processor configured to execute processor instructions of a first thread and processor instructions of a second thread;

a first return stack corresponding to the first thread;

a second return stack corresponding to the second thread;

storage circuitry configured to store a borrow enable indicator corresponding to the second return stack which indicates whether borrowing entries from the second return stack is enabled; and

control circuitry configured to push a return address to the first return stack in response to a branch to subroutine instruction in the first thread, wherein:

if the first return stack is full and borrowing is not enabled by the borrow enable indicator, the control circuitry is configured to remove an oldest return address from the first return stack and not store the removed oldest return address in the second return stack, and

if the first return stack is full and borrowing is enabled by the borrow enable indicator and the second thread is not enabled, the control circuitry is configured to remove the oldest return address from the first return stack and push the removed oldest return address onto the second return stack.

2. The data processing system of claim 1 , wherein the control circuitry is configured to pop a return address from the first return stack in response to a branch from subroutine instruction in the first thread, wherein:

if the second return stack is not empty and borrowing is enabled by the borrow enable indicator and the second thread is not enabled, the control circuitry is configured to pop a return address from the second return stack and store the return address popped from the second return stack in the first return stack as the oldest return address of the first stack.

3. The data processing system of claim 2 , wherein if borrowing is not enabled by the borrow enable indicator when the pop from the first return stack is performed, the control circuitry is configured to maintain an oldest return address of the first return stack as the oldest return address of the first return stack.

4. The data processing system of claim 2 , wherein the control circuitry provides the popped return address to the processor as a branch target address of the branch from subroutine instruction.

5. The data processing system of claim 1 , wherein the return address pushed to the first return stack in response to the branch to subroutine instruction corresponds to an instruction address of a subsequent instruction which immediately follows the branch instruction.

6. The data processing system of claim 1 , further comprising:

a first branch target buffer (BTB) corresponding to the first thread, the first branch target buffer having a plurality of entries, each entry comprising a branch instruction address field, a branch target address field, a pop field, and a push field;

a second branch target buffer (BTB) corresponding to the second thread, the second branch target buffer having a plurality of entries each entry comprising a branch instruction address field, a branch target address field, a pop field, and a push field;

first BTB control circuitry coupled to the first BTB and the first return stack; and

second BTB control circuitry coupled to the second BTB and the second return stack.

7. The data processing system of claim 6 , wherein the first BTB control circuitry is configured to determine whether a branch instruction address of the branch to subroutine instruction hits or misses in the first BTB, and when the branch instruction address hits in the first BTB, the first BTB control circuitry is configured to provide a hit signal and a push signal to the control circuitry, wherein the control circuitry is configured to perform the push of the return address in response to the hit signal and the push signal.

8. The data processing system of claim 7 , wherein when the branch instruction address misses in the first BTB, the first BTB control circuitry allocates an entry in the first BTB for the branch to subroutine instruction, wherein a target address of the branch to subroutine instruction is stored in the branch target address field of the allocated entry and the push field of the allocated entry is asserted.

9. The data processing system of claim 7 , wherein when the branch instruction addresses misses in the first BTB, the processor is configured to resolve the branch to subroutine instruction and provide a processor push signal to the control circuitry in response thereto, wherein the first BTB control circuitry is configured to perform the push of the return address in response to the hit signal and the processor push signal.

10. The data processing system of claim 6 , wherein the control circuitry is configured to pop a return address from the first return stack in response to a branch from subroutine instruction in the first thread, wherein:

if the second return stack is not empty and borrowing is enabled by the borrow enable indicator and the second thread is not enabled, the control circuitry is configured to pop a return address from the second return stack and store the return address popped from the second return stack in the first return stack as the oldest return address of the first stack.

11. The data processing system of claim 10 , wherein the first BTB control circuitry is configured to determine whether a branch instruction address of the branch from subroutine instruction hits or misses in the first BTB, and when the branch instruction address hits in the first BTB, the first BTB control circuitry is configured to provide a hit signal and a pop signal to the control circuitry, wherein the control circuitry is configured to perform the pop of the return address in response to the hit signal and the pop signal.

12. The data processing system of claim 10 , wherein when the branch instruction address misses in the first BTB, the first BTB control circuitry allocates an entry in the first BTB for the branch from subroutine instruction, wherein a target address is not stored in the branch target address field of the allocated entry and the pop field of the allocated entry is asserted.

13. The data processing system of claim 10 , wherein when the branch instruction addresses misses in the first BTB, the processor is configured to resolve the branch from subroutine instruction and provide a processor pop signal to the control circuitry in response thereto, wherein the first BTB control circuitry is configured to perform the pop of the return address in response to the hit signal and the processor pop signal.

14. The data processing system of claim 1 , wherein the borrow enable indicator indicates whether borrowing is enabled for the first thread from the second return stack.

15. The data processing system of claim 14 , wherein the storage circuitry is further configured to store a second borrow enable indicator corresponding to the first return stack which indicates whether borrowing is enabled for the second thread from the first return stack.

16. A method implemented in a data processing system configured to execute processor instructions of a first thread and processor instructions of a second thread and having a first return stack corresponding to the first thread and a second return stack corresponding to the second thread, the method comprises:

receiving a branch to subroutine instruction of the first thread;

pushing a return address corresponding to the branch to subroutine instruction onto the first return stack;

when the first return stack is full and borrowing entries from the second return stack is enabled and the second thread is not enabled, the method further comprises removing an oldest return address from the first return stack and pushing the removed oldest return address onto the second return stack; and

when the first return stack is full and borrowing entries from the second return stack is not enabled, removing the oldest return address of the first return stack and not storing the removed oldest return address in the second return stack.

17. The method of claim 16 , further comprising:

receiving a branch from subroutine instruction of the first thread;

popping a return address corresponding to the branch from subroutine instruction from the first return stack;

when the second return stack is not empty and borrowing entries from the second return stack is enabled and the second thread is not enabled, popping a return address from the second return stack and storing the popped return address from the second return stack into the first return stack as an oldest address of the first return stack; and

providing the return address popped from the first return stack as a branch target address for the branch from subroutine instruction.

18. The method of claim 17 wherein when borrowing is not enabled by the borrow enable indicator when popping the return address, maintaining an oldest return address of the first return stack as the oldest return address of the first return stack.

19. A data processing system, comprising:

a processor configured to execute processor instructions of a first thread and processor instructions of a second thread;

a first return stack corresponding to the first thread;

a second return stack corresponding to the second thread;

storage circuitry configured to store a borrow enable indicator corresponding to the second return stack which indicates whether borrowing entries from the second return stack is enabled; and

control circuitry configured to:

push a return address to the first return stack in response to a branch to subroutine instruction in the first thread, wherein:

if the first return stack is full and borrowing is enabled by the borrow enable indicator and the second thread is not enabled, the control circuitry is configured to remove the oldest return address from the first return stack and push the removed oldest return address onto the second return stack, and

pop a return address from the first return stack in response to a branch from subroutine instruction in the first thread and provide the popped return address to the processor as a branch target address for the branch from subroutine instruction, wherein:

if the second return stack is not empty and borrowing is enabled by the borrow enable indicator and the second thread is not enabled, the control circuitry is configured to pop a return address from the second return stack and store the return address popped from the second return stack in the first return stack as the oldest return address of the first stack.

20. The data processing system of claim 19 , wherein the return address pushed to the first return stack in response to the branch to subroutine instruction corresponds to an instruction address of a subsequent instruction which immediately follows the branch instruction.

Assignments (14)
CORRECTIVE ASSIGNMENT TO CORRECT THE REMOVE APPLICATION 11759915 AND REPLACE IT WITH APPLICATION 11759935 PREVIOUSLY RECORDED ON REEL 040925 FRAME 0001. ASSIGNOR(S) HEREBY CONFIRMS THE RELEASE OF SECURITY INTEREST. Recorded Feb 17, 2020
From: MORGAN STANLEY SENIOR FUNDING, INC.
To: NXP, B.V. F/K/A FREESCALE SEMICONDUCTOR, INC.
Reel/Frame 052917/0001 →
CORRECTIVE ASSIGNMENT TO CORRECT THE REMOVE APPLICATION 11759915 AND REPLACE IT WITH APPLICATION 11759935 PREVIOUSLY RECORDED ON REEL 040928 FRAME 0001. ASSIGNOR(S) HEREBY CONFIRMS THE RELEASE OF SECURITY INTEREST. Recorded Jan 17, 2020
From: MORGAN STANLEY SENIOR FUNDING, INC.
To: NXP B.V.
Reel/Frame 052915/0001 →
RELEASE OF SECURITY INTEREST Recorded Sep 10, 2019
From: MORGAN STANLEY SENIOR FUNDING, INC.
To: NXP B.V.
Reel/Frame 050744/0097 →
MERGER Recorded Jan 3, 2017
From: FREESCALE SEMICONDUCTOR, INC.
To: NXP USA, INC.
Reel/Frame 041144/0363 →
RELEASE OF SECURITY INTEREST Recorded Nov 7, 2016
From: MORGAN STANLEY SENIOR FUNDING, INC.
To: NXP B.V.
Reel/Frame 040928/0001 →
RELEASE OF SECURITY INTEREST Recorded Sep 21, 2016
From: MORGAN STANLEY SENIOR FUNDING, INC.
To: NXP, B.V., F/K/A FREESCALE SEMICONDUCTOR, INC.
Reel/Frame 040925/0001 →
SUPPLEMENT TO THE SECURITY AGREEMENT Recorded Jun 16, 2016
From: FREESCALE SEMICONDUCTOR, INC.
To: MORGAN STANLEY SENIOR FUNDING, INC.
Reel/Frame 039138/0001 →
ASSIGNMENT AND ASSUMPTION OF SECURITY INTEREST IN PATENTS Recorded Jan 7, 2016
From: CITIBANK, N.A.
To: MORGAN STANLEY SENIOR FUNDING, INC.
Reel/Frame 037458/0460 →
ASSIGNMENT AND ASSUMPTION OF SECURITY INTEREST IN PATENTS Recorded Jan 7, 2016
From: CITIBANK, N.A.
To: MORGAN STANLEY SENIOR FUNDING, INC.
Reel/Frame 037458/0502 →
PATENT RELEASE Recorded Dec 21, 2015
From: CITIBANK, N.A., AS COLLATERAL AGENT
To: FREESCALE SEMICONDUCTOR, INC.
Reel/Frame 037357/0921 →
SUPPLEMENT TO IP SECURITY AGREEMENT Recorded Nov 4, 2014
From: FREESCALE SEMICONDUCTOR, INC.
To: CITIBANK, N.A., AS NOTES COLLATERAL AGENT
Reel/Frame 034160/0370 →
SUPPLEMENT TO IP SECURITY AGREEMENT Recorded Nov 4, 2014
From: FREESCALE SEMICONDUCTOR, INC.
To: CITIBANK, N.A., AS NOTES COLLATERAL AGENT
Reel/Frame 034160/0351 →
SUPPLEMENT TO IP SECURITY AGREEMENT Recorded Nov 4, 2014
From: FREESCALE SEMICONDUCTOR, INC.
To: CITIBANK, N.A., AS NOTES COLLATERAL AGENT
Reel/Frame 034153/0027 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 30, 2014
From: SCOTT, JEFFREY W.; MOYER, WILLIAM C.; ROBERTSON, ALISTAIR P.
To: FREESCALE SEMICONDUCTOR, INC.
Reel/Frame 033853/0136 →
Continuity (1)
Related Publication 20160092229A1 · Mar 31, 2016