IP Library Granted Patent US 12,450,068
Granted Patent B2
US 12,450,068 · App. 18/358,890 · Granted Oct 21, 2025

Biased conditional instruction prediction

Inventors: Deepankar Duggal (Sunnyvale, CA); Pruthivi Vuyyuru (San Jose, CA); Ian D Kountanis (Sunnyvale, CA)
Assignee: Apple Inc.
G06F9/3806G06F9/30072
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 12,450,068
App. No.
18/358,890
Granted
Oct 21, 2025
Kind
B2
Abstract

A processor may include a conditional instruction prediction tracking circuit. During fetch of a conditional instruction from memory to an instruction cache of the processor, the conditional instruction prediction tracking circuit may predict whether the conditional instruction is biased. Responsive to a prediction that the conditional instruction is biased, the conditional instruction prediction tracking circuit may cause the conditional instruction to be executed according to the predicted bias. Sometimes the conditional prediction tracking circuit may cause the conditional instruction to be re-coded such that it may be executed as an unconditional instruction.

Claims (88)

1. A processor, comprising:

a prefetch circuit configured to fetch instructions including a conditional instruction from memory to an instruction cache; and

a prediction circuit configured to:

predict, during fetch of the conditional instruction to the instruction cache, whether the conditional instruction is biased to a condition outcome affecting a data flow for the instruction; and

responsive to a prediction that the conditional instruction is biased, cause the conditional instruction to be executed according to the predicted bias of the conditional instruction.

2. The processor of claim 1 , wherein to predict whether the conditional instruction is biased, the prediction circuit is configured to:

identify a prediction value for the conditional instruction from a prediction table; and

provide the prediction based on the prediction value for the conditional instruction.

3. The processor of claim 2 , wherein the prediction table comprises one or more entries corresponding respectively to one or more conditional instructions, and wherein an entry for a particular conditional instruction comprises:

an index associated with the particular conditional instruction; and

a prediction value for the particular conditional instruction, wherein the prediction value is one of:

a first value representing that no prediction has been provided for the particular conditional instruction;

a second value representing that the particular conditional instruction is biased false;

a third value representing that the particular conditional instruction is biased true; or

a fourth value representing that the particular conditional instruction is not biased.

4. The processor of claim 3 , wherein the index associated with the particular conditional instruction is generated based on hashing an address associated with the particular conditional instruction.

5. The processor of claim 3 , wherein to generate the entry for the conditional instruction, the prediction circuit is configured to:

determine whether the prediction table includes an entry corresponding to the conditional instruction;

responsive to a determination that the prediction table does not include the entry corresponding to the conditional instruction:

set the prediction value for the conditional instruction to the first value;

obtain a resolution result of the condition of the conditional instruction; and

update the prediction value from the first value to the second or third value based on the resolution result; and

responsive to a determination that the prediction table includes the entry for the conditional instruction and the prediction value of the entry is the second or third value:

obtain a resolution result of the condition of the conditional instruction;

determine whether the prediction of the resolution instruction matches the resolution result; and

responsive to a determination that the prediction does not match the resolution result, update the prediction value from the second or third value to the fourth value; and

responsive to a determination that the prediction table includes the entry for the conditional instruction and the prediction value of the entry is the fourth value, maintain the prediction value as the fourth value.

6. The processor of claim 5 , wherein to update the prediction value from the first value to the second or third value based on the resolution result, the prediction circuit is configured to:

generate a prediction value for the conditional instruction in a buffer based on the resolution result of the condition of the conditional instruction;

determine whether the conditional instruction becomes non-speculative; and

responsive to the determination that the conditional instruction becomes non-speculative, update the prediction value for the conditional instruction in the prediction table to the second or third value according to the prediction value in the buffer.

7. The processor of claim 5 , wherein responsive to a determination that the prediction does not match the resolution result, the prediction circuit is configured to cause the conditional instruction to be re-fetched by the prefetch circuit from the memory to the instruction cache.

8. The processor of claim 1 , wherein the conditional instruction is a conditional select instruction, and wherein responsive to the prediction that the conditional select instruction is biased, the prediction circuit is configured to cause the conditional select instruction to be re-coded to a move instruction.

9. The processor of claim 1 , wherein the conditional instruction is one of a conditional select instruction, a conditional set instruction, a conditional set mask instruction, a conditional increment instruction, a conditional invert instruction, a conditional negate instruction, a conditional select increment instruction, a conditional select invert instruction, or a conditional select negate instruction.

10. The processor of claim 1 , wherein the instructions fetched by the prefetch circuit includes a conditional branch instruction, and wherein the prediction circuit is configured to:

predict, during fetch of the conditional branch instruction to the instruction cache, whether the conditional branch instruction is biased using the same prediction table as the conditional instruction.

11. A system, comprising:

one or more processors individually comprising an instruction cache;

memory configured to store instructions; and

a display configured to display images;

wherein the processors individually comprise:

a prefetch circuit configured to fetch at least some of the instructions from the memory to the instruction cache of the individual processor, wherein the at least some instructions include a conditional instruction; and

a prediction circuit configured to:

predict, during fetch of the conditional instruction to the instruction cache, whether the conditional instruction is biased to a condition outcome affecting a data flow for the instruction; and

responsive to a prediction that the conditional instruction is biased, cause the conditional instruction to be executed according to the predicted bias of the conditional instruction.

12. The system of claim 11 , wherein to predict whether the conditional instruction is biased, the prediction circuit is further configured to:

identify a prediction value for the conditional instruction from a prediction table; and

provide the prediction based on the prediction value for the conditional instruction.

13. The system of claim 12 , wherein the prediction table comprises one or more entries corresponding respectively to one or more conditional instructions, and wherein an entry for a particular conditional instruction comprises:

an index associated with the particular conditional instruction; and

a prediction value for the particular conditional instruction, wherein the prediction value is one of:

a first value representing that no prediction has been provided for the particular conditional instruction;

a second value representing that the particular conditional instruction is biased false;

a third value representing that the particular conditional instruction is biased true; or

a fourth value representing that the particular conditional instruction is not biased.

14. The system of claim 13 , wherein the index associated with the particular conditional instruction is generated based on hashing an address associated with the particular conditional instruction.

15. The system of claim 13 , wherein to generate the entry for the conditional instruction, the prediction circuit is configured to:

determine whether the prediction table includes an entry corresponding to the conditional instruction;

responsive to a determination that the prediction table does not include the entry corresponding to the conditional instruction:

set the prediction value for the conditional instruction to the first value;

obtain a resolution result of the condition of the conditional instruction; and

update the prediction value from the first value to the second or third value based on the resolution result; and

responsive to a determination that the prediction table includes the entry for the conditional instruction and the prediction value of the entry is the second or third value:

obtain a resolution result of the condition of the conditional instruction;

determine whether the prediction of the resolution instruction matches the resolution result; and

responsive to a determination that the prediction does not match the resolution result, update the prediction value from the second or third value to the fourth value; and

responsive to a determination that the prediction table includes the entry for the conditional instruction and the prediction value of the entry is the fourth value, maintain the prediction value as the fourth value.

16. The system of claim 15 , wherein to update the prediction value from the first value to the second or third value based on the resolution result, the prediction circuit is configured to:

generate a prediction value for the conditional instruction in a buffer based on the resolution result of the condition of the conditional instruction;

determine whether the conditional instruction becomes non-speculative; and

responsive to the determination that the conditional instruction becomes non-speculative,

update the prediction value for the conditional instruction in the prediction table to the second or third value according to the prediction value in the buffer.

17. The system of claim 11 , wherein the conditional instruction is a conditional select instruction, and wherein responsive to the prediction that the conditional select instruction is biased, the prediction circuit is configured to cause the conditional select instruction to be re-coded to a move instruction.

18. A method, comprising:

fetching instructions, including a conditional instruction, by a prefetch circuit of a processor from memory to an instruction cache;

predicting, during fetching of the conditional instruction to the instruction cache, by a bias prediction circuit of the processor whether the conditional instruction is biased to a condition outcome affecting a data flow for the instruction; and

responsive to a prediction that the conditional instruction is biased, executing, by the processor, the conditional instruction according to the predicted bias of the conditional instruction.

19. The method of claim 18 , wherein predicting whether the conditional instruction is biased comprises:

identifying a prediction value for the conditional instruction from a prediction table; and

providing the prediction based on the prediction value for the conditional instruction;

wherein the prediction table comprises one or more entries corresponding respectively to one or more conditional instructions, and wherein an entry for a particular conditional instruction comprises:

an index associated with the particular conditional instruction; and

a prediction value for the particular conditional instruction, wherein the prediction value is one of:

a first value representing that no prediction has been provided for the particular conditional instruction;

a second value representing that the particular conditional instruction is biased false;

a third value representing that the particular conditional instruction is biased true; or

a fourth value representing that the particular conditional instruction is not biased.

20. The method of claim 18 , wherein the conditional instruction is a conditional select instruction, and wherein executing the conditional instruction according to the predicted bias of the conditional instruction comprises re-coding the conditional select instruction to a move instruction.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jul 22, 2024
From: KOUNTANIS, IAN D
To: APPLE INC.
Reel/Frame 068588/0866 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 7, 2023
From: DUGGAL, DEEPANKAR; VUYYURU, PRUTHIVI
To: APPLE INC.
Reel/Frame 064508/0716 →
Continuity (1)
Related Publication 20250036415A1 · Jan 30, 2025
References Cited (94)
US 5142634A · Fite et al. · 1992 [cited by applicant]
US 5287467A · Blaner · 1994 [cited by applicant]
US 5644779A · Song · 1997 [cited by applicant]
US 5870579A · Tan · 1999 [cited by applicant]
US 5920710A · Tan · 1999 [cited by applicant]
US 6157998A · Rupley, II · 2000 [cited by applicant]
US 6240510B1 · Yeh · 2001 [cited by applicant]
US 6304960B1 · Yeh · 2001 [cited by applicant]
US 6308322B1 · Serocki · 2001 [cited by applicant]
US 6430682B1 · Dwyer, III · 2002 [cited by examiner]
US 6571331B2 · Henry et al. · 2003 [cited by applicant]
US 7302556B2 · Ludden et al. · 2007 [cited by applicant]
US 7434037B2 · Park et al. · 2008 [cited by applicant]
US 7809933B2 · Levitan · 2010 [cited by applicant]
US 7814298B1 · Thaik · 2010 [cited by applicant]
US 8055492B2 · Adir · 2011 [cited by applicant]
US 8521996B2 · Henry et al. · 2013 [cited by applicant]
US 9122487B2 · Golla · 2015 [cited by applicant]
US 9465615B2 · Smeets et al. · 2016 [cited by applicant]
US 9489203B2 · Dundas · 2016 [cited by applicant]
US 9529595B2 · Lin · 2016 [cited by applicant]
US 10209993B2 · Wang · 2019 [cited by applicant]
US 10235173B2 · Rasale · 2019 [cited by applicant]
US 10379858B2 · Branscome · 2019 [cited by applicant]
US 10795683B2 · Eickemeyer · 2020 [cited by applicant]
US 10866805B2 · Grisenthwaite · 2020 [cited by applicant]
US 10901484B2 · Blasco · 2021 [cited by applicant]
US 11061677B1 · Seth · 2021 [cited by applicant]
US 11169807B2 · Bhat et al. · 2021 [cited by applicant]
US 11269638B2 · Zbiciak · 2022 [cited by applicant]
US 11379240B2 · Al-Otoom · 2022 [cited by applicant]
US 11416256B2 · Evers · 2022 [cited by applicant]
US 11449343B2 · Gonion · 2022 [cited by applicant]
US 11809874B2 · Schuchman et al. · 2023 [cited by applicant]
US 12067399B2 · Kountanis et al. · 2024 [cited by applicant]
US 20010032309A1 · Henry · 2001 [cited by examiner]
US 20020040429A1 · Dowling · 2002 [cited by examiner]
US 20040003215A1 · Krimer · 2004 [cited by applicant]
US 20040093485A1 · Nguyen et al. · 2004 [cited by applicant]
US 20040210749A1 · Biles · 2004 [cited by applicant]
US 20040225866A1 · Williamson · 2004 [cited by applicant]
US 20060026408A1 · Morris · 2006 [cited by applicant]
US 20080059779A1 · Davis · 2008 [cited by applicant]
US 20080077781A1 · Smith · 2008 [cited by applicant]
US 20080162905A1 · Luick · 2008 [cited by applicant]
US 20090249037A1 · Webber · 2009 [cited by applicant]
US 20100031010A1 · Moyer · 2010 [cited by applicant]
US 20100064123A1 · Zuraski et al. · 2010 [cited by applicant]
US 20100274972A1 · Babayan et al. · 2010 [cited by applicant]
US 20120079255A1 · Combs et al. · 2012 [cited by applicant]
US 20120124346A1 · Hardage · 2012 [cited by applicant]
US 20130007425A1 · Cantin · 2013 [cited by applicant]
US 20130067202A1 · Henry · 2013 [cited by applicant]
US 20140156977A1 · Dechene · 2014 [cited by applicant]
US 20140156978A1 · Al-Otoom · 2014 [cited by applicant]
US 20140195790A1 · Merten · 2014 [cited by applicant]
US 20150052338A1 · Kuwahara et al. · 2015 [cited by applicant]
US 20150277916A1 · Khartikov · 2015 [cited by applicant]
US 20150363203A1 · Lipasti · 2015 [cited by applicant]
US 20160026470A1 · Manoukian · 2016 [cited by applicant]
US 20170075689A1 · Branscome · 2017 [cited by examiner]
US 20170153894A1 · Hornung · 2017 [cited by applicant]
US 20170322810A1 · Navada · 2017 [cited by examiner]
US 20180101385A1 · Wang · 2018 [cited by applicant]
US 20180173533A1 · Soundararajan · 2018 [cited by examiner]
US 20190004802A1 · Tarsa · 2019 [cited by applicant]
US 20190004803A1 · Al Sheikh · 2019 [cited by applicant]
US 20200110615A1 · Ishii et al. · 2020 [cited by applicant]
US 20200151019A1 · Yu · 2020 [cited by applicant]
US 20200167163A1 · Levenstein · 2020 [cited by applicant]
US 20210240476A1 · Kountanis · 2021 [cited by applicant]
US 20220113976A1 · Kothinti Naresh et al. · 2022 [cited by applicant]
US 20220121446A1 · Mcdonald · 2022 [cited by applicant]
US 20230244494A1 · Kountanis et al. · 2023 [cited by applicant]
US 20230244495A1 · Schuchman et al. · 2023 [cited by applicant]
CN 102156634A · 2011 [cited by applicant]
CN 104423929 · 2017 [cited by applicant]
CN 110321160A · 2019 [cited by applicant]
CN 113383320A · 2021 [cited by applicant]
CN 114637537A · 2022 [cited by applicant]
EP 2063355 · 2017 [cited by applicant]
JP 6273718 · 2018 [cited by applicant]
WO 2009066063 · 2009 [cited by applicant]
WO 2017072615 · 2017 [cited by applicant]
A. Seznec, et. al., “A case for (partially) TAggged GEometric history length branch prediction”, Retrieved from https://iilp.org/vol8/v8paper1.pdf, 2006 AI Access Foundation and Morgan Kaufmann Publishers, pp. 1-23. [cited by applicant]
A. Seznec, “A 256 Kbits L-TAGE branch predictor”, Retrieved from https://www.irisa.fr/caps/people/seznec/L-TAGE.pdf, Journal of Instruction-Level Parallelism (JILP) Special Issue: The Second Championship Branch Predicti… [cited by applicant]
Biswa, “Lecture-10 (Branch Prediction) CS422-Spring 2018”, Retrieved from https://www.cse.iitk.ac.in/users/biswap/CS422/L10-BP.pdf, 2018, pp. 1-16. [cited by applicant]
International Search Report and Written Opinion from PCT/US2023/011993, dated May 24, 2023, pp. 1-12. [cited by applicant]
U.S. Appl. No. 17/590,722, filed Feb. 1, 2022, Schuchman et al. [cited by applicant]
U.S. Appl. No. 17/590,719, filed Feb. 1, 2022, Kountanis, et al. [cited by applicant]
U.S. Appl. No. 18/358,894, filed Jul. 25, 2023, Al-Otoom et al. [cited by applicant]
International Search Report and the Written Opinion from International Application No. PCT/US2024/039401, dated Oct. 31, 2024, pp. 1-11. [cited by applicant]
U.S. Appl. No. 18/774,678, filed Jul. 16, 2024, Kountanis, et al. [cited by applicant]
Daniel A. Jimenez and Calvin Lin, “branch Path Re-Aliasing,” Proceedings of the 4th Workshop on Feedback Directed and Dynamic Optimization (FDDO-4), pp. 1-10, 2001. [cited by applicant]