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/branches/SMLNJ/src/MLRISC/ppc/instructions/ppcCells.sml
ViewVC logotype

Diff of /sml/branches/SMLNJ/src/MLRISC/ppc/instructions/ppcCells.sml

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

revision 428, Wed Sep 8 09:47:00 1999 UTC revision 429, Wed Sep 8 09:47:00 1999 UTC
# Line 12  Line 12 
12     | CTRL     | CTRL
13     | SPR     | SPR
14     | CC     | CC
    | GP  
15     | FP     | FP
16       | GP
17     withtype cellset = (int list * int list * int list)     withtype cellset = (int list * int list * int list)
18     include CELLS_BASIS where type cellkind = mycellkind     include CELLS_BASIS where type cellkind = mycellkind
19     val showSPR : register -> string     val showSPR : cell -> string
20     val showCC : register -> string     val showCC : cell -> string
21     val showGP : register -> string     val showFP : cell -> string
22     val showFP : register -> string     val showGP : cell -> string
23     val newSPR : unit -> register     val addGP : (cell * cellset) -> cellset
24     val newCC : unit -> register     val addFP : (cell * cellset) -> cellset
25     val newGP : unit -> register     val addCC : (cell * cellset) -> cellset
26     val newFP : unit -> register     val fasmTmp : cell
27     val addGP : (register * cellset) -> cellset     val stackptrR : cell
28     val addFP : (register * cellset) -> cellset     val asmTmpR : cell
29     val addCC : (register * cellset) -> cellset     val ctr : cell
30     val lr : register     val lr : cell
31     val asmTmpR : register     val xer : cell
32     val stackptrR : register     val zeroReg : cellkind -> cell option
33     val ctr : register     val toString : cellkind -> cell -> string
34     val fasmTmp : register     val addCell : cellkind -> cell * cellset -> cellset
35     val xer : register     val rmvCell : cellkind -> cell * cellset -> cellset
36     val zeroReg : cellkind -> register option     val addReg : cell * cellset -> cellset
37     val toString : cellkind -> register -> string     val rmvReg : cell * cellset -> cellset
38     val addCell : cellkind -> register * cellset -> cellset     val addFreg : cell * cellset -> cellset
39     val addReg : register * cellset -> cellset     val rmvFreg : cell * cellset -> cellset
40     val addFreg : register * cellset -> cellset     val getCell : cellkind -> cellset -> cell list
41     val getCell : cellkind -> cellset -> register list     val updateCell : cellkind -> cellset * cell list -> cellset
    val updateCell : cellkind -> cellset * register list -> cellset  
42     val empty : cellset     val empty : cellset
43     val cellsetToString : cellset -> string     val cellsetToString : cellset -> string
44     val cellsetToString' : (register -> register) -> cellset -> string     val cellsetToString' : (cell -> cell) -> cellset -> string
45     val cellsetToRegs : cellset -> register list     val cellsetToCells : cellset -> cell list
46  end  end
47    
48  structure PPCCells : PPCCELLS =  structure PPCCells : PPCCELLS =
# Line 54  Line 53 
53     | CTRL     | CTRL
54     | SPR     | SPR
55     | CC     | CC
    | GP  
56     | FP     | FP
57       | GP
58     withtype cellset = (int list * int list * int list)     withtype cellset = (int list * int list * int list)
59     exception PPCCells     exception PPCCells
60     structure SL = SortedList     structure SL = SortedList
61     fun error msg = MLRiscErrorMsg.error("PPCCells",msg)     fun error msg = MLRiscErrorMsg.error("PPCCells",msg)
62     val cellkindToString = (fn SPR => "SPR"     val cellkindToString = (fn SPR => "SPR"
63                              | CC => "CC"                              | CC => "CC"
                             | GP => "GP"  
64                              | FP => "FP"                              | FP => "FP"
65                                | GP => "GP"
66                              | MEM => "MEM"                              | MEM => "MEM"
67                              | CTRL => "CTRL"                              | CTRL => "CTRL"
68                              | UNKNOWN => "UNKNOWN"                              | UNKNOWN => "UNKNOWN"
# Line 76  Line 75 
75         val INT = GP         val INT = GP
76         val FLOAT = FP         val FLOAT = FP
77         val firstPseudo = 256         val firstPseudo = 256
78         val kinds = [SPR, CC, GP, FP, MEM, CTRL]         val kinds = [SPR, CC, FP, GP, MEM, CTRL]
79         val physical = [{from=72, to=103, kind=SPR}, {from=64, to=71, kind=CC}, {from=0, to=31, kind=GP}, {from=32, to=63, kind=FP}]         val physical = [{from=72, to=103, kind=SPR}, {from=64, to=71, kind=CC}, {from=32, to=63, kind=FP}, {from=0, to=31, kind=GP}]
80        )        )
81    
82     open MyCellsBasis     open MyCellsBasis
83     val offsetSPR = 72     val offsetSPR = 72
84    and offsetCC = 64    and offsetCC = 64
   and offsetGP = 0  
85    and offsetFP = 32    and offsetFP = 32
86    and newSPR = (newCell SPR)    and offsetGP = 0
87    and newCC = (newCell CC)    and cellnames = ["SPR", "CC", "FP", "GP"]
   and newGP = (newCell GP)  
   and newFP = (newCell FP)  
   and cellnames = ["SPR", "CC", "GP", "FP"]  
88    and cellsetnames = ["GP", "FP", "CC"]    and cellsetnames = ["GP", "FP", "CC"]
89     val lr = (8 + offsetSPR)     val fasmTmp = (0 + offsetFP)
    val asmTmpR = (28 + offsetGP)  
90     val stackptrR = (1 + offsetGP)     val stackptrR = (1 + offsetGP)
91       val asmTmpR = (28 + offsetGP)
92     val ctr = (9 + offsetSPR)     val ctr = (9 + offsetSPR)
93     val fasmTmp = (0 + offsetFP)     val lr = (8 + offsetSPR)
94     val xer = (1 + offsetSPR)     val xer = (1 + offsetSPR)
95    
96     fun showSPR r = let     fun showSPR r = let
# Line 117  Line 112 
112             ) r)             ) r)
113         end         end
114    
    and showGP r = ((fn r => (Int.toString r)  
                    ) r)  
115     and showFP r = let     and showFP r = let
116            val r = (if (r <= 63)            val r = (if (r <= 63)
117                  then (r - 32)                  then (r - 32)
# Line 127  Line 120 
120             ) r)             ) r)
121         end         end
122    
123       and showGP r = ((fn r => (Int.toString r)
124                       ) r)
125     and toString SPR = showSPR     and toString SPR = showSPR
126       | toString CC = showCC       | toString CC = showCC
      | toString GP = showGP  
127       | toString FP = showFP       | toString FP = showFP
128         | toString GP = showGP
129       | toString MEM = (fn r => ("m" ^ (Int.toString r))       | toString MEM = (fn r => ("m" ^ (Int.toString r))
130                        )                        )
131       | toString CTRL = (fn r => ("ctrl" ^ (Int.toString r))       | toString CTRL = (fn r => ("ctrl" ^ (Int.toString r))
# Line 139  Line 134 
134                            )                            )
135     val empty = ([], [], [])     val empty = ([], [], [])
136    
137     fun addCell CC = addCC     fun addCell GP = addGP
      | addCell GP = addGP  
138       | addCell FP = addFP       | addCell FP = addFP
139         | addCell CC = addCC
140       | addCell _ = (error "addCell")       | addCell _ = (error "addCell")
141     and getCell CC = getCellCC     and rmvCell GP = rmvGP
142       | getCell GP = getCellGP       | rmvCell FP = rmvFP
143         | rmvCell CC = rmvCC
144         | rmvCell _ = (error "rmvCell")
145       and getCell GP = getCellGP
146       | getCell FP = getCellFP       | getCell FP = getCellFP
147         | getCell CC = getCellCC
148       | getCell _ = (error "getCell")       | getCell _ = (error "getCell")
149     and updateCell CC = updateCellCC     and updateCell GP = updateCellGP
      | updateCell GP = updateCellGP  
150       | updateCell FP = updateCellFP       | updateCell FP = updateCellFP
151         | updateCell CC = updateCellCC
152       | updateCell _ = (error "updateCell")       | updateCell _ = (error "updateCell")
153     and addGP (r, (setGP, setFP, setCC)) = ((SL.enter (r, setGP)), setFP, setCC)     and addGP (r, (setGP, setFP, setCC)) = ((SL.enter (r, setGP)), setFP, setCC)
154     and addFP (r, (setGP, setFP, setCC)) = (setGP, (SL.enter (r, setFP)), setCC)     and addFP (r, (setGP, setFP, setCC)) = (setGP, (SL.enter (r, setFP)), setCC)
155     and addCC (r, (setGP, setFP, setCC)) = (setGP, setFP, (SL.enter (r, setCC)))     and addCC (r, (setGP, setFP, setCC)) = (setGP, setFP, (SL.enter (r, setCC)))
156       and rmvGP (r, (setGP, setFP, setCC)) = ((SL.rmv (r, setGP)), setFP, setCC)
157       and rmvFP (r, (setGP, setFP, setCC)) = (setGP, (SL.rmv (r, setFP)), setCC)
158       and rmvCC (r, (setGP, setFP, setCC)) = (setGP, setFP, (SL.rmv (r, setCC)))
159     and getCellGP (setGP, setFP, setCC) = setGP     and getCellGP (setGP, setFP, setCC) = setGP
160     and getCellFP (setGP, setFP, setCC) = setFP     and getCellFP (setGP, setFP, setCC) = setFP
161     and getCellCC (setGP, setFP, setCC) = setCC     and getCellCC (setGP, setFP, setCC) = setCC
# Line 163  Line 165 
165     and cellsetToString (setGP, setFP, setCC) = (printTuple (cellsetnames, [((printSet showGP) setGP), ((printSet showFP) setFP), ((printSet showCC) setCC)]))     and cellsetToString (setGP, setFP, setCC) = (printTuple (cellsetnames, [((printSet showGP) setGP), ((printSet showFP) setFP), ((printSet showCC) setCC)]))
166     and cellsetToString' regmap = (fn (setGP, setFP, setCC) => (printTuple (cellsetnames, [((printSet showGP) ((map regmap) setGP)), ((printSet showFP) ((map regmap) setFP)), ((printSet showCC) ((map regmap) setCC))]))     and cellsetToString' regmap = (fn (setGP, setFP, setCC) => (printTuple (cellsetnames, [((printSet showGP) ((map regmap) setGP)), ((printSet showFP) ((map regmap) setFP)), ((printSet showCC) ((map regmap) setCC))]))
167                                   )                                   )
168     and cellsetToRegs (setGP, setFP, setCC) = (setGP @ (setFP @ setCC))     and cellsetToCells (setGP, setFP, setCC) = (setGP @ (setFP @ setCC))
169     val addReg = addGP     val addReg = addGP
170     val addFreg = addFP     val addFreg = addFP
171       val rmvReg = rmvFP
172       val rmvFreg = rmvFP
173    
174     fun zeroReg _ = NONE     fun zeroReg _ = NONE
175  end  end

Legend:
Removed from v.428  
changed lines
  Added in v.429

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