20 likes | 67 Views
Branch prediction plays a crucial role in optimizing program performance. Understand the concepts of correct and incorrect branch predictions, fixed, static, and dynamic strategies, and prediction outcomes for different scenarios.
E N D
Hargnemiste ennustamine( Branch Prediction) a ÕIGE Siiret eeldati ja tuli Predict taken branch taken Siire toimub Branch taken Ei ole siirdekäsk not Branch Inst p c VALE Siiret ei eeldatud siire tuli Predict not taken branch taken 1-p b 1-p c p t c p b ÕIGE Siiret ei eeldatud ja ei tulnud Predict not taken branch not taken d p c 1-p t Siirdekäsk Branch Inst. VALE Siiret eeldati aga siiret ei tulnud Predict taken branch not taken 1-p c b C ave = a(pt pc)+b(1-pt)(1-pc)+ +c pt(1-pc)+d(1-pt)pc
Hargnemiste ennustamine II • Strateegiad : • Fikseeritud hargnemiste ennustamine Fixed Branch Prediction • Staatiline hargnemiste ennustamine Static Branch Prediction • Dünaamiline hargnemiste ennustamine Dynamic Branch Prediction Hargnemist ei tulnud 00 Ennustus: hargnemist ei tule Hargnemine 01 Ennustus: hargnemist ei tule Hargnemist ei tulnud Hargnemist ei tulnud Hargnemine 10 Ennustus: hargnemine 11 Ennustus: hargnemine Hargnemine Hargnemist ei tulnud Hargnemine Hargnemine Ennustus b1 b2