IP Library › Granted Patent US 8,874,884
Granted Patent B2
US 8,874,884 · App. 13/289,007 · Granted Oct 28, 2014

Selective writing of branch target buffer when number of instructions in cache line containing branch instruction is less than threshold

Inventors: Suresh K. Venkumahanti (Austin, TX); Lucian Codrescu (Austin, TX); Suman Mamidi (Austin, TX)
Assignee: QUALCOMM Incorporated
G06F9/3806G06F9/3844
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 8,874,884
App. No.
13/289,007
Granted
Oct 28, 2014
Kind
B2
Abstract

A method includes executing a branch instruction and determining if a branch is taken. The method further includes evaluating a number of instructions associated with the branch instruction. Upon determining that the branch is taken, the method includes selectively writing an entry into a branch target buffer that corresponds to the taken branch responsive to determining that the number of instructions is less than a threshold.

Claims (35)

1. A method of controlling execution of instructions at a processor, the method comprising:

executing a branch instruction and determining if a branch is taken;

evaluating a number of instructions in a cache line, of a plurality of cache lines of an instruction cache, that includes the branch instruction; and

upon determining that the branch is taken, selectively writing an entry into a branch target buffer that corresponds to the taken branch responsive to determining that the number of instructions is less than a threshold.

2. The method of claim 1 , wherein the threshold is determined based on a fetch latency of the processor.

3. The method of claim 1 , wherein the branch target buffer is not written for the taken branch when the number of instructions associated with the branch instruction is greater than or equal to the threshold.

4. The method of claim 1 , wherein the entry includes an address corresponding to the branch instruction and a target address corresponding to the taken branch.

5. The method of claim 4 , further comprising:

after writing the entry into the branch target buffer, fetching a line of instructions that includes the branch instruction; and

upon determining that the branch instruction corresponds to the entry in the branch target buffer, fetching the target address corresponding to the taken branch.

6. An apparatus comprising:

a branch target buffer;

an instruction cache, having a plurality of cache lines, that stores a plurality of instructions including a branch instruction; and

a processor to execute the branch instruction, the processor comprising:

control logic to:

evaluate a plurality of instructions including the branch instruction fetched from the instruction cache and determine if a branch is taken;

upon determining that the branch is taken, selectively write an entry into the branch target buffer that corresponds to the taken branch responsive to determining that a number of instructions in a cache line, of the plurality of cache lines, that includes the branch instruction fetched from the instruction cache is less than a threshold.

7. The apparatus of claim 6 , wherein the threshold is determined based on a fetch latency of the processor.

8. The apparatus of claim 6 , wherein the branch target buffer is not written for the taken branch when the number of instructions is greater than or equal to the threshold.

9. The apparatus of claim 6 , wherein the entry includes an address corresponding to the branch instruction and a target address corresponding to the taken branch.

10. The apparatus of claim 9 , wherein the control logic is further configured to:

fetch a line of instructions that includes the branch instruction, after writing the entry into the branch target buffer; and

fetch the target address corresponding to the taken branch, upon determining that the branch instruction corresponds to the entry in the branch target buffer.

11. An apparatus comprising:

means for executing a branch instruction and determining if a branch is taken;

means for evaluating a number of instructions in a cache line, of a plurality of cache lines of an instruction cache, that includes the branch instruction; and

means for selectively writing an entry into a branch target buffer that corresponds to the taken branch upon determining that the branch is taken and responsive to determining that the number of instructions is less than a threshold.

12. The apparatus of claim 11 , wherein the threshold is determined based on a fetch latency of the means for executing.

13. The apparatus of claim 11 , wherein the entry includes an address corresponding to the branch instruction and a target address corresponding to the taken branch.

14. A non-transitory computer-readable medium including program code that, when executed by a processor, causes the processor to:

execute a branch instruction and determine if a branch is taken;

evaluate a number of instructions in a cache line, of a plurality of cache lines of an instruction cache, that includes the branch instruction; and

upon determining that the branch is taken, selectively write an entry into a branch target buffer that corresponds to the taken branch responsive to determining that the number of instructions is less than a threshold.

15. The non-transitory computer-readable medium of claim 14 , wherein the threshold is determined based on a fetch latency of the processor, and wherein the branch target buffer is not written for the taken branch when the number of instructions is greater than or equal to the threshold.

16. The non-transitory computer-readable medium of claim 14 , wherein the entry includes an address corresponding to the branch instruction and a target address corresponding to the taken branch.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 4, 2011
From: VENKUMAHANTI, SURESH K.; CODRESCU, LUCIAN; MAMIDI, SUMAN
To: QUALCOMM INCORPORATED
Reel/Frame 027174/0172 →
Continuity (1)
Related Publication 20130117535A1 · May 9, 2013