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

Annotation of /sml/trunk/src/MLRISC/x86/instructions/x86Cells.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 889 - (view) (download)

1 : monnier 411 (*
2 : leunga 744 * WARNING: This file was automatically generated by MDLGen (v3.0)
3 :     * from the machine description file "x86/x86.mdl".
4 :     * DO NOT EDIT this file directly
5 : monnier 247 *)
6 :    
7 :    
8 : monnier 411 signature X86CELLS =
9 :     sig
10 : george 889 include CELLS
11 :     val EFLAGS : CellsBasis.cellkind
12 :     val FFLAGS : CellsBasis.cellkind
13 :     val CELLSET : CellsBasis.cellkind
14 :     val showGP : CellsBasis.register_id -> string
15 :     val showFP : CellsBasis.register_id -> string
16 :     val showCC : CellsBasis.register_id -> string
17 :     val showEFLAGS : CellsBasis.register_id -> string
18 :     val showFFLAGS : CellsBasis.register_id -> string
19 :     val showMEM : CellsBasis.register_id -> string
20 :     val showCTRL : CellsBasis.register_id -> string
21 :     val showCELLSET : CellsBasis.register_id -> string
22 :     val showGPWithSize : (CellsBasis.register_id * CellsBasis.sz) -> string
23 :     val showFPWithSize : (CellsBasis.register_id * CellsBasis.sz) -> string
24 :     val showCCWithSize : (CellsBasis.register_id * CellsBasis.sz) -> string
25 :     val showEFLAGSWithSize : (CellsBasis.register_id * CellsBasis.sz) -> string
26 :     val showFFLAGSWithSize : (CellsBasis.register_id * CellsBasis.sz) -> string
27 :     val showMEMWithSize : (CellsBasis.register_id * CellsBasis.sz) -> string
28 :     val showCTRLWithSize : (CellsBasis.register_id * CellsBasis.sz) -> string
29 :     val showCELLSETWithSize : (CellsBasis.register_id * CellsBasis.sz) -> string
30 :     val eax : CellsBasis.cell
31 :     val ecx : CellsBasis.cell
32 :     val edx : CellsBasis.cell
33 :     val ebx : CellsBasis.cell
34 :     val esp : CellsBasis.cell
35 :     val ebp : CellsBasis.cell
36 :     val esi : CellsBasis.cell
37 :     val edi : CellsBasis.cell
38 :     val ST : int -> CellsBasis.cell
39 :     val ST0 : CellsBasis.cell
40 :     val eflags : CellsBasis.cell
41 :     val addGP : (CellsBasis.cell * cellset) -> cellset
42 :     val addFP : (CellsBasis.cell * cellset) -> cellset
43 :     val addCC : (CellsBasis.cell * cellset) -> cellset
44 :     val addEFLAGS : (CellsBasis.cell * cellset) -> cellset
45 :     val addFFLAGS : (CellsBasis.cell * cellset) -> cellset
46 :     val addMEM : (CellsBasis.cell * cellset) -> cellset
47 :     val addCTRL : (CellsBasis.cell * cellset) -> cellset
48 :     val addCELLSET : (CellsBasis.cell * cellset) -> cellset
49 : monnier 411 end
50 : monnier 247
51 : monnier 411 structure X86Cells : X86CELLS =
52 :     struct
53 :     exception X86Cells
54 :     fun error msg = MLRiscErrorMsg.error("X86Cells",msg)
55 : george 889 open CellsBasis
56 : leunga 744 fun showGPWithSize (r, ty) = (fn (0, 8) => "%al"
57 : george 545 | (0, 16) => "%ax"
58 :     | (0, 32) => "%eax"
59 :     | (1, 8) => "%cl"
60 :     | (1, 16) => "%cx"
61 :     | (1, 32) => "%ecx"
62 :     | (2, 8) => "%dl"
63 :     | (2, 16) => "%dx"
64 :     | (2, 32) => "%edx"
65 :     | (3, 8) => "%bl"
66 :     | (3, 16) => "%bx"
67 :     | (3, 32) => "%ebx"
68 :     | (4, 16) => "%sp"
69 :     | (4, 32) => "%esp"
70 :     | (5, 16) => "%bp"
71 :     | (5, 32) => "%ebp"
72 :     | (6, 16) => "%si"
73 :     | (6, 32) => "%esi"
74 :     | (7, 16) => "%di"
75 :     | (7, 32) => "%edi"
76 :     | (r, _) => "%" ^ (Int.toString r)
77 :     ) (r, ty)
78 : leunga 744 and showFPWithSize (r, ty) = (fn (f, _) => (if (f < 8)
79 :     then (("%st(" ^ (Int.toString f)) ^ ")")
80 :     else ("%f" ^ (Int.toString f)))
81 :     ) (r, ty)
82 :     and showCCWithSize (r, ty) = (fn _ => "cc"
83 :     ) (r, ty)
84 :     and showEFLAGSWithSize (r, ty) = (fn _ => "$eflags"
85 :     ) (r, ty)
86 :     and showFFLAGSWithSize (r, ty) = (fn _ => "$fflags"
87 :     ) (r, ty)
88 :     and showMEMWithSize (r, ty) = (fn _ => "mem"
89 :     ) (r, ty)
90 :     and showCTRLWithSize (r, ty) = (fn _ => "ctrl"
91 :     ) (r, ty)
92 :     and showCELLSETWithSize (r, ty) = (fn _ => "CELLSET"
93 :     ) (r, ty)
94 :     fun showGP r = showGPWithSize (r, 32)
95 :     fun showFP r = showFPWithSize (r, 64)
96 :     fun showCC r = showCCWithSize (r, 32)
97 :     fun showEFLAGS r = showEFLAGSWithSize (r, 32)
98 :     fun showFFLAGS r = showFFLAGSWithSize (r, 32)
99 :     fun showMEM r = showMEMWithSize (r, 8)
100 :     fun showCTRL r = showCTRLWithSize (r, 0)
101 :     fun showCELLSET r = showCELLSETWithSize (r, 0)
102 :     val EFLAGS = CellsBasis.newCellKind {name="EFLAGS", nickname="eflags"}
103 :     and FFLAGS = CellsBasis.newCellKind {name="FFLAGS", nickname="fflags"}
104 :     and CELLSET = CellsBasis.newCellKind {name="CELLSET", nickname="cellset"}
105 : george 889 structure MyCells = Cells
106 : leunga 744 (exception Cells = X86Cells
107 :     val firstPseudo = 256
108 : george 889 val desc_GP = CellsBasis.DESC {low=0, high=31, kind=CellsBasis.GP, defaultValues=[],
109 :     zeroReg=NONE, toString=showGP, toStringWithSize=showGPWithSize,
110 :     counter=ref 0, dedicated=ref 0, physicalRegs=ref CellsBasis.array0}
111 :     and desc_FP = CellsBasis.DESC {low=32, high=63, kind=CellsBasis.FP,
112 : leunga 744 defaultValues=[], zeroReg=NONE, toString=showFP, toStringWithSize=showFPWithSize,
113 : george 889 counter=ref 0, dedicated=ref 0, physicalRegs=ref CellsBasis.array0}
114 :     and desc_EFLAGS = CellsBasis.DESC {low=64, high=64, kind=EFLAGS, defaultValues=[],
115 :     zeroReg=NONE, toString=showEFLAGS, toStringWithSize=showEFLAGSWithSize,
116 :     counter=ref 0, dedicated=ref 0, physicalRegs=ref CellsBasis.array0}
117 :     and desc_FFLAGS = CellsBasis.DESC {low=65, high=65, kind=FFLAGS, defaultValues=[],
118 :     zeroReg=NONE, toString=showFFLAGS, toStringWithSize=showFFLAGSWithSize,
119 :     counter=ref 0, dedicated=ref 0, physicalRegs=ref CellsBasis.array0}
120 :     and desc_MEM = CellsBasis.DESC {low=66, high=65, kind=CellsBasis.MEM,
121 : leunga 744 defaultValues=[], zeroReg=NONE, toString=showMEM, toStringWithSize=showMEMWithSize,
122 : george 889 counter=ref 0, dedicated=ref 0, physicalRegs=ref CellsBasis.array0}
123 :     and desc_CTRL = CellsBasis.DESC {low=66, high=65, kind=CellsBasis.CTRL,
124 : leunga 744 defaultValues=[], zeroReg=NONE, toString=showCTRL, toStringWithSize=showCTRLWithSize,
125 : george 889 counter=ref 0, dedicated=ref 0, physicalRegs=ref CellsBasis.array0}
126 :     and desc_CELLSET = CellsBasis.DESC {low=66, high=65, kind=CELLSET, defaultValues=[],
127 :     zeroReg=NONE, toString=showCELLSET, toStringWithSize=showCELLSETWithSize,
128 :     counter=ref 0, dedicated=ref 0, physicalRegs=ref CellsBasis.array0}
129 : leunga 744 val cellKindDescs = [(CellsBasis.GP, desc_GP), (CellsBasis.FP, desc_FP),
130 :     (CellsBasis.CC, desc_GP), (EFLAGS, desc_EFLAGS), (FFLAGS, desc_FFLAGS),
131 :     (CellsBasis.MEM, desc_MEM), (CellsBasis.CTRL, desc_CTRL), (CELLSET,
132 :     desc_CELLSET)]
133 :     )
134 : monnier 247
135 : george 889 open MyCells
136 : leunga 744 val addGP = CellSet.add
137 :     and addFP = CellSet.add
138 :     and addCC = CellSet.add
139 :     and addEFLAGS = CellSet.add
140 :     and addFFLAGS = CellSet.add
141 :     and addMEM = CellSet.add
142 :     and addCTRL = CellSet.add
143 :     and addCELLSET = CellSet.add
144 :     val RegGP = Reg GP
145 :     and RegFP = Reg FP
146 :     and RegCC = Reg CC
147 :     and RegEFLAGS = Reg EFLAGS
148 :     and RegFFLAGS = Reg FFLAGS
149 :     and RegMEM = Reg MEM
150 :     and RegCTRL = Reg CTRL
151 :     and RegCELLSET = Reg CELLSET
152 :     val eax = RegGP 0
153 :     val ecx = RegGP 1
154 :     val edx = RegGP 2
155 :     val ebx = RegGP 3
156 :     val esp = RegGP 4
157 :     val ebp = RegGP 5
158 :     val esi = RegGP 6
159 :     val edi = RegGP 7
160 :     val stackptrR = RegGP 4
161 :     val ST = (fn x => RegFP x
162 :     )
163 : leunga 775 val ST0 = RegFP 0
164 : leunga 744 val asmTmpR = RegGP 0
165 :     val fasmTmp = RegFP 0
166 :     val eflags = RegEFLAGS 0
167 : monnier 411 end
168 : monnier 247

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