コード例 #1
0
ファイル: bpredictor.cpp プロジェクト: pwnall/pset_writeups
  void makeUpdate(BOOL takenActually, BOOL takenPredicted, ADDRINT address) {
    bool p1Accurate = (predictor1.makePrediction(address) == takenActually);
    bool p2Accurate = (predictor2.makePrediction(address) == takenActually);

    predictor1.makeUpdate(takenActually, takenPredicted, address);
    predictor2.makeUpdate(takenActually, takenPredicted, address);

    bool selectorPrediction = selector.makePrediction(address);
    if (p1Accurate != p2Accurate) {
      selector.makeUpdate(p1Accurate, selectorPrediction, address);
    }
    selector.historyUpdate(takenActually, selectorPrediction, address);
  }
コード例 #2
0
ファイル: bpredictor.cpp プロジェクト: pwnall/pset_writeups
 BOOL makePrediction(ADDRINT address) {
   return (selector.makePrediction(address)) ?
       predictor1.makePrediction(address) : predictor2.makePrediction(address);
 }