From 21f8242430c7a1935a892aac1c26b970b306b113 Mon Sep 17 00:00:00 2001 From: Rekai Gonzalez Alberquilla Date: Tue, 5 May 2015 16:47:24 +0100 Subject: cpu: Change literal integer constants to meaningful labels fu_pool and inst_queue were using -1 for "no such FU" and -2 for "all those FUs are busy at the moment" when requesting for a FU and replying. This patch introduces new constants NoCapableFU and NoFreeFU respectively. In addition, the condition (idx == -2 || idx != -1) is equivalent to (idx != -1), so this patch also simplifies that. --HG-- extra : rebase_source : 4833717b9d1e09d7594d1f34f882e13fc4b86846 --- src/cpu/o3/inst_queue_impl.hh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/cpu/o3/inst_queue_impl.hh') diff --git a/src/cpu/o3/inst_queue_impl.hh b/src/cpu/o3/inst_queue_impl.hh index 516d526b1..7352c622b 100644 --- a/src/cpu/o3/inst_queue_impl.hh +++ b/src/cpu/o3/inst_queue_impl.hh @@ -801,21 +801,21 @@ InstructionQueue::scheduleReadyInsts() continue; } - int idx = -2; + int idx = FUPool::NoCapableFU; Cycles op_latency = Cycles(1); ThreadID tid = issuing_inst->threadNumber; if (op_class != No_OpClass) { idx = fuPool->getUnit(op_class); issuing_inst->isFloating() ? fpAluAccesses++ : intAluAccesses++; - if (idx > -1) { + if (idx > FUPool::NoFreeFU) { op_latency = fuPool->getOpLatency(op_class); } } // If we have an instruction that doesn't require a FU, or a // valid FU, then schedule for execution. - if (idx == -2 || idx != -1) { + if (idx != FUPool::NoFreeFU) { if (op_latency == Cycles(1)) { i2e_info->size++; instsToExecute.push_back(issuing_inst); -- cgit v1.2.3