MLTREE signature
signature MLTREE
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
structure Constant
structure PseudoOp
datatype cond
datatype order
LR (for left-to-right).
datatype stm
CALL construct that may return multiple values.
MV(r, rexp), FMV(f, fexp), CCMV(cc, ccexp)
COPY(dstList, srcList), FCOPY(dstList, srcList)
srcList to registers in dstList. COPY is used for general REG registers and FCOPY for floating FREG registers.
JMP(exp, labels)
exp. The list of labels is a hint of the possible branch targets. This is useful with computed gotos.
CALL(exp, defs, uses)
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
CALL.
STORE8(ea, byte), STORE32(ea, word32), STORED(ea, real64), STORECC(ea, cc)
BCC(cond, ccexp, lab), FBCC(cond, ccexp, lab)
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
REG(r)
REG(i) 0 <= i < M represents these registers and anything else is a pseudo register.
LI(i), LI32(w32)
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)
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)
ADDT(re1,re2), SUBT(re1,re2), MULT(re1,re2), DIVT(re1,re2)
MULU(re1,re2), DIVU(re1,re2,ord)
ANDB(re1,re2), ORB(re1,re2), XORB(re1,re2)
SRA(re,cnt,ord), SRL(re,cnt,ord), SLL(re,cnt,ord)
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)
datatype fexp
FREG(f)
FREG(i) 0 <= i < M represents these registers and anything else is a pseudo register.
LOADD(ea)
FADDD(fe1,fe2), FSUBD(fe1,fe2), FDIVD(fe1,fe2), FMULD(fe1,fe2)
FABSD(fe), FNEGD(fe)
CVTI2D(re)
FSEQ(stm, fe)
datatype ccexp
CC(cc)
CC(i) 0 <= i < M represents these registers and anything else is a pseudo register.
LOADCC(ea)
CMP(cond, re1, re2, ord), FCMP(cond, fe1, fe2, ord)
re1 and re2, or fe1 and fe2 with the condition cond. ord specifies the order of evaluation.
datatype mlrisc
datatype mltree
DEFINELABEL(lab)
lab at the current point in the code generation.
PSEUDO_OP(pOp)
pseudo_op that can be whatever the underlying assembler will support.
BEGINCLUSTER
BEGINCLUSTER marks the beginning of a cluster.
CODE(stm)
ESCAPEBLOCK(regs)
ESCAPEBLOCK annotates the flowgraph with this information.
ENDCLUSTER(regmaps)
CELLS, CONSTANT, LABEL, LABELEXP, PSEUDO_OPS
Submit a comment on this page
Author: Lal George
Last Modified: October 11, 1996
Copyright © 1996 Bell Laboratories