IP Library Granted Patent US 7,475,231
Granted Patent B2
US 7,475,231 · App. 11/273,691 · Granted Jan 6, 2009

Loop detection and capture in the instruction queue

Assignee: Texas Instruments Incorporated
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 7,475,231
App. No.
11/273,691
Granted
Jan 6, 2009
Kind
B2
Abstract

A system and a method to identify a conditional branch instruction having a program counter and a target address, and increment a loop count each time the program counter and the target address equal a stored program counter and a target address. The system and method additionally includes assignment of a start loop pointer and an end loop pointer, based on an offset, when the loop count is equal to a threshold value, and capturing instructions for a loop, as defined by the start loop pointer and the end loop pointer, in an instruction queue.

Claims (45)

1. A system, comprising:

a pipeline in which a plurality of instructions are processed;

an execution unit coupled to the pipeline;

an instruction cache coupled to the pipeline;

a branch prediction module;

a fetch unit, coupled to the pipeline, for placing instructions for a loop in an instruction queue; and

detection logic, coupled to the pipeline, for:

identifying a conditional branch instruction having a program counter and a target address;

incrementing a loop count when the program counter and the target address equal a stored program counter and a stored target address; and

detecting a loop when the loop count equals a threshold value.

2. The system of claim 1 , wherein the system comprises at least one of a battery-operated device and a wireless device.

3. The system of claim 1 , wherein the branch prediction module stores the loop count and an offset to a start of the loop in place of the target address for a non-conditional branch instruction.

4. The system of claim 1 , wherein the instruction queue sets up a start pointer and an end pointers to execute the instructions for the loop instructions solely from instruction queue.

5. The system of claim 1 , wherein the instruction queue sets up a start pointer and an end pointers to execute the instructions for the loop solely from instruction queue, wherein the loop comprises a nested loop.

6. The system of claim 1 , wherein the detection logic further assigns an offset to a start of the loop; and executes instructions from the instruction queue for the loop of instructions defined by the start pointer and the end pointer.

7. The system of claim 1 , wherein the detection logic is further detects one or more nested loops; maintain a loop count for each nested loop; and assign one or more pointers to define a start and an end of the loop for each nested loop.

8. The system of claim 1 , further comprising gating logic that shuts down the branch prediction module and the instruction cache while the execution unit executes the loop from the instruction queue.

9. A processor, comprising:

memory;

a fetch logic for fetching one or more instructions from the memory;

an instruction queue for receiving one or more loop instructions;

an execution unit for executing a loop from the instruction queue;

detection logic for detecting a loop in the plurality of instructions when a loop counter equals a threshold value, the detection logic comprising:

branch prediction logic for identifying one or more conditional branch instructions, each conditional branch instruction having a program counter and a target address; and

increment logic adapted increment the loop counter when the program counter and the target address are equal to a stored program counter and a stored target address.

10. The processor of claim 9 , further comprising gating logic for shutting down the branch prediction logic and the fetch logic while the execution unit executes the loop from the instruction queue.

11. The processor of claim 9 , wherein the fetch logic fetches instructions for a loop and place the instructions for the loop in the instruction queue for execution.

12. The processor of claim 9 , wherein the detection logic detects one or more nested loops in the plurality of instructions and the execution unit executes the nested loop from the instruction queue.

13. The processor of claim 9 , wherein the branch prediction module stores the loop count and offset for loop prediction in place of a target address for a non-conditional branch instruction.

14. A method, comprising:

identifying a conditional branch instruction having a program counter and a target address;

incrementing a loop count each time the program counter and the target address equal a stored program counter and a stored target address;

assigning an offset to start of the loop when the loop count is equal to a threshold value; and

capturing instructions for a loop in an instruction queue, the loop defined by a start loop pointer and a end loop pointer.

15. The method of claim 14 , wherein the threshold number is hard coded.

16. The method of claim 14 , wherein the threshold number is programmable.

17. The method of claim 14 , wherein capturing instructions further comprises:

fetching instructions for the loop from a cache; and

placing instructions for the loop in the instruction queue.

18. The method of claim 14 , further comprising shutting down one or more modules while executing instructions from the instruction queue.

19. The method of claim 14 , further comprising:

having set a start pointer, identifying a second conditional branch instruction having a second program counter and a second target address;

incrementing an outer loop count each time the second program counter and the second target address equal an outer loop stored program counter and an outer loop stored target address;

assigning a start outer loop pointer and an end outer loop pointer when the inner loop count is equal to a second threshold value; and

executing the instructions for an outer loop from the instruction queue, the outer loop defined by the start outer loop pointer and the end outer loop pointer.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 14, 2005
From: TRAN, THANG M.
To: TEXAS INSTRUMENTS INCORPORATED
Reel/Frame 017237/0388 →
Continuity (1)
Related Publication 20070113059A1 · May 17, 2007