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 /MLRISC/trunk/amd64/instructions/amd64Cells.sml
ViewVC logotype

Annotation of /MLRISC/trunk/amd64/instructions/amd64Cells.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2619 - (view) (download)

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

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