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

Annotation of /sml/trunk/src/MLRISC/x86/emit/x86Asm.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 555 - (view) (download)

1 : monnier 411 (*
2 : george 545 * This file was automatically generated by MDGen (v2.0)
3 : monnier 411 * from the machine description file "x86/x86.md".
4 : monnier 247 *)
5 :    
6 :    
7 : monnier 411 functor X86AsmEmitter(structure Instr : X86INSTR
8 :     structure Stream : INSTRUCTION_STREAM
9 :     structure Shuffle : X86SHUFFLE
10 :     where I = Instr
11 :    
12 : george 555 (*#line 171.7 "x86/x86.md"*)
13 : monnier 411 structure MemRegs : MEMORY_REGISTERS where I=Instr
14 :     ) : INSTRUCTION_EMITTER =
15 : monnier 247 struct
16 : monnier 411 structure I = Instr
17 :     structure C = I.C
18 :     structure S = Stream
19 :     structure P = S.P
20 : george 545 structure LabelExp = I.LabelExp
21 : monnier 411 structure Constant = I.Constant
22 :    
23 : monnier 498 val show_cellset = MLRiscControl.getFlag "asm-show-cellset"
24 : george 545 val show_region = MLRiscControl.getFlag "asm-show-region"
25 : monnier 498
26 : george 545 fun error msg = MLRiscErrorMsg.error("X86AsmEmitter",msg)
27 : monnier 411
28 : monnier 429 fun makeStream formatAnnotations =
29 : monnier 411 let val stream = !AsmStream.asmOutStream
30 : monnier 429 fun emit' s = TextIO.output(stream,s)
31 :     val newline = ref true
32 :     val tabs = ref 0
33 :     fun tabbing 0 = ()
34 :     | tabbing n = (emit' "\t"; tabbing(n-1))
35 :     fun emit s = (tabbing(!tabs); tabs := 0; newline := false; emit' s)
36 :     fun nl() = (tabs := 0; if !newline then () else (newline := true; emit' "\n"))
37 : monnier 411 fun comma() = emit ","
38 : monnier 429 fun tab() = tabs := !tabs + 1
39 :     fun ms n = let val s = Int.toString n
40 :     in if n<0 then "-"^String.substring(s,1,size s-1)
41 :     else s
42 :     end
43 : monnier 411 fun emit_label lab = emit(Label.nameOf lab)
44 :     fun emit_labexp le = emit(LabelExp.toString le)
45 :     fun emit_const c = emit(Constant.toString c)
46 :     fun emit_int i = emit(ms i)
47 :     fun paren f = (emit "("; f(); emit ")")
48 :     fun defineLabel lab = emit(Label.nameOf lab^":\n")
49 :     fun entryLabel lab = defineLabel lab
50 :     fun comment msg = emit("\t/* " ^ msg ^ " */")
51 :     fun annotation a = (comment(Annotations.toString a); nl())
52 : george 545 fun doNothing _ = ()
53 : monnier 411 fun emit_region mem = comment(I.Region.toString mem)
54 : george 545 val emit_region =
55 :     if !show_region then emit_region else doNothing
56 : monnier 411 fun pseudoOp pOp = emit(P.toString pOp)
57 :     fun init size = (comment("Code Size = " ^ ms size); nl())
58 :     fun emitter regmap =
59 :     let
60 : george 545 val emitRegInfo = AsmFormatUtil.reginfo
61 :     (emit,regmap,formatAnnotations)
62 :     fun emit_GP r =
63 :     ( emit (C.showGP (regmap r));
64 :     emitRegInfo r )
65 : monnier 429 and emit_FP r =
66 : george 545 ( emit (C.showFP (regmap r));
67 :     emitRegInfo r )
68 :     and emit_CC r =
69 :     ( emit (C.showCC (regmap r));
70 :     emitRegInfo r )
71 :     and emit_MEM r =
72 :     ( emit (C.showMEM (regmap r));
73 :     emitRegInfo r )
74 :     and emit_CTRL r =
75 :     ( emit (C.showCTRL (regmap r));
76 :     emitRegInfo r )
77 : monnier 498
78 :     fun emit_cellset(title,cellset) =
79 :     (nl(); comment(title^C.cellsetToString' regmap cellset))
80 : george 545 val emit_cellset =
81 :     if !show_cellset then emit_cellset else doNothing
82 : monnier 498 fun emit_defs cellset = emit_cellset("defs: ",cellset)
83 :     fun emit_uses cellset = emit_cellset("uses: ",cellset)
84 : george 545 fun asm_cond (I.EQ) = "e"
85 :     | asm_cond (I.NE) = "ne"
86 :     | asm_cond (I.LT) = "l"
87 :     | asm_cond (I.LE) = "le"
88 :     | asm_cond (I.GT) = "g"
89 :     | asm_cond (I.GE) = "ge"
90 :     | asm_cond (I.B) = "b"
91 :     | asm_cond (I.BE) = "be"
92 :     | asm_cond (I.A) = "a"
93 :     | asm_cond (I.AE) = "ae"
94 :     | asm_cond (I.C) = "c"
95 :     | asm_cond (I.NC) = "nc"
96 :     | asm_cond (I.P) = "p"
97 :     | asm_cond (I.NP) = "np"
98 :     | asm_cond (I.O) = "o"
99 :     | asm_cond (I.NO) = "no"
100 :     and emit_cond x = emit (asm_cond x)
101 :     and asm_binaryOp (I.ADDL) = "addl"
102 :     | asm_binaryOp (I.SUBL) = "subl"
103 :     | asm_binaryOp (I.ANDL) = "andl"
104 :     | asm_binaryOp (I.ORL) = "orl"
105 :     | asm_binaryOp (I.XORL) = "xorl"
106 :     | asm_binaryOp (I.SHLL) = "shll"
107 :     | asm_binaryOp (I.SARL) = "sarl"
108 :     | asm_binaryOp (I.SHRL) = "shrl"
109 :     | asm_binaryOp (I.ADCL) = "adcl"
110 :     | asm_binaryOp (I.SBBL) = "sbbl"
111 :     | asm_binaryOp (I.ADDW) = "addw"
112 :     | asm_binaryOp (I.SUBW) = "subw"
113 :     | asm_binaryOp (I.ANDW) = "andw"
114 :     | asm_binaryOp (I.ORW) = "orw"
115 :     | asm_binaryOp (I.XORW) = "xorw"
116 :     | asm_binaryOp (I.SHLW) = "shlw"
117 :     | asm_binaryOp (I.SARW) = "sarw"
118 :     | asm_binaryOp (I.SHRW) = "shrw"
119 :     | asm_binaryOp (I.ADDB) = "addb"
120 :     | asm_binaryOp (I.SUBB) = "subb"
121 :     | asm_binaryOp (I.ANDB) = "andb"
122 :     | asm_binaryOp (I.ORB) = "orb"
123 :     | asm_binaryOp (I.XORB) = "xorb"
124 :     | asm_binaryOp (I.SHLB) = "shlb"
125 :     | asm_binaryOp (I.SARB) = "sarb"
126 :     | asm_binaryOp (I.SHRB) = "shrb"
127 :     and emit_binaryOp x = emit (asm_binaryOp x)
128 :     and asm_multDivOp (I.UMUL) = "umul"
129 :     | asm_multDivOp (I.IDIV) = "idiv"
130 :     | asm_multDivOp (I.UDIV) = "udiv"
131 :     and emit_multDivOp x = emit (asm_multDivOp x)
132 :     and asm_unaryOp (I.DECL) = "decl"
133 :     | asm_unaryOp (I.INCL) = "incl"
134 :     | asm_unaryOp (I.NEGL) = "negl"
135 :     | asm_unaryOp (I.NOTL) = "notl"
136 :     | asm_unaryOp (I.NOTW) = "notw"
137 :     | asm_unaryOp (I.NOTB) = "notb"
138 :     and emit_unaryOp x = emit (asm_unaryOp x)
139 :     and asm_move (I.MOVL) = "movl"
140 :     | asm_move (I.MOVB) = "movb"
141 :     | asm_move (I.MOVW) = "movw"
142 :     | asm_move (I.MOVSWL) = "movswl"
143 :     | asm_move (I.MOVZWL) = "movzwl"
144 :     | asm_move (I.MOVSBL) = "movsbl"
145 :     | asm_move (I.MOVZBL) = "movzbl"
146 :     and emit_move x = emit (asm_move x)
147 : monnier 429 and asm_fbinOp (I.FADDP) = "faddp"
148 : george 555 | asm_fbinOp (I.FADDS) = "fadds"
149 :     | asm_fbinOp (I.FIADDS) = "fiadds"
150 : monnier 411 | asm_fbinOp (I.FMULP) = "fmulp"
151 : george 555 | asm_fbinOp (I.FMULS) = "fmuls"
152 :     | asm_fbinOp (I.FIMULS) = "fimuls"
153 : monnier 411 | asm_fbinOp (I.FSUBP) = "fsubp"
154 : george 555 | asm_fbinOp (I.FSUBS) = "fsubs"
155 :     | asm_fbinOp (I.FISUBS) = "fisubs"
156 : monnier 411 | asm_fbinOp (I.FSUBRP) = "fsubrp"
157 : george 555 | asm_fbinOp (I.FSUBRS) = "fsubrs"
158 :     | asm_fbinOp (I.FISUBRS) = "fisubrs"
159 : monnier 411 | asm_fbinOp (I.FDIVP) = "fdivp"
160 : george 555 | asm_fbinOp (I.FDIVS) = "fdivs"
161 :     | asm_fbinOp (I.FIDIVS) = "fidivs"
162 : monnier 411 | asm_fbinOp (I.FDIVRP) = "fdivrp"
163 : george 555 | asm_fbinOp (I.FDIVRS) = "fdivrs"
164 :     | asm_fbinOp (I.FIDIVRS) = "fidivrs"
165 :     | asm_fbinOp (I.FADDL) = "faddl"
166 :     | asm_fbinOp (I.FIADDL) = "fiaddl"
167 :     | asm_fbinOp (I.FMULL) = "fmull"
168 :     | asm_fbinOp (I.FIMULL) = "fimull"
169 :     | asm_fbinOp (I.FSUBL) = "fsubl"
170 :     | asm_fbinOp (I.FISUBL) = "fisubl"
171 :     | asm_fbinOp (I.FSUBRL) = "fsubrl"
172 :     | asm_fbinOp (I.FISUBRL) = "fisubrl"
173 :     | asm_fbinOp (I.FDIVL) = "fdivl"
174 :     | asm_fbinOp (I.FIDIVL) = "fidivl"
175 :     | asm_fbinOp (I.FDIVRL) = "fdivrl"
176 :     | asm_fbinOp (I.FIDIVRL) = "fidivrl"
177 : george 545 and emit_fbinOp x = emit (asm_fbinOp x)
178 : monnier 429 and asm_funOp (I.FABS) = "fabs"
179 :     | asm_funOp (I.FCHS) = "fchs"
180 : george 545 | asm_funOp (I.FSIN) = "fsin"
181 :     | asm_funOp (I.FCOS) = "fcos"
182 :     | asm_funOp (I.FTAN) = "ftan"
183 :     | asm_funOp (I.FSCALE) = "fscale"
184 :     | asm_funOp (I.FRNDINT) = "frndint"
185 :     | asm_funOp (I.FSQRT) = "fsqrt"
186 :     | asm_funOp (I.FTST) = "ftst"
187 :     | asm_funOp (I.FXAM) = "fxam"
188 :     | asm_funOp (I.FINCSTP) = "fincstp"
189 :     | asm_funOp (I.FDECSTP) = "fdecstp"
190 :     and emit_funOp x = emit (asm_funOp x)
191 :     and asm_fenvOp (I.FLDENV) = "fldenv"
192 :     | asm_fenvOp (I.FNLDENV) = "fnldenv"
193 :     | asm_fenvOp (I.FSTENV) = "fstenv"
194 :     | asm_fenvOp (I.FNSTENV) = "fnstenv"
195 :     and emit_fenvOp x = emit (asm_fenvOp x)
196 : monnier 247
197 : george 555 (*#line 173.6 "x86/x86.md"*)
198 : george 545 val memReg = MemRegs.memReg regmap
199 :    
200 : george 555 (*#line 174.6 "x86/x86.md"*)
201 : monnier 429 fun emitInt32 i = let
202 : monnier 247
203 : george 555 (*#line 175.10 "x86/x86.md"*)
204 : george 545 val s = Int32.toString i
205 : monnier 429
206 : george 555 (*#line 176.10 "x86/x86.md"*)
207 : monnier 429 val s = (if (i >= 0)
208 : george 545 then s
209 :     else ("-" ^ (String.substring (s, 1, (size s) - 1))))
210 :     in emit s
211 : monnier 429 end
212 :    
213 :    
214 : george 555 (*#line 179.6 "x86/x86.md"*)
215 : george 545 fun emitScale 0 = emit "1"
216 :     | emitScale 1 = emit "2"
217 :     | emitScale 2 = emit "4"
218 :     | emitScale 3 = emit "8"
219 :     | emitScale _ = error "emitScale"
220 :     and eImmed (I.Immed i) = emitInt32 i
221 :     | eImmed (I.ImmedLabel lexp) = emit_labexp lexp
222 :     | eImmed _ = error "eImmed"
223 : monnier 411 and emit_operand opn =
224 :     (
225 :     case opn of
226 :     I.Immed i =>
227 : george 545 ( emit "$";
228 :     emitInt32 i )
229 : monnier 411 | I.ImmedLabel lexp =>
230 : george 545 ( emit "$";
231 :     emit_labexp lexp )
232 :     | I.LabelEA le => emit_labexp le
233 :     | I.Relative _ => error "emit_operand"
234 :     | I.Direct r => emit_GP r
235 :     | I.MemReg r => emit_operand (memReg opn)
236 : george 555 | I.ST f => emit_FP f
237 :     | I.FDirect f => emit_operand (memReg opn)
238 : monnier 411 | I.Displace{base, disp, mem, ...} =>
239 : george 545 ( emit_disp disp;
240 :     emit "(";
241 :     emit_GP base;
242 :     emit ")";
243 :     emit_region mem )
244 : monnier 411 | I.Indexed{base=NONE, index, scale, disp, mem, ...} =>
245 : george 545 ( emit_disp disp;
246 :     emit "(";
247 :     emit_GP index;
248 :     comma ();
249 :     emitScale scale;
250 :     emit ")";
251 :     emit_region mem )
252 : monnier 411 | I.Indexed{base=SOME base, index, scale, disp, mem, ...} =>
253 : george 545 ( emit_disp disp;
254 :     emit "(";
255 :     emit_GP base;
256 :     comma ();
257 :     emit_GP index;
258 :     comma ();
259 :     emitScale scale;
260 :     emit ")";
261 :     emit_region mem )
262 : monnier 411 )
263 : george 545 and emit_disp (I.Immed 0) = ()
264 :     | emit_disp (I.Immed i) = emitInt32 i
265 :     | emit_disp (I.ImmedLabel lexp) = emit_labexp lexp
266 :     | emit_disp _ = error "emit_disp"
267 : monnier 247
268 : george 555 (*#line 218.7 "x86/x86.md"*)
269 : george 545 fun stupidGas (I.ImmedLabel lexp) = emit_labexp lexp
270 :     | stupidGas (I.LabelEA _) = error "stupidGas"
271 :     | stupidGas opnd = emit_operand opnd
272 :    
273 : george 555 (*#line 223.7 "x86/x86.md"*)
274 :     fun isMemOpnd (I.MemReg _) = true
275 :     | isMemOpnd (I.FDirect f) = true
276 :     | isMemOpnd (I.LabelEA _) = true
277 :     | isMemOpnd (I.Displace _) = true
278 :     | isMemOpnd (I.Indexed _) = true
279 :     | isMemOpnd _ = false
280 :    
281 :     (*#line 229.7 "x86/x86.md"*)
282 :     fun showFbinOp (fbinOp, src) = emit (if (isMemOpnd src)
283 :     then fbinOp
284 :     else let
285 :    
286 :     (*#line 233.15 "x86/x86.md"*)
287 :     val n = size fbinOp
288 :     in
289 :     (
290 :     case String.sub (fbinOp, n - 1) of
291 :     (#"s" | #"t") => String.substring (fbinOp, 0, n - 1)
292 :     | _ => fbinOp
293 :     )
294 :     end
295 :     )
296 :    
297 :     (*#line 239.7 "x86/x86.md"*)
298 : monnier 411 val emit_dst = emit_operand
299 : george 545
300 : george 555 (*#line 240.7 "x86/x86.md"*)
301 : monnier 411 val emit_src = emit_operand
302 : george 545
303 : george 555 (*#line 241.7 "x86/x86.md"*)
304 : monnier 411 val emit_opnd = emit_operand
305 : george 545
306 : george 555 (*#line 242.7 "x86/x86.md"*)
307 : monnier 411 val emit_rsrc = emit_operand
308 : george 545
309 : george 555 (*#line 243.7 "x86/x86.md"*)
310 : monnier 411 val emit_lsrc = emit_operand
311 : george 545
312 : george 555 (*#line 244.7 "x86/x86.md"*)
313 : monnier 411 val emit_addr = emit_operand
314 : monnier 247
315 : george 555 (*#line 245.7 "x86/x86.md"*)
316 : george 545 val emit_src1 = emit_operand
317 : monnier 411 fun emitInstr instr =
318 : george 545 ( tab ();
319 : monnier 411
320 :     (
321 :     case instr of
322 : george 545 I.NOP => emit "nop"
323 : monnier 411 | I.JMP(operand, label) =>
324 : george 545 ( emit "jmp\t";
325 :     stupidGas operand )
326 : monnier 247 | I.JCC{cond, opnd} =>
327 : george 545 ( emit "j";
328 :     emit_cond cond;
329 :     emit "\t";
330 :     stupidGas opnd )
331 : monnier 411 | I.CALL(operand, cellset1, cellset2, region) =>
332 : george 545 ( emit "call\t";
333 :     stupidGas operand;
334 :     emit_region region;
335 :     emit_defs cellset1;
336 :     emit_uses cellset2 )
337 :     | I.LEAVE => emit "leave"
338 : monnier 429 | I.RET operand =>
339 : george 545 ( emit "ret";
340 : monnier 429
341 :     (
342 :     case operand of
343 :     NONE => ()
344 :     | SOME e =>
345 : george 545 ( emit "\t";
346 :     emit_operand e )
347 : monnier 429 ))
348 : monnier 247 | I.MOVE{mvOp, src, dst} =>
349 : george 545 ( emit_move mvOp;
350 :     emit "\t";
351 :     emit_src src;
352 :     emit ", ";
353 :     emit_dst dst )
354 : monnier 247 | I.LEA{r32, addr} =>
355 : george 545 ( emit "leal\t";
356 :     emit_addr addr;
357 :     emit ", ";
358 :     emit_GP r32 )
359 :     | I.CMPL{lsrc, rsrc} =>
360 :     ( emit "cmpl\t";
361 :     emit_rsrc rsrc;
362 :     emit ", ";
363 :     emit_lsrc lsrc )
364 :     | I.CMPW{lsrc, rsrc} =>
365 :     ( emit "cmpb\t";
366 :     emit_rsrc rsrc;
367 :     emit ", ";
368 :     emit_lsrc lsrc )
369 :     | I.CMPB{lsrc, rsrc} =>
370 :     ( emit "cmpb\t";
371 :     emit_rsrc rsrc;
372 :     emit ", ";
373 :     emit_lsrc lsrc )
374 :     | I.TESTL{lsrc, rsrc} =>
375 :     ( emit "testl\t";
376 :     emit_rsrc rsrc;
377 :     emit ", ";
378 :     emit_lsrc lsrc )
379 :     | I.TESTW{lsrc, rsrc} =>
380 :     ( emit "testw\t";
381 :     emit_rsrc rsrc;
382 :     emit ", ";
383 :     emit_lsrc lsrc )
384 :     | I.TESTB{lsrc, rsrc} =>
385 :     ( emit "testb\t";
386 :     emit_rsrc rsrc;
387 :     emit ", ";
388 :     emit_lsrc lsrc )
389 : monnier 411 | I.BINARY{binOp, src, dst} =>
390 : george 545 (
391 :     case (src, binOp) of
392 :     (I.Direct _, (I.SARL | I.SHRL | I.SHLL | I.SARW | I.SHRW | I.SHLW | I.SARB | I.SHRB | I.SHLB)) =>
393 :     ( emit_binaryOp binOp;
394 :     emit "\t%cl, ";
395 :     emit_dst dst )
396 :     | _ =>
397 :     ( emit_binaryOp binOp;
398 :     emit "\t";
399 :     emit_src src;
400 :     emit ", ";
401 :     emit_dst dst )
402 :     )
403 : monnier 411 | I.MULTDIV{multDivOp, src} =>
404 : george 545 ( emit_multDivOp multDivOp;
405 :     emit "l\t";
406 :     emit_src src )
407 :     | I.MUL3{dst, src2, src1} =>
408 :     (
409 :     case src2 of
410 :     NONE =>
411 :     ( emit "imul\t";
412 :     emit_src1 src1;
413 :     emit ", ";
414 :     emit_GP dst )
415 :     | SOME i =>
416 :     ( emit "imul\t$";
417 :     emitInt32 i;
418 :     emit ", ";
419 :     emit_src1 src1;
420 :     emit ", ";
421 :     emit_GP dst )
422 :     )
423 : monnier 247 | I.UNARY{unOp, opnd} =>
424 : george 545 ( emit_unaryOp unOp;
425 :     emit "\t";
426 :     emit_opnd opnd )
427 :     | I.SET{cond, opnd} =>
428 :     ( emit "set";
429 :     emit_cond cond;
430 :     emit "\t";
431 :     emit_opnd opnd )
432 :     | I.CMOV{cond, src, dst} =>
433 :     ( emit "cmov";
434 :     emit_cond cond;
435 :     emit "\t";
436 :     emit_src src;
437 :     emit ", ";
438 :     emit_GP dst )
439 :     | I.PUSHL operand =>
440 :     ( emit "pushl\t";
441 :     emit_operand operand )
442 :     | I.PUSHW operand =>
443 :     ( emit "pushw\t";
444 :     emit_operand operand )
445 :     | I.PUSHB operand =>
446 :     ( emit "pushb\t";
447 :     emit_operand operand )
448 : monnier 411 | I.POP operand =>
449 : george 545 ( emit "popl\t";
450 :     emit_operand operand )
451 :     | I.CDQ => emit "cdq"
452 :     | I.INTO => emit "into"
453 :     | I.COPY{dst, src, tmp} => emitInstrs (Shuffle.shuffle {regmap=regmap, tmp=tmp, dst=dst, src=src})
454 :     | I.FCOPY{dst, src, tmp} => emitInstrs (Shuffle.shufflefp {regmap=regmap, tmp=tmp, dst=dst, src=src})
455 : monnier 247 | I.FBINARY{binOp, src, dst} =>
456 : george 555 ( showFbinOp (asm_fbinOp binOp, src);
457 : george 545 emit "\t";
458 :     emit_src src;
459 :     emit ", ";
460 :     emit_dst dst )
461 :     | I.FUNARY funOp => emit_funOp funOp
462 :     | I.FUCOMPP => emit "fucompp"
463 :     | I.FCOM => emit "fcom"
464 :     | I.FCOMPP => emit "fcompp"
465 :     | I.FXCH{opnd} =>
466 :     ( emit "fxch\t";
467 :     (if (opnd = (C.ST 1))
468 :     then ()
469 :     else (emit_FP opnd)))
470 :     | I.FSTPL operand =>
471 :     ( emit "fstpl\t";
472 :     emit_operand operand )
473 :     | I.FSTPS operand =>
474 :     ( emit "fstps\t";
475 :     emit_operand operand )
476 : george 555 | I.FSTPT operand =>
477 :     ( emit "fstps\t";
478 :     emit_operand operand )
479 : george 545 | I.FLDL operand =>
480 :     ( emit "fldl\t";
481 :     emit_operand operand )
482 :     | I.FLDS operand =>
483 :     ( emit "flds\t";
484 :     emit_operand operand )
485 : george 555 | I.FLDT operand =>
486 :     ( emit "fldt\t";
487 :     emit_operand operand )
488 : monnier 411 | I.FILD operand =>
489 : george 545 ( emit "fild\t";
490 :     emit_operand operand )
491 :     | I.FNSTSW => emit "fnstsw"
492 :     | I.FENV{fenvOp, opnd} =>
493 :     ( emit_fenvOp fenvOp;
494 :     emit "\t";
495 :     emit_opnd opnd )
496 :     | I.SAHF => emit "sahf"
497 : monnier 411 | I.ANNOTATION{i, a} =>
498 : george 545 ( emitInstr i;
499 :     comment (Annotations.toString a))
500 : monnier 411 );
501 : george 545 nl ())
502 : monnier 411 and emitInstrs [] = ()
503 :     | emitInstrs (i::is) =
504 :     (emitInstr i; app (fn i => (tab(); emitInstr i)) is)
505 :     in emitInstr end
506 :    
507 : monnier 429 in S.STREAM{beginCluster=init,
508 : monnier 411 pseudoOp=pseudoOp,
509 :     emit=emitter,
510 : monnier 429 endCluster=doNothing,
511 : monnier 411 defineLabel=defineLabel,
512 :     entryLabel=entryLabel,
513 :     comment=comment,
514 :     exitBlock=doNothing,
515 : monnier 429 annotation=annotation,
516 :     phi=doNothing,
517 :     alias=doNothing
518 : monnier 411 }
519 :     end
520 : monnier 247 end
521 :    

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