From: megacz Date: Thu, 8 Jan 2009 21:13:28 +0000 (-0800) Subject: update Context.java to new head/abort/tail scheme X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=fa85a1f75e82fe7afe187ff4ac5dcda625ac4432;p=fleet.git update Context.java to new head/abort/tail scheme --- diff --git a/src/edu/berkeley/fleet/ir/Context.java b/src/edu/berkeley/fleet/ir/Context.java index a196660..229ce1b 100644 --- a/src/edu/berkeley/fleet/ir/Context.java +++ b/src/edu/berkeley/fleet/ir/Context.java @@ -351,6 +351,9 @@ public class Context { // Set the OLC (it might previously have been zero) ic.add(new Set(dock, false, Predicate.IgnoreFlagD, SetDest.OuterLoopCounter, count==0 ? 1 : count)); + if (count!=1) { + ic.add(new Instruction.Head(dock)); + } for(Instruction i : instructions) { if (i instanceof Move && (((Move)i).tokenIn || ((Move)i).dataIn)) @@ -366,7 +369,6 @@ public class Context { numInstructionsNotIncludingNonblockingPrefix > dock.getInstructionFifoSize()) throw new RuntimeException("instruction sequence is too long for instruction fifo at " + dock); } else { - ic.add(new Instruction.Head(dock)); if (count != 0) { ic.add(new Instruction.Set(dock, true, Predicate.Default, SetDest.OuterLoopCounter, SetSource.Decrement)); if (blockingInstructionEncountered) @@ -374,6 +376,9 @@ public class Context { loopSize++; } } + if (count!=1) { + ic.add(new Instruction.Abort(dock, Predicate.FlagD)); + } if (autoflush && !"Debug".equals(dock.getShip().getType()) && next==null) { if (dock.isInputDock()) ic.add(new Instruction.Flush(dock, true, Predicate.FlagD));