65,81d64
< # This builds either a regular or macro op to implement the sequence of
< # ops we give it.
< def genInst(name, Name, ops):
< # If we can implement this instruction with exactly one microop, just
< # use that directly.
< newStmnt = ''
< if len(ops) == 1:
< decode_block = "return %s;" % \
< ops[0].getAllocator()
< return ('', '', decode_block, '')
< else:
< # Build a macroop to contain the sequence of microops we've
< # been given.
< return genMacroOp(name, Name, ops)
< }};
<
< let {{
190,197c173,174
< # specified. Now we'll assemble it it into a microOp sequence.
< ops = assembleMicro(code)
<
< # Build a macroop to contain the sequence of microops we've
< # constructed. The decode block will be used to fill in our
< # inner decode structure, and the rest will be concatenated and
< # passed back.
< return genInst(name, Name, ops)
---
> # specified. Now we'll assemble it it into a StaticInst.
> return assembleMicro(name, Name, code)
205a183,189
> # These are used when setting up microops so that they can specialize their
> # base class template properly.
> RegOpType = "RegisterOperand"
> ImmOpType = "ImmediateOperand"
> }};
>
> let {{
245,255d228
< let {{
< def buildLabelDict(ops):
< labels = {}
< micropc = 0
< for op in ops:
< if op.label:
< labels[op.label] = count
< micropc += 1
< return labels
< }};
<
257c230,231
< def assembleMicro(code):
---
> def assembleMicro(name, Name, code):
>
344c318,319
< labels = buildLabelDict(statements)
---
>
> labels = {}
346a322,326
> if statement.label:
> labels[statement.label] = count
> micropc += 1
> micropc = 0
> for statement in statements:
356c336,346
< return statements
---
>
> # If we can implement this instruction with exactly one microop, just
> # use that directly.
> if len(statements) == 1:
> decode_block = "return %s;" % \
> statements[0].getAllocator()
> return ('', '', decode_block, '')
> else:
> # Build a macroop to contain the sequence of microops we've
> # been given.
> return genMacroOp(name, Name, statements)