From 0be64ffe2f4ff8824b3084362706ffbf456ea490 Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Sat, 31 May 2014 18:00:23 -0700 Subject: style: eliminate equality tests with true and false Using '== true' in a boolean expression is totally redundant, and using '== false' is pretty verbose (and arguably less readable in most cases) compared to '!'. It's somewhat of a pet peeve, perhaps, but I had some time waiting for some tests to run and decided to clean these up. Unfortunately, SLICC appears not to have the '!' operator, so I had to leave the '== false' tests in the SLICC code. --- src/cpu/o3/iew_impl.hh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/cpu/o3/iew_impl.hh') diff --git a/src/cpu/o3/iew_impl.hh b/src/cpu/o3/iew_impl.hh index 3c133ff0c..644366dfc 100644 --- a/src/cpu/o3/iew_impl.hh +++ b/src/cpu/o3/iew_impl.hh @@ -487,7 +487,7 @@ DefaultIEW::squashDueToBranch(DynInstPtr &inst, ThreadID tid) DPRINTF(IEW, "[tid:%i]: Squashing from a specific instruction, PC: %s " "[sn:%i].\n", tid, inst->pcState(), inst->seqNum); - if (toCommit->squash[tid] == false || + if (!toCommit->squash[tid] || inst->seqNum < toCommit->squashedSeqNum[tid]) { toCommit->squash[tid] = true; toCommit->squashedSeqNum[tid] = inst->seqNum; @@ -517,7 +517,7 @@ DefaultIEW::squashDueToMemOrder(DynInstPtr &inst, ThreadID tid) // case the memory violator should take precedence over the branch // misprediction because it requires the violator itself to be included in // the squash. - if (toCommit->squash[tid] == false || + if (!toCommit->squash[tid] || inst->seqNum <= toCommit->squashedSeqNum[tid]) { toCommit->squash[tid] = true; @@ -538,7 +538,7 @@ DefaultIEW::squashDueToMemBlocked(DynInstPtr &inst, ThreadID tid) { DPRINTF(IEW, "[tid:%i]: Memory blocked, squashing load and younger insts, " "PC: %s [sn:%i].\n", tid, inst->pcState(), inst->seqNum); - if (toCommit->squash[tid] == false || + if (!toCommit->squash[tid] || inst->seqNum < toCommit->squashedSeqNum[tid]) { toCommit->squash[tid] = true; @@ -1314,7 +1314,7 @@ DefaultIEW::executeInsts() } // If the store had a fault then it may not have a mem req - if (fault != NoFault || inst->readPredicate() == false || + if (fault != NoFault || !inst->readPredicate() || !inst->isStoreConditional()) { // If the instruction faulted, then we need to send it along // to commit without the instruction completing. @@ -1339,7 +1339,7 @@ DefaultIEW::executeInsts() // will be replaced and we will lose it. if (inst->getFault() == NoFault) { inst->execute(); - if (inst->readPredicate() == false) + if (!inst->readPredicate()) inst->forwardOldRegs(); } -- cgit v1.2.3