coins.backend.gen
Class CodeGenerator_mb

java.lang.Object
  extended bycoins.backend.gen.CodeGenerator
      extended bycoins.backend.gen.CodeGenerator_mb

public class CodeGenerator_mb
extends CodeGenerator


Nested Class Summary
(package private)  class CodeGenerator_mb.CallContext
           
(package private) static class CodeGenerator_mb.MicroBlazeAttr
          MicroBlaze's function attribute
(package private)  class CodeGenerator_mb.RewrState
          State label for rewriting engine.
(package private)  class CodeGenerator_mb.State
          State label for instruction selection engine.
 
Nested classes inherited from class coins.backend.gen.CodeGenerator
CodeGenerator.FunctionAttr, CodeGenerator.LexpToString, CodeGenerator.Match
 
Field Summary
(package private)  boolean isSimulate
           
(package private)  boolean noUseBs
           
(package private)  boolean noUseDiv
           
(package private)  boolean noUseGp
           
(package private)  boolean noUseMul
           
(package private)  ImList regCallClobbers
           
(package private) static int REGWIDTH
           
(package private)  boolean softFloat
           
(package private)  CodeGenerator_mb.State[] stateVec
          State vector for labeling LIR nodes.
 
Fields inherited from class coins.backend.gen.CodeGenerator
addrType, asmWriter, convention, debOut, disableRewrite, F128, F32, F64, func, funcAttrTbl, I16, I32, I64, I8, INLINECOPYUNIT, lexpConv, lir, localEarlyRewritingTrig, localLateRewritingTrig, machineName, machineParams, module, optSpeed, ProcessFramesTrig, root, typeParamWord
 
Constructor Summary
CodeGenerator_mb()
          Create code generator engine.
 
Method Summary
(package private)  LirNode castToInt(LirNode src)
           
(package private)  java.lang.String defaultRegsetForType(int type)
          Return default register set for type.
(package private)  void emitCommon(java.io.PrintWriter out, SymStatic symbol, int bytes)
          Emit data common
(package private)  java.lang.String emitLir(LirNode node)
          Expand emit-macro for LirNode.
(package private)  java.lang.String emitList(ImList form, boolean topLevel)
          Expand emit-macro for list form.
(package private)  boolean eqReg(java.lang.String reg, LirNode node)
           
(package private)  java.lang.Object expandBuildMacro(ImList form)
          Expand building-macro.
(package private)  int getCost1(LirNode t, int goal)
          Return the cost for LIR node t and goal nonterminal goal.
(package private)  int getCost2(LirNode t, int goal)
           
(package private)  Rule getRule(LirNode t, int goal)
          Return the chosen rule for LIR node t and goal nonterminal goal.
(package private)  void initializeMachineDep()
          Do Machine-dependent initialization (subclass may override this).
(package private)  void initLabeling(LirFactory lir)
          Initialize for labeling.
(package private)  void initRewriteLabeling()
          Initialization for rewriting.
(package private)  boolean isMemNode(LirNode arg)
           
(package private)  java.lang.Object jmac1(LirNode x)
           
(package private)  java.lang.String jmac10(java.lang.String x)
           
(package private)  java.lang.String jmac11(java.lang.Object f)
           
(package private)  java.lang.String jmac12(java.lang.Object f, java.lang.String rettype)
           
(package private)  java.lang.Object jmac2(LirNode x)
           
(package private)  java.lang.String jmac3(java.lang.String x)
           
(package private)  java.lang.String jmac4(java.lang.String format, java.lang.Object args)
           
(package private)  java.lang.String jmac5()
           
(package private)  java.lang.String jmac6(java.lang.String reg1, java.lang.String reg2)
           
(package private)  java.lang.String jmac7(java.lang.String c1, java.lang.String c2)
           
(package private)  java.lang.String jmac8(java.lang.String c1, java.lang.String c2)
           
(package private)  java.lang.String jmac9(java.lang.String x)
           
(package private)  void labelTree(LirNode t)
          Label LIR tree t.
(package private)  boolean needTempArea(LirNode src)
           
(package private)  CodeGenerator.FunctionAttr newFunctionAttr(Function func)
          Prepare new function attribute information.
(package private)  java.lang.Object quiltLir(LirNode node)
          Expand building-macro, for LirNode
(package private)  LirNode rewriteCall(LirNode node, BiList pre, BiList post, boolean dry)
           
(package private)  LirNode rewriteEpilogue(LirNode node, BiList pre)
          Rewrite EPILOGUE
(package private)  LirNode rewriteFrame(LirNode node)
          Rewrite FRAME node to target machine form.
(package private)  LirNode rewriteJumpc(LirNode node, BiList pre, java.lang.String rtl, int n)
           
(package private)  boolean rewriteMul(LirNode node)
           
(package private)  LirNode rewritePrologue(LirNode node, BiList post)
          Rewrite PROLOGUE
(package private)  LirNode rewriteRtlCall(LirNode node, BiList pre, java.lang.String rtl, int n)
           
(package private)  LirNode rewriteTree(LirNode tree, java.lang.String phase, BiList pre, BiList post)
          Rewrite L-expression.
(package private)  java.lang.String showLabel(LirNode t)
          Return label state
(package private)  int startNT()
          Return start nonterminal symbol.
 
Methods inherited from class coins.backend.gen.CodeGenerator
alignForType, buildCode, clcvnClobbers, clcvnParamMem, clcvnParamOffset, clcvnParamReg, clcvnParamWord, clcvnPartialWord, clcvnPassFloatRegMem, clcvnRegLimit, clcvnReturnValue, clcvnSetPartialWord, clcvnStructReturnAsFirst, clcvnStructReturnPtr, close, codeInfo, convToAsm, dropRegToFrame, earlyRewritingSequence, emitAlign, emitAsmCode, emitBeginningOfModule, emitBeginningOfSegment, emitCode, emitCodeLabel, emitComment, emitData, emitDataLabel, emitEndOfModule, emitEndOfSegment, emitIdent, emitLinkage, emitLirDefault, emitListDefault, emitNamedConst, emitObject, emitObjectX, emitSegment, emitTop, emitZeros, equalArg, frameIsEmpty, frameSize, genHeader, genTrailer, getFunctionAttr, getMachineParams, initialize, insertPostProcessor, instructionSelection, isComplex, isSimple, lateRewritingSequence, makeAsmSymbol, makeLabelDef, mapRegToFrame, nActualOperands, noRescan, notifyEndToPostProcessor, paramOffset, paramToBeSaved, peepHoleOpt, phyReg, prepareCodeInfo, prerewrite, printLabel, quiltLirDefault, reduce, reserveFrame, rewriteAggregateCopy, rewriteAsm, rewriteCall, rewriteCONVFU, rewriteCONVUF, rewriteJumpn, segmentForConst, setAsmStream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stateVec

CodeGenerator_mb.State[] stateVec
State vector for labeling LIR nodes. Suffix is a LirNode's id.


softFloat

boolean softFloat

noUseGp

boolean noUseGp

noUseBs

boolean noUseBs

noUseMul

boolean noUseMul

noUseDiv

boolean noUseDiv

isSimulate

boolean isSimulate

regCallClobbers

ImList regCallClobbers

REGWIDTH

static final int REGWIDTH
See Also:
Constant Field Values
Constructor Detail

CodeGenerator_mb

public CodeGenerator_mb()
Create code generator engine.

Method Detail

initRewriteLabeling

void initRewriteLabeling()
Description copied from class: CodeGenerator
Initialization for rewriting.

Specified by:
initRewriteLabeling in class CodeGenerator

rewriteTree

LirNode rewriteTree(LirNode tree,
                    java.lang.String phase,
                    BiList pre,
                    BiList post)
Rewrite L-expression.

Specified by:
rewriteTree in class CodeGenerator

defaultRegsetForType

java.lang.String defaultRegsetForType(int type)
Return default register set for type.

Specified by:
defaultRegsetForType in class CodeGenerator

initLabeling

void initLabeling(LirFactory lir)
Description copied from class: CodeGenerator
Initialize for labeling.

Specified by:
initLabeling in class CodeGenerator

showLabel

java.lang.String showLabel(LirNode t)
Description copied from class: CodeGenerator
Return label state

Specified by:
showLabel in class CodeGenerator

labelTree

void labelTree(LirNode t)
Description copied from class: CodeGenerator
Label LIR tree t.

Specified by:
labelTree in class CodeGenerator

getRule

Rule getRule(LirNode t,
             int goal)
Description copied from class: CodeGenerator
Return the chosen rule for LIR node t and goal nonterminal goal.

Specified by:
getRule in class CodeGenerator

getCost1

int getCost1(LirNode t,
             int goal)
Description copied from class: CodeGenerator
Return the cost for LIR node t and goal nonterminal goal.

Specified by:
getCost1 in class CodeGenerator

getCost2

int getCost2(LirNode t,
             int goal)
Specified by:
getCost2 in class CodeGenerator

startNT

int startNT()
Description copied from class: CodeGenerator
Return start nonterminal symbol.

Specified by:
startNT in class CodeGenerator

expandBuildMacro

java.lang.Object expandBuildMacro(ImList form)
Expand building-macro.

Specified by:
expandBuildMacro in class CodeGenerator

quiltLir

java.lang.Object quiltLir(LirNode node)
Expand building-macro, for LirNode

Specified by:
quiltLir in class CodeGenerator

emitList

java.lang.String emitList(ImList form,
                          boolean topLevel)
Expand emit-macro for list form.

Specified by:
emitList in class CodeGenerator

emitLir

java.lang.String emitLir(LirNode node)
Expand emit-macro for LirNode.

Specified by:
emitLir in class CodeGenerator

newFunctionAttr

CodeGenerator.FunctionAttr newFunctionAttr(Function func)
Description copied from class: CodeGenerator
Prepare new function attribute information.

Overrides:
newFunctionAttr in class CodeGenerator

initializeMachineDep

void initializeMachineDep()
Description copied from class: CodeGenerator
Do Machine-dependent initialization (subclass may override this).

Overrides:
initializeMachineDep in class CodeGenerator

jmac1

java.lang.Object jmac1(LirNode x)

jmac2

java.lang.Object jmac2(LirNode x)

jmac3

java.lang.String jmac3(java.lang.String x)

jmac4

java.lang.String jmac4(java.lang.String format,
                       java.lang.Object args)

jmac5

java.lang.String jmac5()

jmac6

java.lang.String jmac6(java.lang.String reg1,
                       java.lang.String reg2)

jmac7

java.lang.String jmac7(java.lang.String c1,
                       java.lang.String c2)

jmac8

java.lang.String jmac8(java.lang.String c1,
                       java.lang.String c2)

jmac9

java.lang.String jmac9(java.lang.String x)

jmac10

java.lang.String jmac10(java.lang.String x)

jmac11

java.lang.String jmac11(java.lang.Object f)

jmac12

java.lang.String jmac12(java.lang.Object f,
                        java.lang.String rettype)

emitCommon

void emitCommon(java.io.PrintWriter out,
                SymStatic symbol,
                int bytes)
Description copied from class: CodeGenerator
Emit data common

Overrides:
emitCommon in class CodeGenerator

eqReg

boolean eqReg(java.lang.String reg,
              LirNode node)

rewriteMul

boolean rewriteMul(LirNode node)

castToInt

LirNode castToInt(LirNode src)

needTempArea

boolean needTempArea(LirNode src)

isMemNode

boolean isMemNode(LirNode arg)

rewriteCall

LirNode rewriteCall(LirNode node,
                    BiList pre,
                    BiList post,
                    boolean dry)

rewritePrologue

LirNode rewritePrologue(LirNode node,
                        BiList post)
Description copied from class: CodeGenerator
Rewrite PROLOGUE

Overrides:
rewritePrologue in class CodeGenerator

rewriteEpilogue

LirNode rewriteEpilogue(LirNode node,
                        BiList pre)
Description copied from class: CodeGenerator
Rewrite EPILOGUE

Overrides:
rewriteEpilogue in class CodeGenerator

rewriteFrame

LirNode rewriteFrame(LirNode node)
Description copied from class: CodeGenerator
Rewrite FRAME node to target machine form.

Overrides:
rewriteFrame in class CodeGenerator

rewriteRtlCall

LirNode rewriteRtlCall(LirNode node,
                       BiList pre,
                       java.lang.String rtl,
                       int n)

rewriteJumpc

LirNode rewriteJumpc(LirNode node,
                     BiList pre,
                     java.lang.String rtl,
                     int n)