summaryrefslogtreecommitdiff
path: root/src/cpu/o3/iew_impl.hh
diff options
context:
space:
mode:
authorNathan Binkert <binkertn@umich.edu>2006-12-20 22:20:11 -0800
committerNathan Binkert <binkertn@umich.edu>2006-12-20 22:20:11 -0800
commit9aecfb3e3bfe1b85db9468bad287f22a2eb9bd4e (patch)
treed4b2cbff99ca89ea77011552ab5e57b2435b1326 /src/cpu/o3/iew_impl.hh
parent4b3538b609cfcce0891ee5ef7d690646a6030166 (diff)
downloadgem5-9aecfb3e3bfe1b85db9468bad287f22a2eb9bd4e.tar.xz
don't use (*activeThreads).begin(), use activeThreads->blah().
Also don't call (*activeThreads).end() over and over. Just call activeThreads->end() once and save the result. Make sure we always check that there are elements in the list before we grab the first one. --HG-- extra : convert_revision : d769d8ed52da99532d57a9bbc93e92ddf22b7e58
Diffstat (limited to 'src/cpu/o3/iew_impl.hh')
-rw-r--r--src/cpu/o3/iew_impl.hh40
1 files changed, 23 insertions, 17 deletions
diff --git a/src/cpu/o3/iew_impl.hh b/src/cpu/o3/iew_impl.hh
index 76047b295..d239bd951 100644
--- a/src/cpu/o3/iew_impl.hh
+++ b/src/cpu/o3/iew_impl.hh
@@ -671,10 +671,12 @@ DefaultIEW<Impl>::skidCount()
{
int max=0;
- std::list<unsigned>::iterator threads = (*activeThreads).begin();
+ std::list<unsigned>::iterator threads = activeThreads->begin();
+ std::list<unsigned>::iterator end = activeThreads->end();
- while (threads != (*activeThreads).end()) {
- unsigned thread_count = skidBuffer[*threads++].size();
+ while (threads != end) {
+ unsigned tid = *threads++;
+ unsigned thread_count = skidBuffer[tid].size();
if (max < thread_count)
max = thread_count;
}
@@ -686,10 +688,13 @@ template<class Impl>
bool
DefaultIEW<Impl>::skidsEmpty()
{
- std::list<unsigned>::iterator threads = (*activeThreads).begin();
+ std::list<unsigned>::iterator threads = activeThreads->begin();
+ std::list<unsigned>::iterator end = activeThreads->end();
+
+ while (threads != end) {
+ unsigned tid = *threads++;
- while (threads != (*activeThreads).end()) {
- if (!skidBuffer[*threads++].empty())
+ if (!skidBuffer[tid].empty())
return false;
}
@@ -702,11 +707,10 @@ DefaultIEW<Impl>::updateStatus()
{
bool any_unblocking = false;
- std::list<unsigned>::iterator threads = (*activeThreads).begin();
+ std::list<unsigned>::iterator threads = activeThreads->begin();
+ std::list<unsigned>::iterator end = activeThreads->end();
- threads = (*activeThreads).begin();
-
- while (threads != (*activeThreads).end()) {
+ while (threads != end) {
unsigned tid = *threads++;
if (dispatchStatus[tid] == Unblocking) {
@@ -1226,9 +1230,10 @@ DefaultIEW<Impl>::executeInsts()
wbNumInst = 0;
wbCycle = 0;
- std::list<unsigned>::iterator threads = (*activeThreads).begin();
+ std::list<unsigned>::iterator threads = activeThreads->begin();
+ std::list<unsigned>::iterator end = activeThreads->end();
- while (threads != (*activeThreads).end()) {
+ while (threads != end) {
unsigned tid = *threads++;
fetchRedirect[tid] = false;
}
@@ -1469,11 +1474,12 @@ DefaultIEW<Impl>::tick()
// Free function units marked as being freed this cycle.
fuPool->processFreeUnits();
- std::list<unsigned>::iterator threads = (*activeThreads).begin();
+ std::list<unsigned>::iterator threads = activeThreads->begin();
+ std::list<unsigned>::iterator end = activeThreads->end();
// Check stall and squash signals, dispatch any instructions.
- while (threads != (*activeThreads).end()) {
- unsigned tid = *threads++;
+ while (threads != end) {
+ unsigned tid = *threads++;
DPRINTF(IEW,"Issue: Processing [tid:%i]\n",tid);
@@ -1513,8 +1519,8 @@ DefaultIEW<Impl>::tick()
// nonspeculative instruction.
// This is pretty inefficient...
- threads = (*activeThreads).begin();
- while (threads != (*activeThreads).end()) {
+ threads = activeThreads->begin();
+ while (threads != end) {
unsigned tid = (*threads++);
DPRINTF(IEW,"Processing [tid:%i]\n",tid);