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/instructions/cells.sml
ViewVC logotype

Diff of /sml/trunk/src/MLRISC/instructions/cells.sml

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

revision 888, Thu Jul 19 20:24:21 2001 UTC revision 889, Thu Jul 19 20:35:20 2001 UTC
# Line 7  Line 7 
7  (*  (*
8   * This functor is applied to create the cells structure for an  architecture   * This functor is applied to create the cells structure for an  architecture
9   *)   *)
10  functor CellsCommon  functor Cells
11     (exception Cells     (exception Cells
12      val firstPseudo   : int      val firstPseudo   : int
13      val cellKindDescs : (CellsBasis.cellkind * CellsBasis.cellkindDesc) list      val cellKindDescs : (CellsBasis.cellkind * CellsBasis.cellkindDesc) list
14     ) : CELLS_COMMON =     ) : CELLS =
15  struct  struct
16    
17     open CellsBasis CellsInternal     open CellsBasis
   
    structure CellsBasis = CellsBasis  
18    
19     exception Cells = Cells     exception Cells = Cells
20    
21     val i2s = Int.toString     val i2s = Int.toString
22    
23     fun error msg = MLRiscErrorMsg.error(exnName Cells, msg)     fun error msg = MLRiscErrorMsg.error(exnName Cells, msg)
    (*  
    val cellKindDescs =  
        (CONST,  
         DESC{high= ~1, low=0, physicalRegs=ref(CellsInternal.array0),  
              kind=CONST, counter=ref 0,  
              toString=fn v => "v"^i2s v,  
              toStringWithSize=fn (v,_) => "v"^i2s v,  
              defaultValues=[],  
              zeroReg=NONE  
             }  
        ) ::  
        cellKindDescs  
     *)  
24    
25     val cellkinds         = map (fn (kind,_) => kind) cellKindDescs     val cellkinds         = map (fn (kind,_) => kind) cellKindDescs
26     val firstPseudo       = firstPseudo     val firstPseudo       = firstPseudo
# Line 155  Line 140 
140          name := firstName          name := firstName
141         )         )
142    
143    
144     structure CellSet =     structure CellSet =
145     struct     struct
146        type cellset = (cellkindDesc * cell list) list        type cellset = (cellkindDesc * cell list) list
# Line 189  Line 175 
175                 if same(k,k') then s else loop cellset                 if same(k,k') then s else loop cellset
176        in  loop cellset end        in  loop cellset end
177    
178        fun get k = get'(desc k)        fun get (k: cellkind) = get'(desc k)
179    
180        fun update' k (cellset:cellset,s) =        fun update' k (cellset:cellset,s) =
181        let fun loop [] = [(k,s)]        let fun loop [] = [(k,s)]
# Line 233  Line 219 
219        in  pr cellset end        in  pr cellset end
220    
221        val toString = toString'        val toString = toString'
222     end     end (* CellSet *)
223    
224     type cellset = CellSet.cellset     type cellset = CellSet.cellset
225     val empty   = CellSet.empty     val empty   = CellSet.empty
# Line 255  Line 241 
241     fun defaultValues k =     fun defaultValues k =
242     let val DESC{defaultValues, ...} = desc k     let val DESC{defaultValues, ...} = desc k
243     in  defaultValues end     in  defaultValues end
244    
245      (* dummy values for now; these get redefined for each architecture *)
246       val stackptrR = GPReg 0
247       val asmTmpR = GPReg 0
248       val fasmTmp = FPReg 0
249  end  end

Legend:
Removed from v.888  
changed lines
  Added in v.889

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