Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/MLRISC/mltree/mltree.sml
ViewVC logotype

Diff of /sml/trunk/src/MLRISC/mltree/mltree.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 744, Fri Dec 8 04:11:42 2000 UTC revision 1183, Fri Mar 29 19:09:48 2002 UTC
# Line 4  Line 4 
4   *   *
5   *)   *)
6    
7  functor MLTreeF(structure LabelExp  : LABELEXP  functor MLTreeF(structure Constant  : CONSTANT
8                  structure Region    : REGION                  structure Region    : REGION
                 structure Stream    : INSTRUCTION_STREAM  
9                  structure Extension : MLTREE_EXTENSION                  structure Extension : MLTREE_EXTENSION
10                 ) : MLTREE =                 ) : MLTREE =
11  struct  struct
12    structure LabelExp = LabelExp    structure Constant = Constant
   structure Constant = LabelExp.Constant  
   structure PseudoOp = Stream.P  
   structure Stream = Stream  
13    structure Region = Region    structure Region = Region
14    structure Basis  = MLTreeBasis    structure Basis  = MLTreeBasis
15    structure Extension = Extension    structure Extension = Extension
16      structure I = MachineInt
17    
18    type ty  = Basis.ty    type ty  = Basis.ty
19    type fty = Basis.fty    type fty = Basis.fty
# Line 29  Line 26 
26    datatype cond = datatype Basis.cond    datatype cond = datatype Basis.cond
27    datatype fcond = datatype Basis.fcond    datatype fcond = datatype Basis.fcond
28    datatype rounding_mode = datatype Basis.rounding_mode    datatype rounding_mode = datatype Basis.rounding_mode
29      datatype div_rounding_mode = datatype Basis.div_rounding_mode
30    datatype ext = datatype Basis.ext    datatype ext = datatype Basis.ext
31    
32    (* Statements/effects.  These types are parameterized by the statement    (* Statements/effects.  These types are parameterized by the statement
# Line 45  Line 43 
43      | COPY    of ty * dst list * src list      | COPY    of ty * dst list * src list
44      | FCOPY   of fty * dst list * src list      | FCOPY   of fty * dst list * src list
45    
46        (* control flow *)        (* Control flow *)
47      | JMP     of rexp * controlflow      | JMP     of rexp * controlflow
48      | BCC     of ccexp * Label.label      | BCC     of ccexp * Label.label
49      | CALL    of {funct:rexp, targets:controlflow,      | CALL    of {funct:rexp, targets:controlflow,
50                    defs:mlrisc list, uses:mlrisc list,                    defs:mlrisc list, uses:mlrisc list,
51                    region: Region.region}                    region: Region.region, pops: Int32.int}
52        | FLOW_TO of stm * controlflow
53      | RET     of controlflow      | RET     of controlflow
54      | IF      of ccexp * stm * stm      | IF      of ccexp * stm * stm
55    
# Line 67  Line 66 
66      | ANNOTATION of stm * an      | ANNOTATION of stm * an
67      | EXT of sext  (* extension *)      | EXT of sext  (* extension *)
68    
69        | LIVE of mlrisc list
70        | KILL of mlrisc list
71    
72        (* RTL operators:        (* RTL operators:
73         * The following are used internally         * The following are used internally
74         * for describing instruction semantics.         * for describing instruction semantics.
# Line 74  Line 76 
76         *)         *)
77      | PHI    of {preds:int list, block:int}      | PHI    of {preds:int list, block:int}
78      | ASSIGN of ty * rexp * rexp      | ASSIGN of ty * rexp * rexp
79      | SOURCE of {block:int, liveIn:reg list}      | SOURCE
80      | SINK   of {block:int, liveOut:reg list}      | SINK
81      | RTL    of {hash:word, attribs:Basis.attribs ref, e:stm}      | RTL    of {hash:word, attribs:Basis.attribs ref, e:stm}
82    
83    and rexp =    and rexp =
84        REG    of ty * reg        REG    of ty * reg
85    
86        (* sizes of constants are inferred by context *)        (* sizes of constants are inferred by context *)
87      | LI     of int      | LI     of I.machine_int
88      | LI32   of Word32.word      | LABEL  of Label.label
     | LIInf  of IntInf.int  
     | LABEL  of LabelExp.labexp  
89      | CONST  of Constant.const      | CONST  of Constant.const
90        | LABEXP of rexp
91    
92      | NEG    of ty * rexp      | NEG    of ty * rexp
93      | ADD    of ty * rexp * rexp      | ADD    of ty * rexp * rexp
# Line 94  Line 95 
95    
96        (* signed multiplication etc. *)        (* signed multiplication etc. *)
97      | MULS   of ty * rexp * rexp      | MULS   of ty * rexp * rexp
98      | DIVS   of ty * rexp * rexp      | DIVS   of div_rounding_mode * ty * rexp * rexp
99      | QUOTS  of ty * rexp * rexp      | REMS   of div_rounding_mode * ty * rexp * rexp
     | REMS   of ty * rexp * rexp  
100    
101        (* unsigned multiplication etc. *)        (* unsigned multiplication etc. *)
102      | MULU   of ty * rexp * rexp      | MULU   of ty * rexp * rexp
103      | DIVU   of ty * rexp * rexp      | DIVU   of ty * rexp * rexp
104      | REMU   of ty * rexp * rexp      | REMU   of ty * rexp * rexp
105    
106        (* trapping versions of above. These are all signed *)        (* overflow-trapping versions of above. These are all signed *)
107      | NEGT   of ty * rexp      | NEGT   of ty * rexp
108      | ADDT   of ty * rexp * rexp      | ADDT   of ty * rexp * rexp
109      | SUBT   of ty * rexp * rexp      | SUBT   of ty * rexp * rexp
110      | MULT   of ty * rexp * rexp      | MULT   of ty * rexp * rexp
111      | DIVT   of ty * rexp * rexp      | DIVT   of div_rounding_mode * ty * rexp * rexp
     | QUOTT  of ty * rexp * rexp  
     | REMT   of ty * rexp * rexp  
112    
113        (* bit operations *)        (* bit operations *)
114      | ANDB   of ty * rexp * rexp      | ANDB   of ty * rexp * rexp
# Line 209  Line 207 
207         and rext   = (stm, rexp, fexp, ccexp) Extension.rx         and rext   = (stm, rexp, fexp, ccexp) Extension.rx
208         and fext   = (stm, rexp, fexp, ccexp) Extension.fx         and fext   = (stm, rexp, fexp, ccexp) Extension.fx
209         and ccext  = (stm, rexp, fexp, ccexp) Extension.ccx         and ccext  = (stm, rexp, fexp, ccexp) Extension.ccx
210           and labexp = rexp
   (*  
    * Instruction streams  
    *)  
   type ('i,'cellset) stream = ('i, an list, 'cellset) Stream.stream  
   
   (*  
    * Extension mechanism  
    *)  
   
   datatype ('instr,'cellset,'operand,'addressing_mode) reducer =  
     REDUCER of  
     { reduceRexp    : rexp -> reg,  
       reduceFexp    : fexp -> reg,  
       reduceCCexp   : ccexp -> reg,  
       reduceStm     : stm * an list -> unit,  
       operand       : rexp -> 'operand,  
       reduceOperand : 'operand -> reg,  
       addressOf     : rexp -> 'addressing_mode,  
       emit          : 'instr * an list -> unit,  
       instrStream   : ('instr,'cellset) stream,  
       mltreeStream  : (stm,mlrisc list) stream  
     }  
211    
212    (*    (*
213     * Useful type abbreviations for working for MLTree.     * Useful type abbreviations for working for MLTree.

Legend:
Removed from v.744  
changed lines
  Added in v.1183

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0