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

SCM Repository

[smlnj] Annotation of /sml/trunk/src/MLRISC/ppc/instructions/ppcCells.sml
ViewVC logotype

Annotation of /sml/trunk/src/MLRISC/ppc/instructions/ppcCells.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 999 - (view) (download)

1 : monnier 411 (*
2 : leunga 744 * WARNING: This file was automatically generated by MDLGen (v3.0)
3 : leunga 815 * from the machine description file "ppc/ppc.mdl".
4 : leunga 744 * DO NOT EDIT this file directly
5 : monnier 411 *)
6 : monnier 247
7 :    
8 : monnier 411 signature PPCCELLS =
9 :     sig
10 : george 889 include CELLS
11 :     val SPR : CellsBasis.cellkind
12 :     val CELLSET : CellsBasis.cellkind
13 :     val showGP : CellsBasis.register_id -> string
14 :     val showFP : CellsBasis.register_id -> string
15 :     val showCC : CellsBasis.register_id -> string
16 :     val showSPR : CellsBasis.register_id -> string
17 :     val showMEM : CellsBasis.register_id -> string
18 :     val showCTRL : CellsBasis.register_id -> string
19 :     val showCELLSET : CellsBasis.register_id -> string
20 : leunga 999 val showGPWithSize : CellsBasis.register_id * CellsBasis.sz -> string
21 :     val showFPWithSize : CellsBasis.register_id * CellsBasis.sz -> string
22 :     val showCCWithSize : CellsBasis.register_id * CellsBasis.sz -> string
23 :     val showSPRWithSize : CellsBasis.register_id * CellsBasis.sz -> string
24 :     val showMEMWithSize : CellsBasis.register_id * CellsBasis.sz -> string
25 :     val showCTRLWithSize : CellsBasis.register_id * CellsBasis.sz -> string
26 :     val showCELLSETWithSize : CellsBasis.register_id * CellsBasis.sz -> string
27 : george 889 val r0 : CellsBasis.cell
28 :     val xer : CellsBasis.cell
29 :     val lr : CellsBasis.cell
30 :     val ctr : CellsBasis.cell
31 : leunga 999 val addGP : CellsBasis.cell * cellset -> cellset
32 :     val addFP : CellsBasis.cell * cellset -> cellset
33 :     val addCC : CellsBasis.cell * cellset -> cellset
34 :     val addSPR : CellsBasis.cell * cellset -> cellset
35 :     val addMEM : CellsBasis.cell * cellset -> cellset
36 :     val addCTRL : CellsBasis.cell * cellset -> cellset
37 :     val addCELLSET : CellsBasis.cell * cellset -> cellset
38 : monnier 411 end
39 : monnier 247
40 : monnier 411 structure PPCCells : PPCCELLS =
41 :     struct
42 :     exception PPCCells
43 :     fun error msg = MLRiscErrorMsg.error("PPCCells",msg)
44 : george 889 open CellsBasis
45 : leunga 744 fun showGPWithSize (r, ty) = (fn (r, _) => Int.toString r
46 :     ) (r, ty)
47 :     and showFPWithSize (r, ty) = (fn (f, _) => Int.toString f
48 :     ) (r, ty)
49 :     and showCCWithSize (r, ty) = (fn (cr, _) => "cr" ^ (Int.toString cr)
50 :     ) (r, ty)
51 :     and showSPRWithSize (r, ty) = (fn (1, _) => "xer"
52 :     | (8, _) => "lr"
53 :     | (9, _) => "ctr"
54 :     | (r, _) => Int.toString r
55 :     ) (r, ty)
56 :     and showMEMWithSize (r, ty) = (fn (r, _) => "m" ^ (Int.toString r)
57 :     ) (r, ty)
58 :     and showCTRLWithSize (r, ty) = (fn (r, _) => "ctrl" ^ (Int.toString r)
59 :     ) (r, ty)
60 :     and showCELLSETWithSize (r, ty) = (fn _ => "CELLSET"
61 :     ) (r, ty)
62 :     fun showGP r = showGPWithSize (r, 64)
63 :     fun showFP r = showFPWithSize (r, 64)
64 :     fun showCC r = showCCWithSize (r, 4)
65 :     fun showSPR r = showSPRWithSize (r, 64)
66 :     fun showMEM r = showMEMWithSize (r, 8)
67 :     fun showCTRL r = showCTRLWithSize (r, 8)
68 :     fun showCELLSET r = showCELLSETWithSize (r, 0)
69 :     val SPR = CellsBasis.newCellKind {name="SPR", nickname="spr"}
70 :     and CELLSET = CellsBasis.newCellKind {name="CELLSET", nickname="cellset"}
71 : george 889 structure MyCells = Cells
72 : leunga 744 (exception Cells = PPCCells
73 : monnier 411 val firstPseudo = 256
74 : george 889 val desc_GP = CellsBasis.DESC {low=0, high=31, kind=CellsBasis.GP, defaultValues=[],
75 :     zeroReg=NONE, toString=showGP, toStringWithSize=showGPWithSize,
76 :     counter=ref 0, dedicated=ref 0, physicalRegs=ref CellsBasis.array0}
77 :     and desc_FP = CellsBasis.DESC {low=32, high=63, kind=CellsBasis.FP,
78 : leunga 744 defaultValues=[], zeroReg=NONE, toString=showFP, toStringWithSize=showFPWithSize,
79 : george 889 counter=ref 0, dedicated=ref 0, physicalRegs=ref CellsBasis.array0}
80 :     and desc_CC = CellsBasis.DESC {low=64, high=71, kind=CellsBasis.CC,
81 : leunga 744 defaultValues=[], zeroReg=NONE, toString=showCC, toStringWithSize=showCCWithSize,
82 : george 889 counter=ref 0, dedicated=ref 0, physicalRegs=ref CellsBasis.array0}
83 :     and desc_SPR = CellsBasis.DESC {low=72, high=103, kind=SPR, defaultValues=[],
84 : leunga 744 zeroReg=NONE, toString=showSPR, toStringWithSize=showSPRWithSize,
85 : george 889 counter=ref 0, dedicated=ref 0, physicalRegs=ref CellsBasis.array0}
86 :     and desc_MEM = CellsBasis.DESC {low=104, high=103, kind=CellsBasis.MEM,
87 : leunga 744 defaultValues=[], zeroReg=NONE, toString=showMEM, toStringWithSize=showMEMWithSize,
88 : george 889 counter=ref 0, dedicated=ref 0, physicalRegs=ref CellsBasis.array0}
89 :     and desc_CTRL = CellsBasis.DESC {low=104, high=103, kind=CellsBasis.CTRL,
90 : leunga 744 defaultValues=[], zeroReg=NONE, toString=showCTRL, toStringWithSize=showCTRLWithSize,
91 : george 889 counter=ref 0, dedicated=ref 0, physicalRegs=ref CellsBasis.array0}
92 :     and desc_CELLSET = CellsBasis.DESC {low=104, high=103, kind=CELLSET,
93 : leunga 744 defaultValues=[], zeroReg=NONE, toString=showCELLSET, toStringWithSize=showCELLSETWithSize,
94 : george 889 counter=ref 0, dedicated=ref 0, physicalRegs=ref CellsBasis.array0}
95 : leunga 744 val cellKindDescs = [(CellsBasis.GP, desc_GP), (CellsBasis.FP, desc_FP),
96 :     (CellsBasis.CC, desc_CC), (SPR, desc_SPR), (CellsBasis.MEM, desc_MEM),
97 :     (CellsBasis.CTRL, desc_CTRL), (CELLSET, desc_CELLSET)]
98 : monnier 411 )
99 : monnier 247
100 : george 889 open MyCells
101 : leunga 744 val addGP = CellSet.add
102 :     and addFP = CellSet.add
103 :     and addCC = CellSet.add
104 :     and addSPR = CellSet.add
105 :     and addMEM = CellSet.add
106 :     and addCTRL = CellSet.add
107 :     and addCELLSET = CellSet.add
108 :     val RegGP = Reg GP
109 :     and RegFP = Reg FP
110 :     and RegCC = Reg CC
111 :     and RegSPR = Reg SPR
112 :     and RegMEM = Reg MEM
113 :     and RegCTRL = Reg CTRL
114 :     and RegCELLSET = Reg CELLSET
115 :     val stackptrR = RegGP 1
116 :     val asmTmpR = RegGP 28
117 :     val fasmTmp = RegFP 0
118 :     val r0 = RegGP 0
119 :     val xer = RegSPR 1
120 :     val lr = RegSPR 8
121 :     val ctr = RegSPR 9
122 : monnier 411 end
123 : monnier 247

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