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 245, Sat Apr 17 18:47:12 1999 UTC revision 411, Fri Sep 3 00:25:03 1999 UTC
# Line 7  Line 7 
7  functor MLTreeF(structure Const : CONSTANT  functor MLTreeF(structure Const : CONSTANT
8                  structure P : PSEUDO_OPS                  structure P : PSEUDO_OPS
9                  structure R : REGION                  structure R : REGION
10                  structure B : BLOCK_NAMES) : MLTREE =                  structure B : BLOCK_NAMES
11                    type rextension
12                    type fextension
13                   ) : MLTREE =
14  struct  struct
15    structure Constant = Const    structure Constant = Const
16    structure PseudoOp = P    structure PseudoOp = P
17    structure Region = R    structure Region = R
18    structure BNames = B    structure BNames = B
19    
20    datatype cond = LT | LTU | LE | LEU | EQ | NEQ | GE | GEU | GT | GTU    open MLTreeBasis
   datatype fcond =  
     == | ?<> | ? | <=> | > | >= | ?> | ?>= | < | <= | ?< | ?<= | <> | ?=  
   datatype order = LR | RL  
21    
22    datatype stm =    type rextension = rextension
23        MV     of int * rexp                      (* REG(dest) := src *)    type fextension = rextension
24      | FMV    of int * fexp  
25      | CCMV   of int * ccexp    type var = int (* variable *)
26      type src = var (* source variable *)
27      type dst = var (* destination variable *)
28      type reg = var (* physical register *)
29    
30      (* phi-functions for SSA form *)
31      datatype phi =
32          PHI  of ty * dst * src list
33        | FPHI of fty * dst * src list
34        | CCPHI of dst * src list
35    
36      | COPY   of int list * int list    (* aliasing declarations
37      | FCOPY  of int list * int list     * These are used to define physical register bindings for SSA names
38       *)
39      datatype alias = ALIAS   of ty * var * reg
40                     | FALIAS  of fty * var * reg
41                     | CCALIAS of var * reg
42    
43      (* statements *)
44      datatype stm =
45          MV      of ty * dst * rexp
46        | CCMV    of dst * ccexp
47        | FMV     of fty * dst * fexp
48        | COPY    of ty * dst list * src list
49        | FCOPY   of fty * dst list * src list
50      | JMP    of rexp * Label.label list      | JMP    of rexp * Label.label list
51      | CALL   of rexp * mlrisc list * mlrisc list      | CALL    of rexp * mlrisc list * mlrisc list * Region.region
52      | RET      | RET
53    
54      | STORE8  of rexp * rexp * Region.region    (* address, data *)      | STORE  of ty * rexp * rexp * Region.region        (* address, data *)
55      | STORE32 of rexp * rexp * Region.region      | STORE_UNALIGNED of ty * rexp * rexp * Region.region
56      | STORED  of rexp * fexp * Region.region      | FSTORE of fty * rexp * fexp * Region.region       (* address, data *)
57      | STORECC of rexp * ccexp * Region.region      | FSTORE_UNALIGNED of fty * rexp * fexp * Region.region
   
58      | BCC    of cond * ccexp * Label.label      | BCC    of cond * ccexp * Label.label
59      | FBCC   of fcond * ccexp * Label.label      | FBCC   of fcond * ccexp * Label.label
60        | ANNOTATION of stm * Annotations.annotation
61    
62          (* The following are used internally by SSA optimizations;
63           * The frontend should not generate these.
64           *)
65        | RTL of word ref * word * stm (* an RTL *)
66        | RTLPHI of int (* a phi-function at block id *)
67        | RTLPINNED of stm (* pinned statement *)
68        | RTLPAR of stm list (* parallel execution *)
69    
70    and rexp =    and rexp =
71        REG    of int        REG    of ty * src
72    
73          (* sizes of constants are inferred by context *)
74      | LI     of int      | LI     of int
75      | LI32   of Word32.word      | LI32   of Word32.word
76        | LI64   of Word64.word
77      | LABEL  of LabelExp.labexp      | LABEL  of LabelExp.labexp
78      | CONST  of Constant.const      | CONST  of Constant.const
79    
80      | ADD    of rexp * rexp      | ADD    of ty * rexp * rexp
81      | SUB    of rexp * rexp * order      | SUB    of ty * rexp * rexp
82      | MULU   of rexp * rexp  
83      | DIVU   of rexp * rexp * order        (* signed multiplication etc. *)
84        | MULS   of ty * rexp * rexp
85      | ADDT   of rexp * rexp      | DIVS   of ty * rexp * rexp
86      | MULT   of rexp * rexp      | REMS   of ty * rexp * rexp
87      | SUBT   of rexp * rexp * order  
88      | DIVT   of rexp * rexp * order        (* unsigned multiplication etc. *)
89        | MULU   of ty * rexp * rexp
90      | LOAD8  of rexp * Region.region      | DIVU   of ty * rexp * rexp
91      | LOAD32 of rexp * Region.region      | REMU   of ty * rexp * rexp
92    
93      | ANDB   of rexp * rexp        (* trapping versions of above. These are all signed *)
94      | ORB    of rexp * rexp      | ADDT   of ty * rexp * rexp
95      | XORB   of rexp * rexp      | SUBT   of ty * rexp * rexp
96        | MULT   of ty * rexp * rexp
97      | SRA   of rexp * rexp * order              (* value, shift *)      | DIVT   of ty * rexp * rexp
98      | SRL   of rexp * rexp * order      | REMT   of ty * rexp * rexp
99      | SLL   of rexp * rexp * order  
100        | ANDB   of ty * rexp * rexp
101        | ORB    of ty * rexp * rexp
102        | XORB   of ty * rexp * rexp
103        | NOTB   of ty * rexp
104    
105        | SRA   of ty * rexp * rexp         (* value, shift *)
106        | SRL   of ty * rexp * rexp
107        | SLL   of ty * rexp * rexp
108    
109          (* type promotion *)
110        | CVTI2I of ty * ext * rexp
111        | CVTF2I of ty * rounding_mode * fexp
112    
113          (* conditional (eager) evaluation *)
114        | COND of ty * ccexp * rexp * rexp
115    
116          (* integer load *)
117        | LOAD of ty * rexp * Region.region
118        | LOAD_UNALIGNED of ty * rexp * Region.region
119    
120      | SEQ of stm * rexp      | SEQ of stm * rexp
121    
122    and fexp =      | EXTENSION of rextension * rexp list
123        FREG   of int  
124      | LOADD  of rexp  * Region.region      | MARK of rexp * Annotations.annotation
125    
126      | FADDD  of fexp * fexp        (* Used in RTL *)
127      | FMULD  of fexp * fexp      | RTLPC (* the program counter; used for describing relative addressing *)
128      | FSUBD  of fexp * fexp * order      | RTLMISC of misc_op ref * rexp list
     | FDIVD  of fexp * fexp * order  
     | FABSD  of fexp  
     | FNEGD  of fexp  
129    
130      | CVTI2D of rexp    and fexp =
131          FREG   of fty * src
132        | FLOAD  of fty * rexp * Region.region
133        | FLOAD_UNALIGNED  of fty * rexp * Region.region
134    
135        | FADD   of fty * fexp * fexp
136        | FMUL   of fty * fexp * fexp
137        | FSUB   of fty * fexp * fexp
138        | FDIV   of fty * fexp * fexp
139        | FABS   of fty * fexp
140        | FNEG   of fty * fexp
141        | FSQRT  of fty * fexp
142    
143        | CVTI2F of fty * ext * rexp
144        | CVTF2F of fty * rounding_mode * fexp
145      | FSEQ   of stm * fexp      | FSEQ   of stm * fexp
146    
147        | FEXTENSION of fextension * fexp list
148    
149        | FMARK of fexp * Annotations.annotation
150    
151          (* used in RTL *)
152        | RTLFMISC of misc_op ref * fexp list
153    
154    and ccexp =    and ccexp =
155        CC     of int        CC     of src
156      | LOADCC of rexp * Region.region      | CMP    of ty * cond * rexp * rexp
157      | CMP    of cond * rexp * rexp * order      | FCMP   of fty * fcond * fexp * fexp
158      | FCMP   of fcond * fexp * fexp * order      | CCMARK of ccexp * Annotations.annotation
159        | RTLCCMISC of misc_op ref * ccexp list
160    
161    and mlrisc = CCR of ccexp | GPR of rexp | FPR of fexp    and mlrisc = CCR of ccexp | GPR of rexp | FPR of fexp
162    
# Line 98  Line 166 
166      | DEFINELABEL of Label.label      | DEFINELABEL of Label.label
167      | ENTRYLABEL of Label.label      | ENTRYLABEL of Label.label
168      | CODE of stm list      | CODE of stm list
169        | ALIASDECLS of alias list
170        | PHIFUNS of phi list
171      | BLOCK_NAME of BNames.name      | BLOCK_NAME of BNames.name
172      | ORDERED of mltree list      | BLOCK_ANNOTATION of Annotations.annotation
173      | ESCAPEBLOCK of mlrisc list      | ESCAPEBLOCK of mlrisc list
174      | ENDCLUSTER of int Intmap.intmap      | ENDCLUSTER of int Intmap.intmap * Annotations.annotations
 end (* MLTree *)  
175    
176  (*    exception Unsupported of string * rexp
177   * $Log: mltree.sml,v $  
178   * Revision 1.2  1998/07/25 03:08:21  george  end (* MLTREE *)
  *   added to support block names in MLRISC  
  *  
  * Revision 1.1.1.1  1998/04/08 18:39:02  george  
  * Version 110.5  
  *  
  *)  

Legend:
Removed from v.245  
changed lines
  Added in v.411

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