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

Annotation of /sml/trunk/src/MLRISC/sparc/emit/sparcAsm.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 839 - (view) (download)

1 : monnier 411 (*
2 : leunga 744 * WARNING: This file was automatically generated by MDLGen (v3.0)
3 :     * from the machine description file "sparc/sparc.mdl".
4 :     * DO NOT EDIT this file directly
5 : monnier 411 *)
6 :    
7 :    
8 :     functor SparcAsmEmitter(structure Instr : SPARCINSTR
9 :     structure Shuffle : SPARCSHUFFLE
10 :     where I = Instr
11 :    
12 : leunga 744 (*#line 465.21 "sparc/sparc.mdl"*)
13 : monnier 411 val V9 : bool
14 :     ) : INSTRUCTION_EMITTER =
15 : monnier 247 struct
16 : monnier 411 structure I = Instr
17 :     structure C = I.C
18 : leunga 775 structure T = I.T
19 :     structure S = T.Stream
20 : monnier 411 structure P = S.P
21 : george 545 structure LabelExp = I.LabelExp
22 : monnier 247 structure Constant = I.Constant
23 : monnier 411
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("SparcAsmEmitter",msg)
30 : monnier 411
31 : monnier 429 fun makeStream formatAnnotations =
32 : monnier 411 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 411 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 : monnier 411 fun emit_label lab = emit(Label.nameOf lab)
48 :     fun emit_labexp le = emit(LabelExp.toString le)
49 :     fun emit_const c = emit(Constant.toString c)
50 :     fun emit_int i = emit(ms i)
51 :     fun paren f = (emit "("; f(); emit ")")
52 :     fun defineLabel lab = emit(Label.nameOf lab^":\n")
53 :     fun entryLabel lab = defineLabel lab
54 : leunga 624 fun comment msg = (tab(); emit("/* " ^ msg ^ " */"))
55 : monnier 411 fun annotation a = (comment(Annotations.toString a); nl())
56 : leunga 815 fun getAnnotations() = error "getAnnotations"
57 : george 545 fun doNothing _ = ()
58 : monnier 411 fun emit_region mem = comment(I.Region.toString mem)
59 : george 545 val emit_region =
60 :     if !show_region then emit_region else doNothing
61 : monnier 411 fun pseudoOp pOp = emit(P.toString pOp)
62 :     fun init size = (comment("Code Size = " ^ ms size); nl())
63 : leunga 744 val emitCellInfo = AsmFormatUtil.reginfo
64 :     (emit,formatAnnotations)
65 :     fun emitCell r = (emit(C.toString r); emitCellInfo r)
66 : monnier 498 fun emit_cellset(title,cellset) =
67 : leunga 744 (nl(); comment(title^C.CellSet.toString cellset))
68 : george 545 val emit_cellset =
69 :     if !show_cellset then emit_cellset else doNothing
70 : monnier 498 fun emit_defs cellset = emit_cellset("defs: ",cellset)
71 :     fun emit_uses cellset = emit_cellset("uses: ",cellset)
72 : leunga 796 val emit_cutsTo =
73 :     if !show_cutsTo then AsmFormatUtil.emit_cutsTo emit
74 :     else doNothing
75 : leunga 744 fun emitter instr =
76 :     let
77 : george 545 fun asm_load (I.LDSB) = "ldsb"
78 :     | asm_load (I.LDSH) = "ldsh"
79 :     | asm_load (I.LDUB) = "ldub"
80 :     | asm_load (I.LDUH) = "lduh"
81 :     | asm_load (I.LD) = "ld"
82 :     | asm_load (I.LDX) = "ldx"
83 :     | asm_load (I.LDD) = "ldd"
84 :     and emit_load x = emit (asm_load x)
85 : monnier 429 and asm_store (I.STB) = "stb"
86 :     | asm_store (I.STH) = "sth"
87 :     | asm_store (I.ST) = "st"
88 :     | asm_store (I.STX) = "stx"
89 :     | asm_store (I.STD) = "std"
90 : george 545 and emit_store x = emit (asm_store x)
91 : monnier 429 and asm_fload (I.LDF) = "ldf"
92 :     | asm_fload (I.LDDF) = "lddf"
93 :     | asm_fload (I.LDQF) = "ldqf"
94 :     | asm_fload (I.LDFSR) = "ldfsr"
95 :     | asm_fload (I.LDXFSR) = "ldxfsr"
96 : george 545 and emit_fload x = emit (asm_fload x)
97 : monnier 429 and asm_fstore (I.STF) = "stf"
98 :     | asm_fstore (I.STDF) = "stdf"
99 :     | asm_fstore (I.STFSR) = "stfsr"
100 : george 545 and emit_fstore x = emit (asm_fstore x)
101 : monnier 411 and asm_arith (I.AND) = "and"
102 :     | asm_arith (I.ANDCC) = "andcc"
103 :     | asm_arith (I.ANDN) = "andn"
104 :     | asm_arith (I.ANDNCC) = "andncc"
105 :     | asm_arith (I.OR) = "or"
106 :     | asm_arith (I.ORCC) = "orcc"
107 :     | asm_arith (I.ORN) = "orn"
108 :     | asm_arith (I.ORNCC) = "orncc"
109 :     | asm_arith (I.XOR) = "xor"
110 :     | asm_arith (I.XORCC) = "xorcc"
111 :     | asm_arith (I.XNOR) = "xnor"
112 :     | asm_arith (I.XNORCC) = "xnorcc"
113 :     | asm_arith (I.ADD) = "add"
114 :     | asm_arith (I.ADDCC) = "addcc"
115 :     | asm_arith (I.TADD) = "tadd"
116 :     | asm_arith (I.TADDCC) = "taddcc"
117 :     | asm_arith (I.TADDTV) = "taddtv"
118 :     | asm_arith (I.TADDTVCC) = "taddtvcc"
119 :     | asm_arith (I.SUB) = "sub"
120 :     | asm_arith (I.SUBCC) = "subcc"
121 :     | asm_arith (I.TSUB) = "tsub"
122 :     | asm_arith (I.TSUBCC) = "tsubcc"
123 :     | asm_arith (I.TSUBTV) = "tsubtv"
124 :     | asm_arith (I.TSUBTVCC) = "tsubtvcc"
125 :     | asm_arith (I.UMUL) = "umul"
126 :     | asm_arith (I.UMULCC) = "umulcc"
127 :     | asm_arith (I.SMUL) = "smul"
128 :     | asm_arith (I.SMULCC) = "smulcc"
129 :     | asm_arith (I.UDIV) = "udiv"
130 :     | asm_arith (I.UDIVCC) = "udivcc"
131 :     | asm_arith (I.SDIV) = "sdiv"
132 :     | asm_arith (I.SDIVCC) = "sdivcc"
133 :     | asm_arith (I.MULX) = "mulx"
134 :     | asm_arith (I.SDIVX) = "sdivx"
135 :     | asm_arith (I.UDIVX) = "udivx"
136 : george 545 and emit_arith x = emit (asm_arith x)
137 :     and asm_shift (I.SLL) = "sll"
138 :     | asm_shift (I.SRL) = "srl"
139 :     | asm_shift (I.SRA) = "sra"
140 :     | asm_shift (I.SLLX) = "sllx"
141 :     | asm_shift (I.SRLX) = "srlx"
142 :     | asm_shift (I.SRAX) = "srax"
143 :     and emit_shift x = emit (asm_shift x)
144 :     and asm_farith1 (I.FiTOs) = "fitos"
145 :     | asm_farith1 (I.FiTOd) = "fitod"
146 :     | asm_farith1 (I.FiTOq) = "fitoq"
147 :     | asm_farith1 (I.FsTOi) = "fstoi"
148 :     | asm_farith1 (I.FdTOi) = "fdtoi"
149 :     | asm_farith1 (I.FqTOi) = "fqtoi"
150 :     | asm_farith1 (I.FsTOd) = "fstod"
151 :     | asm_farith1 (I.FsTOq) = "fstoq"
152 :     | asm_farith1 (I.FdTOs) = "fdtos"
153 :     | asm_farith1 (I.FdTOq) = "fdtoq"
154 :     | asm_farith1 (I.FqTOs) = "fqtos"
155 :     | asm_farith1 (I.FqTOd) = "fqtod"
156 :     | asm_farith1 (I.FMOVs) = "fmovs"
157 :     | asm_farith1 (I.FNEGs) = "fnegs"
158 :     | asm_farith1 (I.FABSs) = "fabss"
159 :     | asm_farith1 (I.FMOVd) = "fmovd"
160 :     | asm_farith1 (I.FNEGd) = "fnegd"
161 :     | asm_farith1 (I.FABSd) = "fabsd"
162 :     | asm_farith1 (I.FMOVq) = "fmovq"
163 :     | asm_farith1 (I.FNEGq) = "fnegq"
164 :     | asm_farith1 (I.FABSq) = "fabsq"
165 :     | asm_farith1 (I.FSQRTs) = "fsqrts"
166 :     | asm_farith1 (I.FSQRTd) = "fsqrtd"
167 :     | asm_farith1 (I.FSQRTq) = "fsqrtq"
168 :     and emit_farith1 x = emit (asm_farith1 x)
169 :     and asm_farith2 (I.FADDs) = "fadds"
170 :     | asm_farith2 (I.FADDd) = "faddd"
171 :     | asm_farith2 (I.FADDq) = "faddq"
172 :     | asm_farith2 (I.FSUBs) = "fsubs"
173 :     | asm_farith2 (I.FSUBd) = "fsubd"
174 :     | asm_farith2 (I.FSUBq) = "fsubq"
175 :     | asm_farith2 (I.FMULs) = "fmuls"
176 :     | asm_farith2 (I.FMULd) = "fmuld"
177 :     | asm_farith2 (I.FMULq) = "fmulq"
178 :     | asm_farith2 (I.FsMULd) = "fsmuld"
179 :     | asm_farith2 (I.FdMULq) = "fdmulq"
180 :     | asm_farith2 (I.FDIVs) = "fdivs"
181 :     | asm_farith2 (I.FDIVd) = "fdivd"
182 :     | asm_farith2 (I.FDIVq) = "fdivq"
183 :     and emit_farith2 x = emit (asm_farith2 x)
184 : monnier 411 and asm_fcmp (I.FCMPs) = "fcmps"
185 :     | asm_fcmp (I.FCMPd) = "fcmpd"
186 :     | asm_fcmp (I.FCMPq) = "fcmpq"
187 :     | asm_fcmp (I.FCMPEs) = "fcmpes"
188 :     | asm_fcmp (I.FCMPEd) = "fcmped"
189 :     | asm_fcmp (I.FCMPEq) = "fcmpeq"
190 : george 545 and emit_fcmp x = emit (asm_fcmp x)
191 :     and asm_branch (I.BN) = "n"
192 :     | asm_branch (I.BE) = "e"
193 :     | asm_branch (I.BLE) = "le"
194 :     | asm_branch (I.BL) = "l"
195 :     | asm_branch (I.BLEU) = "leu"
196 :     | asm_branch (I.BCS) = "cs"
197 :     | asm_branch (I.BNEG) = "neg"
198 :     | asm_branch (I.BVS) = "vs"
199 :     | asm_branch (I.BA) = ""
200 :     | asm_branch (I.BNE) = "ne"
201 :     | asm_branch (I.BG) = "g"
202 :     | asm_branch (I.BGE) = "ge"
203 :     | asm_branch (I.BGU) = "gu"
204 :     | asm_branch (I.BCC) = "cc"
205 :     | asm_branch (I.BPOS) = "pos"
206 :     | asm_branch (I.BVC) = "vs"
207 :     and emit_branch x = emit (asm_branch x)
208 : monnier 429 and asm_rcond (I.RZ) = "rz"
209 :     | asm_rcond (I.RLEZ) = "rlez"
210 :     | asm_rcond (I.RLZ) = "rlz"
211 :     | asm_rcond (I.RNZ) = "rnz"
212 :     | asm_rcond (I.RGZ) = "rgz"
213 :     | asm_rcond (I.RGEZ) = "rgez"
214 : george 545 and emit_rcond x = emit (asm_rcond x)
215 :     and asm_prediction (I.PT) = "pt"
216 :     | asm_prediction (I.PN) = "pn"
217 :     and emit_prediction x = emit (asm_prediction x)
218 : monnier 411 and asm_fbranch (I.FBN) = "fbn"
219 :     | asm_fbranch (I.FBNE) = "fbne"
220 :     | asm_fbranch (I.FBLG) = "fblg"
221 :     | asm_fbranch (I.FBUL) = "fbul"
222 :     | asm_fbranch (I.FBL) = "fbl"
223 :     | asm_fbranch (I.FBUG) = "fbug"
224 :     | asm_fbranch (I.FBG) = "fbg"
225 :     | asm_fbranch (I.FBU) = "fbu"
226 :     | asm_fbranch (I.FBA) = "fb"
227 :     | asm_fbranch (I.FBE) = "fbe"
228 :     | asm_fbranch (I.FBUE) = "fbue"
229 :     | asm_fbranch (I.FBGE) = "fbge"
230 :     | asm_fbranch (I.FBUGE) = "fbuge"
231 :     | asm_fbranch (I.FBLE) = "fble"
232 :     | asm_fbranch (I.FBULE) = "fbule"
233 :     | asm_fbranch (I.FBO) = "fbo"
234 : george 545 and emit_fbranch x = emit (asm_fbranch x)
235 :     and asm_fsize (I.S) = "s"
236 :     | asm_fsize (I.D) = "d"
237 :     | asm_fsize (I.Q) = "q"
238 :     and emit_fsize x = emit (asm_fsize x)
239 : leunga 744 and emit_operand (I.REG GP) = emitCell GP
240 : george 545 | emit_operand (I.IMMED int) = emit_int int
241 :     | emit_operand (I.LAB labexp) = emit_labexp labexp
242 :     | emit_operand (I.LO labexp) =
243 :     ( emit "%lo(";
244 : leunga 744 emit_labexp labexp;
245 :     emit ")" )
246 : george 545 | emit_operand (I.HI labexp) =
247 :     ( emit "%hi(";
248 : leunga 744 emit_labexp labexp;
249 :     emit ")" )
250 : monnier 247
251 : leunga 744 (*#line 468.7 "sparc/sparc.mdl"*)
252 : monnier 411 fun emit_leaf false = ()
253 : george 545 | emit_leaf true = emit "l"
254 : monnier 247
255 : leunga 744 (*#line 469.7 "sparc/sparc.mdl"*)
256 : monnier 411 fun emit_nop false = ()
257 : george 545 | emit_nop true = emit "\n\tnop"
258 : monnier 247
259 : leunga 744 (*#line 470.7 "sparc/sparc.mdl"*)
260 : monnier 411 fun emit_a false = ()
261 : george 545 | emit_a true = emit ",a"
262 : monnier 247
263 : leunga 744 (*#line 471.7 "sparc/sparc.mdl"*)
264 : monnier 411 fun emit_cc false = ()
265 : george 545 | emit_cc true = emit "cc"
266 : leunga 594 fun emitInstr' instr =
267 : leunga 744 (case instr of
268 :     I.LOAD{l, d, r, i, mem} =>
269 :     ( emit_load l;
270 :     emit "\t[";
271 :     emitCell r;
272 :     emit "+";
273 :     emit_operand i;
274 :     emit "], ";
275 :     emitCell d;
276 :     emit_region mem )
277 :     | I.STORE{s, d, r, i, mem} =>
278 :     ( emit_store s;
279 :     emit "\t";
280 :     emitCell d;
281 :     emit ", [";
282 :     emitCell r;
283 :     emit "+";
284 :     emit_operand i;
285 :     emit "]";
286 :     emit_region mem )
287 :     | I.FLOAD{l, r, i, d, mem} =>
288 :     ( emit_fload l;
289 :     emit "\t[";
290 :     emitCell r;
291 :     emit "+";
292 :     emit_operand i;
293 :     emit "], ";
294 :     emitCell d;
295 :     emit_region mem )
296 :     | I.FSTORE{s, d, r, i, mem} =>
297 :     ( emit_fstore s;
298 :     emit "\t[";
299 :     emitCell r;
300 :     emit "+";
301 :     emit_operand i;
302 :     emit "], ";
303 :     emitCell d;
304 :     emit_region mem )
305 : blume 839 | I.UNIMP{const22} =>
306 :     ( emit "unimp ";
307 :     emit_int const22 )
308 : leunga 744 | I.SETHI{i, d} =>
309 :     let
310 : blume 839 (*#line 655.18 "sparc/sparc.mdl"*)
311 : leunga 775 val i = Word32.toString (Word32.<< (Word32.fromInt i, 0wxa))
312 : leunga 744 in
313 :     ( emit "sethi\t%hi(0x";
314 :     emit i;
315 :     emit "), ";
316 :     emitCell d )
317 :     end
318 :     | I.ARITH{a, r, i, d} =>
319 :     (case (a, C.registerId r, C.registerId d) of
320 :     (I.OR, 0, _) =>
321 :     ( emit "mov\t";
322 :     emit_operand i;
323 :     emit ", ";
324 :     emitCell d )
325 :     | (I.SUBCC, _, 0) =>
326 :     ( emit "cmp\t";
327 :     emitCell r;
328 :     emit ", ";
329 :     emit_operand i )
330 :     | _ =>
331 :     ( emit_arith a;
332 :     emit "\t";
333 :     emitCell r;
334 :     emit ", ";
335 :     emit_operand i;
336 :     emit ", ";
337 :     emitCell d )
338 :     )
339 :     | I.SHIFT{s, r, i, d} =>
340 :     ( emit_shift s;
341 :     emit "\t";
342 :     emitCell r;
343 :     emit ", ";
344 :     emit_operand i;
345 :     emit ", ";
346 :     emitCell d )
347 :     | I.MOVicc{b, i, d} =>
348 :     ( emit "mov";
349 :     emit_branch b;
350 :     emit "\t";
351 :     emit_operand i;
352 :     emit ", ";
353 :     emitCell d )
354 :     | I.MOVfcc{b, i, d} =>
355 :     ( emit "mov";
356 :     emit_fbranch b;
357 :     emit "\t";
358 :     emit_operand i;
359 :     emit ", ";
360 :     emitCell d )
361 :     | I.MOVR{rcond, r, i, d} =>
362 :     ( emit "movr";
363 :     emit_rcond rcond;
364 :     emit "\t";
365 :     emitCell r;
366 :     emit ", ";
367 :     emit_operand i;
368 :     emit ", ";
369 :     emitCell d )
370 :     | I.FMOVicc{sz, b, r, d} =>
371 :     ( emit "fmov";
372 :     emit_fsize sz;
373 :     emit_branch b;
374 :     emit "\t";
375 :     emitCell r;
376 :     emit ", ";
377 :     emitCell d )
378 :     | I.FMOVfcc{sz, b, r, d} =>
379 :     ( emit "fmov";
380 :     emit_fsize sz;
381 :     emit_fbranch b;
382 :     emit "\t";
383 :     emitCell r;
384 :     emit ", ";
385 :     emitCell d )
386 :     | I.Bicc{b, a, label, nop} =>
387 :     ( emit "b";
388 :     emit_branch b;
389 :     emit_a a;
390 :     emit "\t";
391 :     emit_label label;
392 :     emit_nop nop )
393 :     | I.FBfcc{b, a, label, nop} =>
394 :     ( emit_fbranch b;
395 :     emit_a a;
396 :     emit "\t";
397 :     emit_label label;
398 :     emit_nop nop )
399 :     | I.BR{rcond, p, r, a, label, nop} =>
400 :     ( emit "b";
401 :     emit_rcond rcond;
402 :     emit_a a;
403 :     emit_prediction p;
404 :     emit "\t";
405 :     emitCell r;
406 :     emit ", ";
407 :     emit_label label;
408 :     emit_nop nop )
409 :     | I.BP{b, p, cc, a, label, nop} =>
410 :     ( emit "bp";
411 :     emit_branch b;
412 :     emit_a a;
413 :     emit_prediction p;
414 :     emit "\t%";
415 :     emit (if (cc = I.ICC)
416 :     then "i"
417 :     else "x");
418 :     emit "cc, ";
419 :     emit_label label;
420 :     emit_nop nop )
421 :     | I.JMP{r, i, labs, nop} =>
422 :     ( emit "jmp\t[";
423 :     emitCell r;
424 :     emit "+";
425 :     emit_operand i;
426 :     emit "]";
427 :     emit_nop nop )
428 : leunga 796 | I.JMPL{r, i, d, defs, uses, cutsTo, nop, mem} =>
429 : leunga 744 ( emit "jmpl\t[";
430 :     emitCell r;
431 :     emit "+";
432 :     emit_operand i;
433 :     emit "], ";
434 :     emitCell d;
435 :     emit_region mem;
436 :     emit_defs defs;
437 :     emit_uses uses;
438 : leunga 796 emit_cutsTo cutsTo;
439 : leunga 744 emit_nop nop )
440 : leunga 796 | I.CALL{defs, uses, label, cutsTo, nop, mem} =>
441 : leunga 744 ( emit "call\t";
442 :     emit_label label;
443 :     emit_region mem;
444 :     emit_defs defs;
445 :     emit_uses uses;
446 : leunga 796 emit_cutsTo cutsTo;
447 : leunga 744 emit_nop nop )
448 :     | I.Ticc{t, cc, r, i} =>
449 :     ( emit "t";
450 :     emit_branch t;
451 :     emit "\t";
452 :     (if (cc = I.ICC)
453 :     then ()
454 :     else (emit "%xcc, "));
455 :     emitCell r;
456 :     emit "+";
457 :     emit_operand i )
458 :     | I.FPop1{a, r, d} =>
459 :     let
460 : blume 839 (*#line 762.18 "sparc/sparc.mdl"*)
461 : leunga 744 fun f (a, r, d) =
462 :     ( emit a;
463 :     emit "\t";
464 :     emit (C.showFP r);
465 :     emit ", ";
466 :     emit (C.showFP d))
467 : george 545
468 : blume 839 (*#line 767.18 "sparc/sparc.mdl"*)
469 : leunga 744 fun g (a, r, d) =
470 :     let
471 : blume 839 (*#line 768.22 "sparc/sparc.mdl"*)
472 : leunga 744 val r = C.registerNum r
473 :     and d = C.registerNum d
474 :     in f (a, r, d);
475 :     emit "\n\t";
476 :     f ("fmovs", r + 1, d + 1)
477 :     end
478 : george 545
479 : blume 839 (*#line 772.18 "sparc/sparc.mdl"*)
480 : leunga 744 fun h (a, r, d) =
481 :     let
482 : blume 839 (*#line 773.22 "sparc/sparc.mdl"*)
483 : leunga 744 val r = C.registerNum r
484 :     and d = C.registerNum d
485 :     in f (a, r, d);
486 :     emit "\n\t";
487 :     f ("fmovs", r + 1, d + 1);
488 :     emit "\n\t";
489 :     f ("fmovs", r + 2, d + 2);
490 :     emit "\n\t";
491 :     f ("fmovs", r + 3, d + 3)
492 :     end
493 :     in (if V9
494 :     then
495 : george 545 ( emit_farith1 a;
496 : leunga 744 emit "\t";
497 :     emitCell r;
498 :     emit ", ";
499 :     emitCell d )
500 :     else
501 :     (case a of
502 :     I.FMOVd => g ("fmovs", r, d)
503 :     | I.FNEGd => g ("fnegs", r, d)
504 :     | I.FABSd => g ("fabss", r, d)
505 :     | I.FMOVq => h ("fmovs", r, d)
506 :     | I.FNEGq => h ("fnegs", r, d)
507 :     | I.FABSq => h ("fabss", r, d)
508 :     | _ =>
509 :     ( emit_farith1 a;
510 :     emit "\t";
511 :     emitCell r;
512 :     emit ", ";
513 :     emitCell d )
514 :     ))
515 :     end
516 :     | I.FPop2{a, r1, r2, d} =>
517 :     ( emit_farith2 a;
518 :     emit "\t";
519 :     emitCell r1;
520 :     emit ", ";
521 :     emitCell r2;
522 :     emit ", ";
523 :     emitCell d )
524 :     | I.FCMP{cmp, r1, r2, nop} =>
525 :     ( emit_fcmp cmp;
526 :     emit "\t";
527 :     emitCell r1;
528 :     emit ", ";
529 :     emitCell r2;
530 :     emit_nop nop )
531 :     | I.COPY{dst, src, impl, tmp} => emitInstrs (Shuffle.shuffle {tmp=tmp,
532 :     src=src, dst=dst})
533 :     | I.FCOPY{dst, src, impl, tmp} => emitInstrs (Shuffle.shufflefp {tmp=tmp,
534 :     src=src, dst=dst})
535 :     | I.SAVE{r, i, d} =>
536 :     ( emit "save\t";
537 :     emitCell r;
538 :     emit ", ";
539 :     emit_operand i;
540 :     emit ", ";
541 :     emitCell d )
542 :     | I.RESTORE{r, i, d} =>
543 :     ( emit "restore\t";
544 :     emitCell r;
545 :     emit ", ";
546 :     emit_operand i;
547 :     emit ", ";
548 :     emitCell d )
549 :     | I.RDY{d} =>
550 :     ( emit "rd\t%y, ";
551 :     emitCell d )
552 :     | I.WRY{r, i} =>
553 :     ( emit "wr\t";
554 :     emitCell r;
555 :     emit ", ";
556 :     emit_operand i;
557 :     emit ", %y" )
558 :     | I.RET{leaf, nop} =>
559 :     ( emit "ret";
560 :     emit_leaf leaf;
561 :     emit_nop nop )
562 :     | I.ANNOTATION{i, a} =>
563 :     ( comment (Annotations.toString a);
564 :     nl ();
565 :     emitInstr i )
566 :     | I.SOURCE{} => emit "source"
567 :     | I.SINK{} => emit "sink"
568 :     | I.PHI{} => emit "phi"
569 : leunga 594 )
570 :     and emitInstr i = (tab(); emitInstr' i; nl())
571 :     and emitInstrIndented i = (indent(); emitInstr' i; nl())
572 :     and emitInstrs instrs =
573 :     app (if !indent_copies then emitInstrIndented
574 :     else emitInstr) instrs
575 : leunga 744 in emitInstr instr end
576 : monnier 411
577 : monnier 429 in S.STREAM{beginCluster=init,
578 : monnier 411 pseudoOp=pseudoOp,
579 :     emit=emitter,
580 : monnier 429 endCluster=doNothing,
581 : monnier 411 defineLabel=defineLabel,
582 :     entryLabel=entryLabel,
583 :     comment=comment,
584 :     exitBlock=doNothing,
585 : leunga 815 annotation=annotation,
586 :     getAnnotations=getAnnotations
587 : monnier 411 }
588 : monnier 247 end
589 : monnier 411 end
590 :    

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