File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -650,8 +650,20 @@ struct FullBTBPrediction
650650 } else {
651651 // uncond
652652 taken = true ;
653- pc = entry.pc ; // get the pc of the cond branch
653+ pc = entry.pc ; // get the pc of the uncond branch
654654 target = entry.target ;
655+ // indirect target should come from ipred or ras,
656+ // or btb itself when ipred miss
657+ if (entry.isIndirect ) {
658+ if (!entry.isReturn ) { // normal indirect, see ittage
659+ auto it = IndirectTakens_find (indirectTargets, pc);
660+ if (it != indirectTargets.end ()) { // found in ittage, use it
661+ target = it->second ;
662+ }
663+ } else { // indirect return, use RAS target
664+ target = returnTarget;
665+ }
666+ } // else: normal taken, use btb target
655667 break ;
656668 }
657669 }
You can’t perform that action at this time.
0 commit comments