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 1593 - (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 : allenleung 1593 fun showGPWithSize (r, ty) = (fn (r, _) => (if ( ! PPCAsmSyntax.ibm_syntax)
46 :     then ("r" ^ (Int.toString r))
47 :     else (Int.toString r))
48 : leunga 744 ) (r, ty)
49 : allenleung 1593 and showFPWithSize (r, ty) = (fn (f, _) => (if ( ! PPCAsmSyntax.ibm_syntax)
50 :     then ("f" ^ (Int.toString f))
51 :     else (Int.toString r))
52 : leunga 744 ) (r, ty)
53 :     and showCCWithSize (r, ty) = (fn (cr, _) => "cr" ^ (Int.toString cr)
54 :     ) (r, ty)
55 :     and showSPRWithSize (r, ty) = (fn (1, _) => "xer"
56 :     | (8, _) => "lr"
57 :     | (9, _) => "ctr"
58 :     | (r, _) => Int.toString r
59 :     ) (r, ty)
60 :     and showMEMWithSize (r, ty) = (fn (r, _) => "m" ^ (Int.toString r)
61 :     ) (r, ty)
62 :     and showCTRLWithSize (r, ty) = (fn (r, _) => "ctrl" ^ (Int.toString r)
63 :     ) (r, ty)
64 :     and showCELLSETWithSize (r, ty) = (fn _ => "CELLSET"
65 :     ) (r, ty)
66 :     fun showGP r = showGPWithSize (r, 64)
67 :     fun showFP r = showFPWithSize (r, 64)
68 :     fun showCC r = showCCWithSize (r, 4)
69 :     fun showSPR r = showSPRWithSize (r, 64)
70 :     fun showMEM r = showMEMWithSize (r, 8)
71 :     fun showCTRL r = showCTRLWithSize (r, 8)
72 :     fun showCELLSET r = showCELLSETWithSize (r, 0)
73 :     val SPR = CellsBasis.newCellKind {name="SPR", nickname="spr"}
74 :     and CELLSET = CellsBasis.newCellKind {name="CELLSET", nickname="cellset"}
75 : george 889 structure MyCells = Cells
76 : leunga 744 (exception Cells = PPCCells
77 : monnier 411 val firstPseudo = 256
78 : george 889 val desc_GP = CellsBasis.DESC {low=0, high=31, kind=CellsBasis.GP, defaultValues=[],
79 :     zeroReg=NONE, toString=showGP, toStringWithSize=showGPWithSize,
80 :     counter=ref 0, dedicated=ref 0, physicalRegs=ref CellsBasis.array0}
81 :     and desc_FP = CellsBasis.DESC {low=32, high=63, kind=CellsBasis.FP,
82 : leunga 744 defaultValues=[], zeroReg=NONE, toString=showFP, toStringWithSize=showFPWithSize,
83 : george 889 counter=ref 0, dedicated=ref 0, physicalRegs=ref CellsBasis.array0}
84 :     and desc_CC = CellsBasis.DESC {low=64, high=71, kind=CellsBasis.CC,
85 : leunga 744 defaultValues=[], zeroReg=NONE, toString=showCC, toStringWithSize=showCCWithSize,
86 : george 889 counter=ref 0, dedicated=ref 0, physicalRegs=ref CellsBasis.array0}
87 :     and desc_SPR = CellsBasis.DESC {low=72, high=103, kind=SPR, defaultValues=[],
88 : leunga 744 zeroReg=NONE, toString=showSPR, toStringWithSize=showSPRWithSize,
89 : george 889 counter=ref 0, dedicated=ref 0, physicalRegs=ref CellsBasis.array0}
90 :     and desc_MEM = CellsBasis.DESC {low=104, high=103, kind=CellsBasis.MEM,
91 : leunga 744 defaultValues=[], zeroReg=NONE, toString=showMEM, toStringWithSize=showMEMWithSize,
92 : george 889 counter=ref 0, dedicated=ref 0, physicalRegs=ref CellsBasis.array0}
93 :     and desc_CTRL = CellsBasis.DESC {low=104, high=103, kind=CellsBasis.CTRL,
94 : leunga 744 defaultValues=[], zeroReg=NONE, toString=showCTRL, toStringWithSize=showCTRLWithSize,
95 : george 889 counter=ref 0, dedicated=ref 0, physicalRegs=ref CellsBasis.array0}
96 :     and desc_CELLSET = CellsBasis.DESC {low=104, high=103, kind=CELLSET,
97 : leunga 744 defaultValues=[], zeroReg=NONE, toString=showCELLSET, toStringWithSize=showCELLSETWithSize,
98 : george 889 counter=ref 0, dedicated=ref 0, physicalRegs=ref CellsBasis.array0}
99 : leunga 744 val cellKindDescs = [(CellsBasis.GP, desc_GP), (CellsBasis.FP, desc_FP),
100 :     (CellsBasis.CC, desc_CC), (SPR, desc_SPR), (CellsBasis.MEM, desc_MEM),
101 :     (CellsBasis.CTRL, desc_CTRL), (CELLSET, desc_CELLSET)]
102 : monnier 411 )
103 : monnier 247
104 : george 889 open MyCells
105 : leunga 744 val addGP = CellSet.add
106 :     and addFP = CellSet.add
107 :     and addCC = CellSet.add
108 :     and addSPR = CellSet.add
109 :     and addMEM = CellSet.add
110 :     and addCTRL = CellSet.add
111 :     and addCELLSET = CellSet.add
112 :     val RegGP = Reg GP
113 :     and RegFP = Reg FP
114 :     and RegCC = Reg CC
115 :     and RegSPR = Reg SPR
116 :     and RegMEM = Reg MEM
117 :     and RegCTRL = Reg CTRL
118 :     and RegCELLSET = Reg CELLSET
119 :     val stackptrR = RegGP 1
120 :     val asmTmpR = RegGP 28
121 :     val fasmTmp = RegFP 0
122 :     val r0 = RegGP 0
123 :     val xer = RegSPR 1
124 :     val lr = RegSPR 8
125 :     val ctr = RegSPR 9
126 : monnier 411 end
127 : monnier 247

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