Deleted Added
sdiff udiff text old ( 11783:f94c14fd6561 ) new ( 13626:d6a6358aa6db )
full compact
1/*
2 * Copyright (c) 2011-2012, 2014 ARM Limited
3 * Copyright (c) 2010 The University of Edinburgh
4 * All rights reserved
5 *
6 * The license below extends only to copyright in the software and shall
7 * not be construed as granting a license to any other intellectual
8 * property including but not limited to intellectual property relating

--- 161 unchanged lines hidden (view full) ---

170 /**
171 * Updates the BP with taken/not taken information.
172 * @param inst_PC The branch's PC that will be updated.
173 * @param taken Whether the branch was taken or not taken.
174 * @param bp_history Pointer to the branch predictor state that is
175 * associated with the branch lookup that is being updated.
176 * @param squashed Set to true when this function is called during a
177 * squash operation.
178 * @todo Make this update flexible enough to handle a global predictor.
179 */
180 virtual void update(ThreadID tid, Addr instPC, bool taken,
181 void *bp_history, bool squashed) = 0;
182 /**
183 * Updates the BTB with the target of a branch.
184 * @param inst_PC The branch's PC that will be updated.
185 * @param target_PC The branch's target that will be added to the BTB.
186 */
187 void BTBUpdate(Addr instPC, const TheISA::PCState &target)
188 { BTB.update(instPC, target, 0); }
189

--- 5 unchanged lines hidden (view full) ---

195 private:
196 struct PredictorHistory {
197 /**
198 * Makes a predictor history struct that contains any
199 * information needed to update the predictor, BTB, and RAS.
200 */
201 PredictorHistory(const InstSeqNum &seq_num, Addr instPC,
202 bool pred_taken, void *bp_history,
203 ThreadID _tid)
204 : seqNum(seq_num), pc(instPC), bpHistory(bp_history), RASTarget(0),
205 RASIndex(0), tid(_tid), predTaken(pred_taken), usedRAS(0), pushedRAS(0),
206 wasCall(0), wasReturn(0), wasIndirect(0)
207 {}
208
209 bool operator==(const PredictorHistory &entry) const {
210 return this->seqNum == entry.seqNum;
211 }
212
213 /** The sequence number for the predictor history entry. */
214 InstSeqNum seqNum;

--- 28 unchanged lines hidden (view full) ---

243 /** Whether or not the instruction was a call. */
244 bool wasCall;
245
246 /** Whether or not the instruction was a return. */
247 bool wasReturn;
248
249 /** Wether this instruction was an indirect branch */
250 bool wasIndirect;
251 };
252
253 typedef std::deque<PredictorHistory> History;
254
255 /** Number of the threads for which the branch history is maintained. */
256 const unsigned numThreads;
257
258

--- 80 unchanged lines hidden ---