The MLTREE signature


Synopsis

signature MLTREE

Interface

structure Constant : CONSTANT
structure PseudoOp : PSEUDO_OPS
datatype cond
  = LT
  | LTU
  | LE
  | LEU
  | EQ
  | NEQ
  | GE
  | GEU
  | GT
  | GTU
datatype order
  = LR
  | RL
datatype stm
  = MV of (int * rexp)
  | FMV of (int * fexp)
  | CCMV of (int * ccexp)
  | COPY of (int list * int list)
  | FCOPY of (int list * int list)
  | JMP of (rexp * Label.label list)
  | CALL of (rexp * mlrisc list * mlrisc list)
  | RET
  | STORE8 of (rexp * rexp)
  | STORE32 of (rexp * rexp)
  | STORED of (rexp * fexp)
  | STORECC of (rexp * ccexp)
  | BCC of (cond * ccexp * Label.label)
  | FBCC of (cond * ccexp * Label.label)
datatype rexp
  = REG of int
  | LI of int
  | LI32 of Word32.word
  | LABEL of LabelExp.labexp
  | CONST of Constant.const
  | ADD of (rexp * rexp)
  | SUB of (rexp * rexp * order)
  | MULU of (rexp * rexp)
  | DIVU of (rexp * rexp * order)
  | ADDT of (rexp * rexp)
  | MULT of (rexp * rexp)
  | SUBT of (rexp * rexp * order)
  | DIVT of (rexp * rexp * order)
  | LOAD8 of rexp
  | LOAD32 of rexp
  | ANDB of (rexp * rexp)
  | ORB of (rexp * rexp)
  | XORB of (rexp * rexp)
  | SRA of (rexp * rexp * order)
  | SRL of (rexp * rexp * order)
  | SLL of (rexp * rexp * order)
  | SEQ of (stm * rexp)
datatype fexp
  = FREG of int
  | LOADD of rexp
  | FADDD of (fexp * fexp)
  | FMULD of (fexp * fexp)
  | FSUBD of (fexp * fexp * order)
  | FDIVD of (fexp * fexp * order)
  | FABSD of fexp
  | FNEGD of fexp
  | CVTI2D of rexp
  | FSEQ of (stm * fexp)
datatype ccexp
  = CC of int
  | LOADCC of rexp
  | CMP of (cond * rexp * rexp * order)
  | FCMP of (cond * fexp * fexp * order)
datatype mlrisc
  = CCR of ccexp
  | GPR of rexp
  | FPR of fexp
datatype mltree
  = DEFINELABEL of Label.label
  | PSEUDO_OP of PseudoOp.pseudo_op
  | BEGINCLUSTER
  | CODE of stm
  | ESCAPEBLOCK of mlrisc list
  | ENDCLUSTER of int Array.array ref list

Description

structure Constant
A structure describing front end specific abstract constants.

structure PseudoOp
A structure describing the set of front end pseudo ops used. Pseudo ops can be designed to suit the needs of front end in generating either machine or assembly code.

datatype cond
Allowable conditions typically used in comparisons and branch operations.

datatype order
Describes the order of evaluation of multi-argument operators. Where the order of evaluation is important but not specified it is assumed to be LR (for left-to-right).

datatype stm
stm descripes operations that are executed for effect and do not return a value. The exception is the CALL construct that may return multiple values.
MV(r, rexp), FMV(f, fexp), CCMV(cc, ccexp)
assigns the value of an expression to a register of the appropriate type.
COPY(dstList, srcList), FCOPY(dstList, srcList)
copies in parallel, registers in srcList to registers in dstList. COPY is used for general REG registers and FCOPY for floating FREG registers.
JMP(exp, labels)
Jumps to the address whose value is exp. The list of labels is a hint of the possible branch targets. This is useful with computed gotos.
CALL(exp, defs, uses)
Performs a call to the address whose value is exp. The return address is put in the register or location that is conventional for the host machine. defs and uses are the list of resources defined and used by this call. Only the registers in these lists are meaningful.
RET
Performs a return using the address saved in CALL.
STORE8(ea, byte), STORE32(ea, word32), STORED(ea, real64), STORECC(ea, cc)
Stores the value of an expression into memory.
BCC(cond, ccexp, lab), FBCC(cond, ccexp, lab)
If the condition specified by cond is satisfied by the conditional expression ccexp, then control transfers to the label lab. If ccexp is a comparison operation such as CMP or FCMP, then the condition being tested for must in the comparison operation must be identical to cond. Thus it is invalid to generate something like:
        BCC(GT, CMP(LT, REG(100), REG(200), LR), label)
		
This error is not currently detected.

BCC is used for integer values and FBCC for floating point values.



datatype rexp
rexp describes operations that return integer values.
REG(r)
represents registers holding integer values. If there are M physical integer registers, then REG(i) 0 <= i < M represents these registers and anything else is a pseudo register.
LI(i), LI32(w32)
Returns a value representing the integer i or the 32 bit unsigned integer w32. LI and LI32 are redundant as it is possible to represent all the required constant integer bit patterns using LI32. The two constructs are provided because the internal representation of integers is more compact than unsigned 32 bit integers.
LABEL(labexp)
returns the value representing the label expression labexp.
LOAD8(ea), LOAD32(ea)
LOAD8(ea) Loads the byte from the address represented by ea. LOAD32 loads a 32-bit value.
ADD(re1,re2), SUB(re1,re2,ord)
Returns the arithmetic operation over two integer expressions.
ADDT(re1,re2), SUBT(re1,re2), MULT(re1,re2), DIVT(re1,re2)
Returns the arithmetic operation over two integer expressions, trapping on overflow or divide-by-zero.
MULU(re1,re2), DIVU(re1,re2,ord)
Performs multiplication or division of two expressions representing unsigned integers. May trap on division with zero.
ANDB(re1,re2), ORB(re1,re2), XORB(re1,re2)
performs the logical operation over integer values.
SRA(re,cnt,ord), SRL(re,cnt,ord), SLL(re,cnt,ord)
Peforms shifting of integer values represented by re by cnt assuming an order of evaluation of arguments given by ord. SRA performs arithmetic shift right; SRL performs logical shift right; and SLL performs logical shift left.
SEQ(stm,re)
obsolete.


datatype fexp
fexp describes operations that return floating point values.
FREG(f)
represents registers holding double precision floating point values. If there are M physical floating point registers, then FREG(i) 0 <= i < M represents these registers and anything else is a pseudo register.
LOADD(ea)
returns a double precision floating point value, read from the memory address given by ea.
FADDD(fe1,fe2), FSUBD(fe1,fe2), FDIVD(fe1,fe2), FMULD(fe1,fe2)
returns the result of a binary, double-precision, floating point operation. May raise an overflow or div-by-zero trap.
FABSD(fe), FNEGD(fe)
returns the result of a unary, double-precision, floating point operation.
CVTI2D(re)
converts an integer expression into a double-precision floating point value.
FSEQ(stm, fe)
obsolete


datatype ccexp
ccexp describes expression that return condition code values.
CC(cc)
represents a register holding a condition code value. If there are M physical, condition code registers, then CC(i) 0 <= i < M represents these registers and anything else is a pseudo register.
LOADCC(ea)
returns the condition code value read from memory at the address given by ea.
CMP(cond, re1, re2, ord), FCMP(cond, fe1, fe2, ord)
returns a condition code value resulting from comparing re1 and re2, or fe1 and fe2 with the condition cond. ord specifies the order of evaluation.


datatype mlrisc
describes the collection of all these values --- integer, floating point, and condition code values.

datatype mltree
mltree describes the language of flowgraphs.
DEFINELABEL(lab)
Defines the label lab at the current point in the code generation.
PSEUDO_OP(pOp)
Describes the language of assembly pseudo operators. The module contains an abstract type called pseudo_op that can be whatever the underlying assembler will support.
BEGINCLUSTER
It is convenient to break up the optimization into units consisting of functions that call-related. These units are called clusters, and BEGINCLUSTER marks the beginning of a cluster.
CODE(stm)
Emits code into the flowgraph.
ESCAPEBLOCK(regs)
When control flow terminates abruptly due to an indirect call, it is important for liveness analysis to know what resources are like at the termination point. ESCAPEBLOCK annotates the flowgraph with this information.
ENDCLUSTER(regmaps)
Terminates the cluster being generated. The argument is the register maps that must be used with this cluster. (See resetRegs in CELLS).



See Also

CELLS, CONSTANT, LABEL, LABELEXP, PSEUDO_OPS

  Submit a comment on this page  

[ INDEX | TOP | Parent | Root ]

Author: Lal George
Last Modified: October 11, 1996
Copyright © 1996 Bell Laboratories