O3 IEW: Make incrWb and decrWb clearer
authorJoel Hestness <hestness@cs.wisc.edu>
Sat, 19 Jan 2013 21:14:54 +0000 (15:14 -0600)
committerJoel Hestness <hestness@cs.wisc.edu>
Sat, 19 Jan 2013 21:14:54 +0000 (15:14 -0600)
Move the increment/decrement of wbOutstanding outside of the comparison
in incrWb and decrWb in the IEW. This also fixes a compiler bug with gcc
4.4.7, which incorrectly optimizes "-- ==" as "-=".

src/cpu/o3/iew.hh

index 5adf32752c3febf249e08fb5f26aad69ff7148bd..1213cf12b2a53df9c5fe8d7d63943ad6abe048ce 100644 (file)
@@ -213,7 +213,8 @@ class DefaultIEW
 
     void incrWb(InstSeqNum &sn)
     {
-        if (++wbOutstanding == wbMax)
+        ++wbOutstanding;
+        if (wbOutstanding == wbMax)
             ableToIssue = false;
         DPRINTF(IEW, "wbOutstanding: %i [sn:%lli]\n", wbOutstanding, sn);
         assert(wbOutstanding <= wbMax);
@@ -224,8 +225,9 @@ class DefaultIEW
 
     void decrWb(InstSeqNum &sn)
     {
-        if (wbOutstanding-- == wbMax)
+        if (wbOutstanding == wbMax)
             ableToIssue = true;
+        wbOutstanding--;
         DPRINTF(IEW, "wbOutstanding: %i [sn:%lli]\n", wbOutstanding, sn);
         assert(wbOutstanding >= 0);
 #ifdef DEBUG