signature IL = sig structure P: PARSER structure PP: PPC structure D: DYNARRAY datatype vregClass = VR4 | VR8 type vreg = int type label = int datatype setArg = SaVReg of vreg | SaConst of word | SaAddr of P.nid * word datatype accessClass = AC1 | AC2 | AC4 | AC8 datatype cmpOp = Cmpeq | Cmpneq | Cmpul | Cmpug | Cmpule | Cmpuge | Cmpsl | Cmpsg | Cmpsle | Cmpsge datatype irIns = IrSet of vreg * setArg | IrAdd of vreg * vreg * vreg | IrSub of vreg * vreg * vreg | IrMul of vreg * vreg * vreg | IrIMul of vreg * vreg * vreg | IrDiv of vreg * vreg * vreg | IrIDiv of vreg * vreg * vreg | IrMod of vreg * vreg * vreg | IrIMod of vreg * vreg * vreg | IrShr of vreg * vreg * vreg | IrShl of vreg * vreg * vreg | IrSar of vreg * vreg * vreg | IrAnd of vreg * vreg * vreg | IrOr of vreg * vreg * vreg | IrXor of vreg * vreg * vreg | IrCmp of cmpOp * vreg * vreg * vreg | IrExtZero of vreg * vreg * accessClass | IrExtSign of vreg * vreg * accessClass | IrLoad of vreg * vreg * accessClass (* %1 <- [%2] *) | IrStore of vreg * vreg * accessClass (* [%1] <- %2 *) | IrJmpc of cmpOp * vreg * vreg * label | IrJz of vreg * label | IrJnz of vreg * label | IrJmp of label | IrRet of vreg option | IrAlloc of vreg * word * int option | IrCopy of vreg * label * word | IrFcall of vreg * vreg * vreg list | IrNopLabel of label | IrNop of string datatype ev = Reg of vreg | Addr of vreg datatype regType = RtReg | RtRem | RtConst of word | RtAddrConst of int * word type regInfo = { class: vregClass, use: int list, defs: int list, t: regType, canFold: bool } val Pwc: (vregClass, word, 'a, 'b, 'c) a2printer val Pac: (accessClass, 'a, 'b, 'c) a1printer val Pl: (label, 'a, 'b, 'c) a1printer val wrapTo8: word -> word datatype funcType = FtLeaf | FtNonLeaf datatype funcInfo = Fi of { name: int, paramNum: int, localBound: int, t: funcType, vregs: regInfo D.t, ops: (irIns option * (label * label) option) D.t, labels: int option D.t } datatype ctx = Ctx of { objs: P.objDef list, objsZI: P.objDef list, extSyms: P.nid list, globSyms: P.nid list, funcInfos: funcInfo list, strlits: int list } val createCtx: P.progInfo -> string option -> ctx end