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/alpha/emit/alphaAsm.sml
ViewVC logotype

Annotation of /sml/trunk/src/MLRISC/alpha/emit/alphaAsm.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1017 - (view) (download)

1 : monnier 409 (*
2 : leunga 744 * WARNING: This file was automatically generated by MDLGen (v3.0)
3 :     * from the machine description file "alpha/alpha.mdl".
4 :     * DO NOT EDIT this file directly
5 : monnier 409 *)
6 :    
7 :    
8 : george 984 functor AlphaAsmEmitter(structure S : INSTRUCTION_STREAM
9 :     structure Instr : ALPHAINSTR
10 :     where T = S.P.T
11 : monnier 409 structure Shuffle : ALPHASHUFFLE
12 :     where I = Instr
13 : george 984 structure MLTreeEval : MLTREE_EVAL
14 :     where T = Instr.T
15 : monnier 409 ) : INSTRUCTION_EMITTER =
16 :     struct
17 :     structure I = Instr
18 :     structure C = I.C
19 : leunga 775 structure T = I.T
20 : george 984 structure S = S
21 : monnier 409 structure P = S.P
22 :     structure Constant = I.Constant
23 :    
24 : monnier 498 val show_cellset = MLRiscControl.getFlag "asm-show-cellset"
25 : george 545 val show_region = MLRiscControl.getFlag "asm-show-region"
26 : leunga 796 val show_cutsTo = MLRiscControl.getFlag "asm-show-cutsto"
27 : leunga 594 val indent_copies = MLRiscControl.getFlag "asm-indent-copies"
28 : monnier 498
29 : george 545 fun error msg = MLRiscErrorMsg.error("AlphaAsmEmitter",msg)
30 : monnier 409
31 : monnier 429 fun makeStream formatAnnotations =
32 : monnier 409 let val stream = !AsmStream.asmOutStream
33 : monnier 429 fun emit' s = TextIO.output(stream,s)
34 :     val newline = ref true
35 :     val tabs = ref 0
36 :     fun tabbing 0 = ()
37 :     | tabbing n = (emit' "\t"; tabbing(n-1))
38 :     fun emit s = (tabbing(!tabs); tabs := 0; newline := false; emit' s)
39 :     fun nl() = (tabs := 0; if !newline then () else (newline := true; emit' "\n"))
40 : monnier 409 fun comma() = emit ","
41 : leunga 594 fun tab() = tabs := 1
42 :     fun indent() = tabs := 2
43 : monnier 429 fun ms n = let val s = Int.toString n
44 :     in if n<0 then "-"^String.substring(s,1,size s-1)
45 :     else s
46 :     end
47 : george 984 fun emit_label lab = emit(P.Client.AsmPseudoOps.lexpToString(T.LABEL lab))
48 :     fun emit_labexp le = emit(P.Client.AsmPseudoOps.lexpToString (T.LABEXP le))
49 : monnier 409 fun emit_const c = emit(Constant.toString c)
50 :     fun emit_int i = emit(ms i)
51 :     fun paren f = (emit "("; f(); emit ")")
52 : george 1017 fun defineLabel lab = emit(P.Client.AsmPseudoOps.defineLabel lab^"\n")
53 : monnier 409 fun entryLabel lab = defineLabel lab
54 : george 909 fun comment msg = (tab(); emit("/* " ^ msg ^ " */\n"))
55 : monnier 409 fun annotation a = (comment(Annotations.toString a); nl())
56 : leunga 815 fun getAnnotations() = error "getAnnotations"
57 : george 545 fun doNothing _ = ()
58 : george 909 fun fail _ = raise Fail "AsmEmitter"
59 : monnier 409 fun emit_region mem = comment(I.Region.toString mem)
60 : george 545 val emit_region =
61 :     if !show_region then emit_region else doNothing
62 : george 984 fun pseudoOp pOp = (emit(P.toString pOp); emit "\n")
63 : monnier 409 fun init size = (comment("Code Size = " ^ ms size); nl())
64 : leunga 744 val emitCellInfo = AsmFormatUtil.reginfo
65 :     (emit,formatAnnotations)
66 : george 889 fun emitCell r = (emit(CellsBasis.toString r); emitCellInfo r)
67 : monnier 475 fun emit_cellset(title,cellset) =
68 : jhr 900 (nl(); comment(title^CellsBasis.CellSet.toString cellset))
69 : george 545 val emit_cellset =
70 :     if !show_cellset then emit_cellset else doNothing
71 : monnier 475 fun emit_defs cellset = emit_cellset("defs: ",cellset)
72 :     fun emit_uses cellset = emit_cellset("uses: ",cellset)
73 : leunga 796 val emit_cutsTo =
74 :     if !show_cutsTo then AsmFormatUtil.emit_cutsTo emit
75 :     else doNothing
76 : leunga 744 fun emitter instr =
77 :     let
78 :     fun emit_operand (I.REGop GP) = emitCell GP
79 : george 545 | emit_operand (I.IMMop int) = emit_int int
80 : monnier 429 | emit_operand (I.HILABop labexp) =
81 : george 545 ( emit "hi(";
82 : leunga 744 emit_labexp labexp;
83 :     emit ")" )
84 : monnier 429 | emit_operand (I.LOLABop labexp) =
85 : george 545 ( emit "lo(";
86 : leunga 744 emit_labexp labexp;
87 :     emit ")" )
88 : george 545 | emit_operand (I.LABop labexp) = emit_labexp labexp
89 : monnier 429 and asm_branch (I.BR) = "br"
90 :     | asm_branch (I.BLBC) = "blbc"
91 :     | asm_branch (I.BEQ) = "beq"
92 :     | asm_branch (I.BLT) = "blt"
93 :     | asm_branch (I.BLE) = "ble"
94 :     | asm_branch (I.BLBS) = "blbs"
95 :     | asm_branch (I.BNE) = "bne"
96 :     | asm_branch (I.BGE) = "bge"
97 :     | asm_branch (I.BGT) = "bgt"
98 : george 545 and emit_branch x = emit (asm_branch x)
99 : monnier 429 and asm_fbranch (I.FBEQ) = "fbeq"
100 :     | asm_fbranch (I.FBLT) = "fblt"
101 :     | asm_fbranch (I.FBLE) = "fble"
102 :     | asm_fbranch (I.FBNE) = "fbne"
103 :     | asm_fbranch (I.FBGE) = "fbge"
104 :     | asm_fbranch (I.FBGT) = "fbgt"
105 : george 545 and emit_fbranch x = emit (asm_fbranch x)
106 : leunga 585 and asm_load (I.LDB) = "ldb"
107 :     | asm_load (I.LDW) = "ldw"
108 :     | asm_load (I.LDBU) = "ldbu"
109 : leunga 583 | asm_load (I.LDWU) = "ldwu"
110 :     | asm_load (I.LDL) = "ldl"
111 : monnier 429 | asm_load (I.LDL_L) = "ldl_l"
112 :     | asm_load (I.LDQ) = "ldq"
113 :     | asm_load (I.LDQ_L) = "ldq_l"
114 :     | asm_load (I.LDQ_U) = "ldq_u"
115 : george 545 and emit_load x = emit (asm_load x)
116 : leunga 583 and asm_store (I.STB) = "stb"
117 :     | asm_store (I.STW) = "stw"
118 :     | asm_store (I.STL) = "stl"
119 : george 545 | asm_store (I.STQ) = "stq"
120 :     | asm_store (I.STQ_U) = "stq_u"
121 :     and emit_store x = emit (asm_store x)
122 :     and asm_fload (I.LDF) = "ldf"
123 :     | asm_fload (I.LDG) = "ldg"
124 :     | asm_fload (I.LDS) = "lds"
125 :     | asm_fload (I.LDT) = "ldt"
126 :     and emit_fload x = emit (asm_fload x)
127 :     and asm_fstore (I.STF) = "stf"
128 :     | asm_fstore (I.STG) = "stg"
129 :     | asm_fstore (I.STS) = "sts"
130 :     | asm_fstore (I.STT) = "stt"
131 :     and emit_fstore x = emit (asm_fstore x)
132 : monnier 409 and asm_operate (I.ADDL) = "addl"
133 :     | asm_operate (I.ADDQ) = "addq"
134 :     | asm_operate (I.CMPBGE) = "cmpbge"
135 :     | asm_operate (I.CMPEQ) = "cmpeq"
136 :     | asm_operate (I.CMPLE) = "cmple"
137 :     | asm_operate (I.CMPLT) = "cmplt"
138 :     | asm_operate (I.CMPULE) = "cmpule"
139 :     | asm_operate (I.CMPULT) = "cmpult"
140 :     | asm_operate (I.SUBL) = "subl"
141 :     | asm_operate (I.SUBQ) = "subq"
142 :     | asm_operate (I.S4ADDL) = "s4addl"
143 :     | asm_operate (I.S4ADDQ) = "s4addq"
144 :     | asm_operate (I.S4SUBL) = "s4subl"
145 :     | asm_operate (I.S4SUBQ) = "s4subq"
146 :     | asm_operate (I.S8ADDL) = "s8addl"
147 :     | asm_operate (I.S8ADDQ) = "s8addq"
148 :     | asm_operate (I.S8SUBL) = "s8subl"
149 :     | asm_operate (I.S8SUBQ) = "s8subq"
150 :     | asm_operate (I.AND) = "and"
151 :     | asm_operate (I.BIC) = "bic"
152 :     | asm_operate (I.BIS) = "bis"
153 :     | asm_operate (I.EQV) = "eqv"
154 :     | asm_operate (I.ORNOT) = "ornot"
155 :     | asm_operate (I.XOR) = "xor"
156 :     | asm_operate (I.EXTBL) = "extbl"
157 :     | asm_operate (I.EXTLH) = "extlh"
158 :     | asm_operate (I.EXTLL) = "extll"
159 :     | asm_operate (I.EXTQH) = "extqh"
160 :     | asm_operate (I.EXTQL) = "extql"
161 :     | asm_operate (I.EXTWH) = "extwh"
162 :     | asm_operate (I.EXTWL) = "extwl"
163 :     | asm_operate (I.INSBL) = "insbl"
164 :     | asm_operate (I.INSLH) = "inslh"
165 :     | asm_operate (I.INSLL) = "insll"
166 :     | asm_operate (I.INSQH) = "insqh"
167 :     | asm_operate (I.INSQL) = "insql"
168 :     | asm_operate (I.INSWH) = "inswh"
169 :     | asm_operate (I.INSWL) = "inswl"
170 :     | asm_operate (I.MSKBL) = "mskbl"
171 :     | asm_operate (I.MSKLH) = "msklh"
172 :     | asm_operate (I.MSKLL) = "mskll"
173 :     | asm_operate (I.MSKQH) = "mskqh"
174 :     | asm_operate (I.MSKQL) = "mskql"
175 :     | asm_operate (I.MSKWH) = "mskwh"
176 :     | asm_operate (I.MSKWL) = "mskwl"
177 :     | asm_operate (I.SLL) = "sll"
178 :     | asm_operate (I.SRA) = "sra"
179 :     | asm_operate (I.SRL) = "srl"
180 :     | asm_operate (I.ZAP) = "zap"
181 :     | asm_operate (I.ZAPNOT) = "zapnot"
182 :     | asm_operate (I.MULL) = "mull"
183 :     | asm_operate (I.MULQ) = "mulq"
184 :     | asm_operate (I.UMULH) = "umulh"
185 : george 545 and emit_operate x = emit (asm_operate x)
186 :     and asm_cmove (I.CMOVEQ) = "cmoveq"
187 :     | asm_cmove (I.CMOVLBC) = "cmovlbc"
188 :     | asm_cmove (I.CMOVLBS) = "cmovlbs"
189 :     | asm_cmove (I.CMOVGE) = "cmovge"
190 :     | asm_cmove (I.CMOVGT) = "cmovgt"
191 :     | asm_cmove (I.CMOVLE) = "cmovle"
192 :     | asm_cmove (I.CMOVLT) = "cmovlt"
193 :     | asm_cmove (I.CMOVNE) = "cmovne"
194 :     and emit_cmove x = emit (asm_cmove x)
195 :     and asm_pseudo_op (I.DIVL) = "divl"
196 :     | asm_pseudo_op (I.DIVLU) = "divlu"
197 :     | asm_pseudo_op (I.DIVQ) = "divq"
198 :     | asm_pseudo_op (I.DIVQU) = "divqu"
199 :     | asm_pseudo_op (I.REML) = "reml"
200 :     | asm_pseudo_op (I.REMLU) = "remlu"
201 :     | asm_pseudo_op (I.REMQ) = "remq"
202 :     | asm_pseudo_op (I.REMQU) = "remqu"
203 :     and emit_pseudo_op x = emit (asm_pseudo_op x)
204 :     and asm_operateV (I.ADDLV) = "addlv"
205 :     | asm_operateV (I.ADDQV) = "addqv"
206 :     | asm_operateV (I.SUBLV) = "sublv"
207 :     | asm_operateV (I.SUBQV) = "subqv"
208 :     | asm_operateV (I.MULLV) = "mullv"
209 :     | asm_operateV (I.MULQV) = "mulqv"
210 :     and emit_operateV x = emit (asm_operateV x)
211 :     and asm_funary (I.CVTLQ) = "cvtlq"
212 :     | asm_funary (I.CVTQL) = "cvtql"
213 :     | asm_funary (I.CVTQLSV) = "cvtqlsv"
214 :     | asm_funary (I.CVTQLV) = "cvtqlv"
215 :     | asm_funary (I.CVTQS) = "cvtqs"
216 :     | asm_funary (I.CVTQSC) = "cvtqsc"
217 :     | asm_funary (I.CVTQT) = "cvtqt"
218 :     | asm_funary (I.CVTQTC) = "cvtqtc"
219 :     | asm_funary (I.CVTTS) = "cvtts"
220 :     | asm_funary (I.CVTTSC) = "cvttsc"
221 :     | asm_funary (I.CVTST) = "cvtst"
222 :     | asm_funary (I.CVTSTS) = "cvtsts"
223 :     | asm_funary (I.CVTTQ) = "cvttq"
224 :     | asm_funary (I.CVTTQC) = "cvttqc"
225 :     and emit_funary x = emit (asm_funary x)
226 :     and asm_foperate (I.CPYS) = "cpys"
227 :     | asm_foperate (I.CPYSE) = "cpyse"
228 :     | asm_foperate (I.CPYSN) = "cpysn"
229 :     | asm_foperate (I.MF_FPCR) = "mf_fpcr"
230 :     | asm_foperate (I.MT_FPCR) = "mt_fpcr"
231 :     | asm_foperate (I.CMPTEQ) = "cmpteq"
232 :     | asm_foperate (I.CMPTLT) = "cmptlt"
233 :     | asm_foperate (I.CMPTLE) = "cmptle"
234 :     | asm_foperate (I.CMPTUN) = "cmptun"
235 :     | asm_foperate (I.CMPTEQSU) = "cmpteqsu"
236 :     | asm_foperate (I.CMPTLTSU) = "cmptltsu"
237 :     | asm_foperate (I.CMPTLESU) = "cmptlesu"
238 :     | asm_foperate (I.CMPTUNSU) = "cmptunsu"
239 :     | asm_foperate (I.ADDS) = "adds"
240 :     | asm_foperate (I.ADDT) = "addt"
241 :     | asm_foperate (I.DIVS) = "divs"
242 :     | asm_foperate (I.DIVT) = "divt"
243 :     | asm_foperate (I.MULS) = "muls"
244 :     | asm_foperate (I.MULT) = "mult"
245 :     | asm_foperate (I.SUBS) = "subs"
246 :     | asm_foperate (I.SUBT) = "subt"
247 :     and emit_foperate x = emit (asm_foperate x)
248 : monnier 429 and asm_fcmove (I.FCMOVEQ) = "fcmoveq"
249 : george 545 | asm_fcmove (I.FCMOVGE) = "fcmovge"
250 :     | asm_fcmove (I.FCMOVGT) = "fcmovgt"
251 : monnier 429 | asm_fcmove (I.FCMOVLE) = "fcmovle"
252 : george 545 | asm_fcmove (I.FCMOVLT) = "fcmovlt"
253 :     | asm_fcmove (I.FCMOVNE) = "fcmovne"
254 :     and emit_fcmove x = emit (asm_fcmove x)
255 :     and asm_foperateV (I.ADDSSUD) = "addssud"
256 :     | asm_foperateV (I.ADDSSU) = "addssu"
257 :     | asm_foperateV (I.ADDTSUD) = "addtsud"
258 :     | asm_foperateV (I.ADDTSU) = "addtsu"
259 :     | asm_foperateV (I.DIVSSUD) = "divssud"
260 :     | asm_foperateV (I.DIVSSU) = "divssu"
261 :     | asm_foperateV (I.DIVTSUD) = "divtsud"
262 :     | asm_foperateV (I.DIVTSU) = "divtsu"
263 :     | asm_foperateV (I.MULSSUD) = "mulssud"
264 :     | asm_foperateV (I.MULSSU) = "mulssu"
265 :     | asm_foperateV (I.MULTSUD) = "multsud"
266 :     | asm_foperateV (I.MULTSU) = "multsu"
267 :     | asm_foperateV (I.SUBSSUD) = "subssud"
268 :     | asm_foperateV (I.SUBSSU) = "subssu"
269 :     | asm_foperateV (I.SUBTSUD) = "subtsud"
270 :     | asm_foperateV (I.SUBTSU) = "subtsu"
271 :     and emit_foperateV x = emit (asm_foperateV x)
272 :     and asm_osf_user_palcode (I.BPT) = "bpt"
273 :     | asm_osf_user_palcode (I.BUGCHK) = "bugchk"
274 :     | asm_osf_user_palcode (I.CALLSYS) = "callsys"
275 :     | asm_osf_user_palcode (I.GENTRAP) = "gentrap"
276 :     | asm_osf_user_palcode (I.IMB) = "imb"
277 :     | asm_osf_user_palcode (I.RDUNIQUE) = "rdunique"
278 :     | asm_osf_user_palcode (I.WRUNIQUE) = "wrunique"
279 :     and emit_osf_user_palcode x = emit (asm_osf_user_palcode x)
280 : monnier 409
281 : george 1009 (*#line 479.7 "alpha/alpha.mdl"*)
282 : george 984 fun isZero (I.LABop le) = (MLTreeEval.valueOf le) = 0
283 : monnier 469 | isZero _ = false
284 : leunga 594 fun emitInstr' instr =
285 : leunga 744 (case instr of
286 : george 1003 I.LDA{r, b, d} => (if ((isZero d) andalso (CellsBasis.sameCell (r,
287 : george 889 b)))
288 : leunga 744 then ()
289 :     else
290 :     (
291 :     ( emit "lda\t";
292 :     emitCell r;
293 :     emit ", ";
294 :     emit_operand d );
295 : george 889 (if ((CellsBasis.registerId b) = 31)
296 : leunga 744 then ()
297 :     else
298 :     ( emit "(";
299 :     emitCell b;
300 :     emit ")" ))))
301 :     | I.LDAH{r, b, d} =>
302 :     (
303 :     ( emit "ldah\t";
304 :     emitCell r;
305 :     emit ", ";
306 :     emit_operand d );
307 : george 889 (if ((CellsBasis.registerId b) = 31)
308 : monnier 469 then ()
309 :     else
310 : george 545 ( emit "(";
311 : leunga 744 emitCell b;
312 :     emit ")" )))
313 :     | I.LOAD{ldOp, r, b, d, mem} =>
314 :     ( emit_load ldOp;
315 :     emit "\t";
316 :     emitCell r;
317 :     emit ", ";
318 :     emit_operand d;
319 :     emit "(";
320 :     emitCell b;
321 :     emit ")";
322 :     emit_region mem )
323 :     | I.STORE{stOp, r, b, d, mem} =>
324 :     ( emit_store stOp;
325 :     emit "\t";
326 :     emitCell r;
327 :     emit ", ";
328 :     emit_operand d;
329 :     emit "(";
330 :     emitCell b;
331 :     emit ")";
332 :     emit_region mem )
333 :     | I.FLOAD{ldOp, r, b, d, mem} =>
334 :     ( emit_fload ldOp;
335 :     emit "\t";
336 :     emitCell r;
337 :     emit ", ";
338 :     emit_operand d;
339 :     emit "(";
340 :     emitCell b;
341 :     emit ")";
342 :     emit_region mem )
343 :     | I.FSTORE{stOp, r, b, d, mem} =>
344 :     ( emit_fstore stOp;
345 :     emit "\t";
346 :     emitCell r;
347 :     emit ", ";
348 :     emit_operand d;
349 :     emit "(";
350 :     emitCell b;
351 :     emit ")";
352 :     emit_region mem )
353 :     | I.JMPL({r, b, d}, list) =>
354 :     ( emit "jmp\t";
355 :     emitCell r;
356 :     emit ", (";
357 :     emitCell b;
358 :     emit ")" )
359 : leunga 796 | I.JSR{r, b, d, defs, uses, cutsTo, mem} =>
360 : leunga 744 ( emit "jsr\t";
361 :     emitCell r;
362 :     emit ", (";
363 :     emitCell b;
364 :     emit ")";
365 :     emit_region mem;
366 :     emit_defs defs;
367 : leunga 796 emit_uses uses;
368 :     emit_cutsTo cutsTo )
369 :     | I.BSR{r, lab, defs, uses, cutsTo, mem} =>
370 : leunga 744 ( emit "bsr\t";
371 :     emitCell r;
372 :     emit ", ";
373 :     emit_label lab;
374 :     emit_region mem;
375 :     emit_defs defs;
376 : leunga 796 emit_uses uses;
377 :     emit_cutsTo cutsTo )
378 : leunga 744 | I.RET{r, b, d} =>
379 :     ( emit "ret\t";
380 :     emitCell r;
381 :     emit ", (";
382 :     emitCell b;
383 :     emit ")" )
384 :     | I.BRANCH{b, r, lab} =>
385 :     ( emit_branch b;
386 :     emit "\t";
387 :     emitCell r;
388 :     emit ", ";
389 :     emit_label lab )
390 :     | I.FBRANCH{b, f, lab} =>
391 :     ( emit_fbranch b;
392 :     emit "\t";
393 :     emitCell f;
394 :     emit ", ";
395 :     emit_label lab )
396 :     | I.OPERATE{oper, ra, rb, rc} =>
397 :     let
398 : george 1009 (*#line 568.15 "alpha/alpha.mdl"*)
399 : leunga 744 fun disp () =
400 :     ( emit_operate oper;
401 :     emit "\t";
402 :     emitCell ra;
403 :     emit ", ";
404 :     emit_operand rb;
405 :     emit ", ";
406 :     emitCell rc )
407 :     in
408 : george 889 (case (oper, CellsBasis.registerId ra, rb, CellsBasis.registerId rc) of
409 :     (I.BIS, 27, I.REGop rb, 29) => (if ((CellsBasis.registerId rb) = 31)
410 : leunga 744 then (emit "ldgp\t$29, 0($27)")
411 :     else (disp ()))
412 : george 889 | (I.BIS, 26, I.REGop rb, 29) => (if ((CellsBasis.registerId rb) = 31)
413 : leunga 744 then (emit "ldgp\t$29, 0($26)")
414 :     else (disp ()))
415 :     | _ => disp ()
416 :     )
417 :     end
418 :     | I.OPERATEV{oper, ra, rb, rc} =>
419 :     ( emit_operateV oper;
420 :     emit "\t";
421 :     emitCell ra;
422 :     emit ", ";
423 :     emit_operand rb;
424 :     emit ", ";
425 :     emitCell rc )
426 :     | I.CMOVE{oper, ra, rb, rc} =>
427 :     ( emit_cmove oper;
428 :     emit "\t";
429 :     emitCell ra;
430 :     emit ", ";
431 :     emit_operand rb;
432 :     emit ", ";
433 :     emitCell rc )
434 :     | I.PSEUDOARITH{oper, ra, rb, rc, tmps} =>
435 :     ( emit_pseudo_op oper;
436 :     emit "\t";
437 :     emitCell ra;
438 :     emit ", ";
439 :     emit_operand rb;
440 :     emit ", ";
441 :     emitCell rc;
442 :     emit_cellset ("tmps", tmps))
443 :     | I.FUNARY{oper, fb, fc} =>
444 :     ( emit_funary oper;
445 :     emit "\t";
446 :     emitCell fb;
447 :     emit ", ";
448 :     emitCell fc )
449 :     | I.FOPERATE{oper, fa, fb, fc} =>
450 :     ( emit_foperate oper;
451 :     emit "\t";
452 :     emitCell fa;
453 :     emit ", ";
454 :     emitCell fb;
455 :     emit ", ";
456 :     emitCell fc )
457 :     | I.FOPERATEV{oper, fa, fb, fc} =>
458 :     ( emit_foperateV oper;
459 :     emit "\t";
460 :     emitCell fa;
461 :     emit ", ";
462 :     emitCell fb;
463 :     emit ", ";
464 :     emitCell fc )
465 :     | I.FCMOVE{oper, fa, fb, fc} =>
466 :     ( emit_fcmove oper;
467 :     emit "\t";
468 :     emitCell fa;
469 :     emit ", ";
470 :     emitCell fb;
471 :     emit ", ";
472 :     emitCell fc )
473 :     | I.TRAPB => emit "trapb"
474 :     | I.CALL_PAL{code, def, use} =>
475 :     ( emit "call_pal ";
476 :     emit_osf_user_palcode code )
477 :     | I.SOURCE{} => emit "source"
478 :     | I.SINK{} => emit "sink"
479 :     | I.PHI{} => emit "phi"
480 : leunga 594 )
481 : george 1003 in tab(); emitInstr' instr; nl()
482 :     end (* emitter *)
483 :     and emitInstrIndented i = (indent(); emitInstr i; nl())
484 :     and emitInstrs instrs =
485 : leunga 594 app (if !indent_copies then emitInstrIndented
486 :     else emitInstr) instrs
487 : monnier 409
488 : george 1003 and emitInstr(I.ANNOTATION{i,a}) =
489 :     ( comment(Annotations.toString a);
490 :     nl();
491 :     emitInstr i )
492 :     | emitInstr(I.LIVE{regs, spilled}) =
493 :     comment("live= " ^ CellsBasis.CellSet.toString regs ^
494 :     "spilled= " ^ CellsBasis.CellSet.toString spilled)
495 :     | emitInstr(I.KILL{regs, spilled}) =
496 :     comment("killed:: " ^ CellsBasis.CellSet.toString regs ^
497 :     "spilled:: " ^ CellsBasis.CellSet.toString spilled)
498 :     | emitInstr(I.INSTR i) = emitter i
499 : george 1009 | emitInstr(I.COPY{k=CellsBasis.GP, sz, src, dst, tmp}) =
500 :     emitInstrs(Shuffle.shuffle{tmp=tmp, src=src, dst=dst})
501 :     | emitInstr(I.COPY{k=CellsBasis.FP, sz, src, dst, tmp}) =
502 :     emitInstrs(Shuffle.shufflefp{tmp=tmp, src=src, dst=dst})
503 : george 1003 | emitInstr _ = error "emitInstr"
504 :    
505 : monnier 429 in S.STREAM{beginCluster=init,
506 : monnier 409 pseudoOp=pseudoOp,
507 : george 1003 emit=emitInstr,
508 : george 909 endCluster=fail,
509 : monnier 409 defineLabel=defineLabel,
510 :     entryLabel=entryLabel,
511 :     comment=comment,
512 :     exitBlock=doNothing,
513 : leunga 815 annotation=annotation,
514 :     getAnnotations=getAnnotations
515 : monnier 409 }
516 :     end
517 :     end
518 :    

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