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/branches/idlbasis-devel/src/MLRISC/ppc/emit/ppcMC.sml
ViewVC logotype

Annotation of /sml/branches/idlbasis-devel/src/MLRISC/ppc/emit/ppcMC.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 775 - (view) (download)
Original Path: sml/trunk/src/MLRISC/ppc/emit/ppcMC.sml

1 : monnier 411 (*
2 : leunga 744 * WARNING: This file was automatically generated by MDLGen (v3.0)
3 :     * from the machine description file "ppc/ppc.mdl".
4 :     * DO NOT EDIT this file directly
5 : monnier 245 *)
6 :    
7 :    
8 : monnier 411 functor PPCMCEmitter(structure Instr : PPCINSTR
9 :     structure CodeString : CODE_STRING
10 :     ) : INSTRUCTION_EMITTER =
11 : monnier 245 struct
12 : monnier 411 structure I = Instr
13 :     structure C = I.C
14 : leunga 775 structure LabelExp = I.LabelExp
15 : monnier 411 structure Constant = I.Constant
16 : leunga 775 structure T = I.T
17 :     structure S = T.Stream
18 : monnier 411 structure P = S.P
19 :     structure W = Word32
20 :    
21 : george 545 (* PPC is big endian *)
22 : monnier 411
23 :     fun error msg = MLRiscErrorMsg.error("PPCMC",msg)
24 : monnier 429 fun makeStream _ =
25 : monnier 411 let infix && || << >> ~>>
26 :     val op << = W.<<
27 :     val op >> = W.>>
28 :     val op ~>> = W.~>>
29 :     val op || = W.orb
30 :     val op && = W.andb
31 :     val itow = W.fromInt
32 :     fun emit_bool false = 0w0 : W.word
33 :     | emit_bool true = 0w1 : W.word
34 :     val emit_int = itow
35 :     fun emit_word w = w
36 :     fun emit_label l = itow(Label.addrOf l)
37 :     fun emit_labexp le = itow(LabelExp.valueOf le)
38 :     fun emit_const c = itow(Constant.valueOf c)
39 :     val loc = ref 0
40 :    
41 :     (* emit a byte *)
42 :     fun eByte b =
43 :     let val i = !loc in loc := i + 1; CodeString.update(i,b) end
44 :    
45 :     (* emit the low order byte of a word *)
46 :     (* note: fromLargeWord strips the high order bits! *)
47 :     fun eByteW w =
48 :     let val i = !loc
49 :     in loc := i + 1; CodeString.update(i,Word8.fromLargeWord w) end
50 :    
51 :     fun doNothing _ = ()
52 :    
53 :     fun pseudoOp pOp = P.emitValue{pOp=pOp, loc= !loc,emit=eByte}
54 :    
55 :     fun init n = (CodeString.init n; loc := 0)
56 :    
57 :    
58 : leunga 744 fun eWord32 w =
59 :     let val b8 = w
60 :     val w = w >> 0wx8
61 :     val b16 = w
62 :     val w = w >> 0wx8
63 :     val b24 = w
64 :     val w = w >> 0wx8
65 :     val b32 = w
66 : monnier 411 in
67 : george 545 ( eByteW b32;
68 : leunga 744 eByteW b24;
69 :     eByteW b16;
70 :     eByteW b8 )
71 : monnier 411 end
72 : leunga 744 fun emit_GP r = itow (C.physicalRegisterNum r)
73 :     and emit_FP r = itow (C.physicalRegisterNum r)
74 :     and emit_CC r = itow (C.physicalRegisterNum r)
75 :     and emit_SPR r = itow (C.physicalRegisterNum r)
76 :     and emit_MEM r = itow (C.physicalRegisterNum r)
77 :     and emit_CTRL r = itow (C.physicalRegisterNum r)
78 :     and emit_CELLSET r = itow (C.physicalRegisterNum r)
79 : george 545 fun emit_operand (I.RegOp GP) = emit_GP GP
80 :     | emit_operand (I.ImmedOp int) = itow int
81 :     | emit_operand (I.LabelOp labexp) = itow (LabelExp.valueOf labexp)
82 :     and emit_fcmp (I.FCMPO) = (0wx20 : Word32.word)
83 :     | emit_fcmp (I.FCMPU) = (0wx0 : Word32.word)
84 :     and emit_unary (I.NEG) = (0wx68 : Word32.word)
85 : monnier 429 | emit_unary (I.EXTSB) = (0wx3ba : Word32.word)
86 :     | emit_unary (I.EXTSH) = (0wx39a : Word32.word)
87 :     | emit_unary (I.EXTSW) = (0wx3da : Word32.word)
88 :     | emit_unary (I.CNTLZW) = (0wx1a : Word32.word)
89 :     | emit_unary (I.CNTLZD) = (0wx3a : Word32.word)
90 :     and emit_funary (I.FMR) = (0wx3f, 0wx48)
91 :     | emit_funary (I.FNEG) = (0wx3f, 0wx28)
92 :     | emit_funary (I.FABS) = (0wx3f, 0wx108)
93 :     | emit_funary (I.FNABS) = (0wx3f, 0wx88)
94 :     | emit_funary (I.FSQRT) = (0wx3f, 0wx16)
95 :     | emit_funary (I.FSQRTS) = (0wx3b, 0wx16)
96 :     | emit_funary (I.FRSP) = (0wx3f, 0wxc)
97 :     | emit_funary (I.FCTIW) = (0wx3f, 0wxe)
98 :     | emit_funary (I.FCTIWZ) = (0wx3f, 0wxf)
99 :     | emit_funary (I.FCTID) = (0wx3f, 0wx32e)
100 :     | emit_funary (I.FCTIDZ) = (0wx3f, 0wx32f)
101 :     | emit_funary (I.FCFID) = (0wx3f, 0wx34e)
102 : george 545 and emit_farith (I.FADD) = (0wx3f, 0wx15)
103 :     | emit_farith (I.FSUB) = (0wx3f, 0wx14)
104 :     | emit_farith (I.FMUL) = (0wx3f, 0wx19)
105 :     | emit_farith (I.FDIV) = (0wx3f, 0wx12)
106 :     | emit_farith (I.FADDS) = (0wx3b, 0wx15)
107 :     | emit_farith (I.FSUBS) = (0wx3b, 0wx14)
108 :     | emit_farith (I.FMULS) = (0wx3b, 0wx19)
109 :     | emit_farith (I.FDIVS) = (0wx3b, 0wx12)
110 :     and emit_farith3 (I.FMADD) = (0wx3f, 0wx1d)
111 :     | emit_farith3 (I.FMADDS) = (0wx3b, 0wx1d)
112 :     | emit_farith3 (I.FMSUB) = (0wx3f, 0wx1c)
113 :     | emit_farith3 (I.FMSUBS) = (0wx3b, 0wx1c)
114 :     | emit_farith3 (I.FNMADD) = (0wx3f, 0wx1f)
115 :     | emit_farith3 (I.FNMADDS) = (0wx3b, 0wx1f)
116 :     | emit_farith3 (I.FNMSUB) = (0wx3f, 0wx1e)
117 :     | emit_farith3 (I.FNMSUBS) = (0wx3b, 0wx1e)
118 :     | emit_farith3 (I.FSEL) = (0wx3f, 0wx17)
119 : monnier 429 and emit_bo (I.TRUE) = (0wxc : Word32.word)
120 : monnier 411 | emit_bo (I.FALSE) = (0wx4 : Word32.word)
121 :     | emit_bo (I.ALWAYS) = (0wx14 : Word32.word)
122 :     | emit_bo (I.COUNTER{eqZero, cond}) =
123 : leunga 744 (case cond of
124 :     NONE => (if eqZero
125 :     then 0wx12
126 :     else 0wx10)
127 :     | SOME cc =>
128 :     (case (eqZero, cc) of
129 :     (false, false) => 0wx0
130 :     | (false, true) => 0wx8
131 :     | (true, false) => 0wx2
132 :     | (true, true) => 0wxa
133 :     )
134 : monnier 411 )
135 :     and emit_arith (I.ADD) = (0wx10a : Word32.word)
136 :     | emit_arith (I.SUBF) = (0wx28 : Word32.word)
137 :     | emit_arith (I.MULLW) = (0wxeb : Word32.word)
138 :     | emit_arith (I.MULLD) = (0wxe9 : Word32.word)
139 :     | emit_arith (I.MULHW) = (0wx4b : Word32.word)
140 :     | emit_arith (I.MULHWU) = (0wxb : Word32.word)
141 :     | emit_arith (I.DIVW) = (0wx1eb : Word32.word)
142 :     | emit_arith (I.DIVD) = (0wx1e9 : Word32.word)
143 :     | emit_arith (I.DIVWU) = (0wx1cb : Word32.word)
144 :     | emit_arith (I.DIVDU) = (0wx1c9 : Word32.word)
145 :     | emit_arith (I.AND) = (0wx1c : Word32.word)
146 :     | emit_arith (I.OR) = (0wx1bc : Word32.word)
147 :     | emit_arith (I.XOR) = (0wx13c : Word32.word)
148 :     | emit_arith (I.NAND) = (0wx1dc : Word32.word)
149 :     | emit_arith (I.NOR) = (0wx7c : Word32.word)
150 :     | emit_arith (I.EQV) = (0wx11c : Word32.word)
151 :     | emit_arith (I.ANDC) = (0wx3c : Word32.word)
152 :     | emit_arith (I.ORC) = (0wx19c : Word32.word)
153 :     | emit_arith (I.SLW) = (0wx18 : Word32.word)
154 :     | emit_arith (I.SLD) = (0wx1b : Word32.word)
155 :     | emit_arith (I.SRW) = (0wx218 : Word32.word)
156 :     | emit_arith (I.SRD) = (0wx21b : Word32.word)
157 :     | emit_arith (I.SRAW) = (0wx318 : Word32.word)
158 :     | emit_arith (I.SRAD) = (0wx31a : Word32.word)
159 : monnier 429 and emit_arithi (I.ADDI) = (0wxe : Word32.word)
160 :     | emit_arithi (I.ADDIS) = (0wxf : Word32.word)
161 :     | emit_arithi (I.SUBFIC) = (0wx8 : Word32.word)
162 :     | emit_arithi (I.MULLI) = (0wx7 : Word32.word)
163 :     | emit_arithi (I.ANDI_Rc) = (0wx1c : Word32.word)
164 :     | emit_arithi (I.ANDIS_Rc) = (0wx1d : Word32.word)
165 :     | emit_arithi (I.ORI) = (0wx18 : Word32.word)
166 :     | emit_arithi (I.ORIS) = (0wx19 : Word32.word)
167 :     | emit_arithi (I.XORI) = (0wx1a : Word32.word)
168 :     | emit_arithi (I.XORIS) = (0wx1b : Word32.word)
169 : george 545 | emit_arithi (I.SRAWI) = error "SRAWI"
170 :     | emit_arithi (I.SRADI) = error "SRADI"
171 :     and emit_ccarith (I.CRAND) = (0wx101 : Word32.word)
172 :     | emit_ccarith (I.CROR) = (0wx1c1 : Word32.word)
173 :     | emit_ccarith (I.CRXOR) = (0wxc1 : Word32.word)
174 :     | emit_ccarith (I.CRNAND) = (0wxe1 : Word32.word)
175 :     | emit_ccarith (I.CRNOR) = (0wx21 : Word32.word)
176 :     | emit_ccarith (I.CREQV) = (0wx121 : Word32.word)
177 :     | emit_ccarith (I.CRANDC) = (0wx81 : Word32.word)
178 :     | emit_ccarith (I.CRORC) = (0wx1a1 : Word32.word)
179 : leunga 744 fun x_form {opcd, rt, ra, rb, xo, rc} =
180 :     let val rc = emit_bool rc
181 : george 545 in eWord32 ((opcd << 0wx1a) + ((rt << 0wx15) + ((ra << 0wx10) + ((rb << 0wxb) + ((xo << 0wx1) + rc)))))
182 : monnier 411 end
183 : leunga 744 and xl_form {opcd, bt, ba, bb, xo, lk} =
184 :     let val lk = emit_bool lk
185 : george 545 in eWord32 ((opcd << 0wx1a) + ((bt << 0wx15) + ((ba << 0wx10) + ((bb << 0wxb) + ((xo << 0wx1) + lk)))))
186 : monnier 411 end
187 : leunga 744 and m_form {opcd, rs, ra, rb, mb, me, rc} =
188 :     let val rc = emit_bool rc
189 : george 545 in eWord32 ((opcd << 0wx1a) + ((rs << 0wx15) + ((ra << 0wx10) + ((rb << 0wxb) + ((mb << 0wx6) + ((me << 0wx1) + rc))))))
190 : monnier 411 end
191 : leunga 744 and a_form {opcd, frt, fra, frb, frc, xo, rc} =
192 :     let val rc = emit_bool rc
193 : george 545 in eWord32 ((opcd << 0wx1a) + ((frt << 0wx15) + ((fra << 0wx10) + ((frb << 0wxb) + ((frc << 0wx6) + ((xo << 0wx1) + rc))))))
194 : monnier 411 end
195 : leunga 744 and loadx {rt, ra, rb, xop} =
196 :     let val rt = emit_GP rt
197 :     val ra = emit_GP ra
198 :     val rb = emit_GP rb
199 : george 545 in eWord32 ((rt << 0wx15) + ((ra << 0wx10) + ((rb << 0wxb) + ((xop << 0wx1) + 0wx7c000000))))
200 : monnier 411 end
201 : leunga 744 and loadd {opcd, rt, ra, d} =
202 :     let val rt = emit_GP rt
203 :     val ra = emit_GP ra
204 :     val d = emit_operand d
205 : george 545 in eWord32 ((opcd << 0wx1a) + ((rt << 0wx15) + ((ra << 0wx10) + (d && 0wxffff))))
206 : monnier 411 end
207 : leunga 744 and loadde {opcd, rt, ra, de, xop} =
208 :     let val rt = emit_GP rt
209 :     val ra = emit_GP ra
210 :     val de = emit_operand de
211 : george 545 in eWord32 ((opcd << 0wx1a) + ((rt << 0wx15) + ((ra << 0wx10) + (((de && 0wxfff) << 0wx4) + xop))))
212 : monnier 411 end
213 : george 545 and load {ld, rt, ra, d} =
214 : leunga 744 (case (d, ld) of
215 :     (I.RegOp rb, I.LBZ) => loadx {rt=rt, ra=ra, rb=rb, xop=0wx57}
216 :     | (I.RegOp rb, I.LBZE) => loadx {rt=rt, ra=ra, rb=rb, xop=0wx5f}
217 :     | (I.RegOp rb, I.LHZ) => loadx {rt=rt, ra=ra, rb=rb, xop=0wx117}
218 :     | (I.RegOp rb, I.LHZE) => loadx {rt=rt, ra=ra, rb=rb, xop=0wx11f}
219 :     | (I.RegOp rb, I.LHA) => loadx {rt=rt, ra=ra, rb=rb, xop=0wx157}
220 :     | (I.RegOp rb, I.LHAE) => loadx {rt=rt, ra=ra, rb=rb, xop=0wx15f}
221 :     | (I.RegOp rb, I.LWZ) => loadx {rt=rt, ra=ra, rb=rb, xop=0wx17}
222 :     | (I.RegOp rb, I.LWZE) => loadx {rt=rt, ra=ra, rb=rb, xop=0wx1f}
223 :     | (I.RegOp rb, I.LDE) => loadx {rt=rt, ra=ra, rb=rb, xop=0wx31f}
224 :     | (d, I.LBZ) => loadd {opcd=0wx22, rt=rt, ra=ra, d=d}
225 :     | (de, I.LBZE) => loadde {opcd=0wx3a, rt=rt, ra=ra, de=de, xop=0wx0}
226 :     | (d, I.LHZ) => loadd {opcd=0wx28, rt=rt, ra=ra, d=d}
227 :     | (de, I.LHZE) => loadde {opcd=0wx3a, rt=rt, ra=ra, de=de, xop=0wx2}
228 :     | (d, I.LHA) => loadd {opcd=0wx2a, rt=rt, ra=ra, d=d}
229 :     | (de, I.LHAE) => loadde {opcd=0wx3a, rt=rt, ra=ra, de=de, xop=0wx4}
230 :     | (d, I.LWZ) => loadd {opcd=0wx20, rt=rt, ra=ra, d=d}
231 :     | (de, I.LWZE) => loadde {opcd=0wx3a, rt=rt, ra=ra, de=de, xop=0wx6}
232 :     | (de, I.LDE) => loadde {opcd=0wx3e, rt=rt, ra=ra, de=de, xop=0wx0}
233 : monnier 411 )
234 : leunga 744 and floadx {ft, ra, rb, xop} =
235 :     let val ft = emit_FP ft
236 :     val ra = emit_GP ra
237 :     val rb = emit_GP rb
238 : george 545 in eWord32 ((ft << 0wx15) + ((ra << 0wx10) + ((rb << 0wxb) + ((xop << 0wx1) + 0wx7c000000))))
239 : monnier 411 end
240 : leunga 744 and floadd {opcd, ft, ra, d} =
241 :     let val ft = emit_FP ft
242 :     val ra = emit_GP ra
243 :     val d = emit_operand d
244 : george 545 in eWord32 ((opcd << 0wx1a) + ((ft << 0wx15) + ((ra << 0wx10) + (d && 0wxffff))))
245 : monnier 429 end
246 : leunga 744 and floadde {opcd, ft, ra, de, xop} =
247 :     let val ft = emit_FP ft
248 :     val ra = emit_GP ra
249 :     val de = emit_operand de
250 : george 545 in eWord32 ((opcd << 0wx1a) + ((ft << 0wx15) + ((ra << 0wx10) + (((de && 0wxfff) << 0wx4) + xop))))
251 :     end
252 :     and fload {ld, ft, ra, d} =
253 : leunga 744 (case (d, ld) of
254 :     (I.RegOp rb, I.LFS) => floadx {ft=ft, ra=ra, rb=rb, xop=0wx217}
255 :     | (I.RegOp rb, I.LFSE) => floadx {ft=ft, ra=ra, rb=rb, xop=0wx21f}
256 :     | (I.RegOp rb, I.LFD) => floadx {ft=ft, ra=ra, rb=rb, xop=0wx257}
257 :     | (I.RegOp rb, I.LFDE) => floadx {ft=ft, ra=ra, rb=rb, xop=0wx25f}
258 :     | (d, I.LFS) => floadd {ft=ft, ra=ra, d=d, opcd=0wx30}
259 :     | (de, I.LFSE) => floadde {ft=ft, ra=ra, de=de, opcd=0wx3e, xop=0wx4}
260 :     | (d, I.LFD) => floadd {ft=ft, ra=ra, d=d, opcd=0wx32}
261 :     | (de, I.LFDE) => floadde {ft=ft, ra=ra, de=de, opcd=0wx3e, xop=0wx6}
262 : george 545 )
263 : leunga 744 and storex {rs, ra, rb, xop} =
264 :     let val rs = emit_GP rs
265 :     val ra = emit_GP ra
266 :     val rb = emit_GP rb
267 : george 545 in eWord32 ((rs << 0wx15) + ((ra << 0wx10) + ((rb << 0wxb) + ((xop << 0wx1) + 0wx7c000000))))
268 : monnier 411 end
269 : leunga 744 and stored {opcd, rs, ra, d} =
270 :     let val rs = emit_GP rs
271 :     val ra = emit_GP ra
272 :     val d = emit_operand d
273 : george 545 in eWord32 ((opcd << 0wx1a) + ((rs << 0wx15) + ((ra << 0wx10) + (d && 0wxffff))))
274 : monnier 411 end
275 : leunga 744 and storede {opcd, rs, ra, de, xop} =
276 :     let val rs = emit_GP rs
277 :     val ra = emit_GP ra
278 :     val de = emit_operand de
279 : george 545 in eWord32 ((opcd << 0wx1a) + ((rs << 0wx15) + ((ra << 0wx10) + (((de && 0wxfff) << 0wx4) + xop))))
280 : monnier 429 end
281 : george 545 and store {st, rs, ra, d} =
282 : leunga 744 (case (d, st) of
283 :     (I.RegOp rb, I.STB) => storex {rs=rs, ra=ra, rb=rb, xop=0wxd7}
284 :     | (I.RegOp rb, I.STBE) => storex {rs=rs, ra=ra, rb=rb, xop=0wxdf}
285 :     | (I.RegOp rb, I.STH) => storex {rs=rs, ra=ra, rb=rb, xop=0wx197}
286 :     | (I.RegOp rb, I.STHE) => storex {rs=rs, ra=ra, rb=rb, xop=0wx19f}
287 :     | (I.RegOp rb, I.STW) => storex {rs=rs, ra=ra, rb=rb, xop=0wx97}
288 :     | (I.RegOp rb, I.STWE) => storex {rs=rs, ra=ra, rb=rb, xop=0wx9f}
289 :     | (I.RegOp rb, I.STDE) => storex {rs=rs, ra=ra, rb=rb, xop=0wx39f}
290 :     | (d, I.STB) => stored {rs=rs, ra=ra, d=d, opcd=0wx26}
291 :     | (de, I.STBE) => storede {rs=rs, ra=ra, de=de, opcd=0wx3a, xop=0wx8}
292 :     | (d, I.STH) => stored {rs=rs, ra=ra, d=d, opcd=0wx2c}
293 :     | (de, I.STHE) => storede {rs=rs, ra=ra, de=de, opcd=0wx3a, xop=0wxa}
294 :     | (d, I.STW) => stored {rs=rs, ra=ra, d=d, opcd=0wx24}
295 :     | (de, I.STWE) => storede {rs=rs, ra=ra, de=de, opcd=0wx3a, xop=0wxe}
296 :     | (de, I.STDE) => storede {rs=rs, ra=ra, de=de, opcd=0wx3e, xop=0wx8}
297 : george 545 )
298 : leunga 744 and fstorex {fs, ra, rb, xop} =
299 :     let val fs = emit_FP fs
300 :     val ra = emit_GP ra
301 :     val rb = emit_GP rb
302 : george 545 in eWord32 ((fs << 0wx15) + ((ra << 0wx10) + ((rb << 0wxb) + ((xop << 0wx1) + 0wx7c000000))))
303 : monnier 411 end
304 : leunga 744 and fstored {opcd, fs, ra, d} =
305 :     let val fs = emit_FP fs
306 :     val ra = emit_GP ra
307 :     val d = emit_operand d
308 : george 545 in eWord32 ((opcd << 0wx1a) + ((fs << 0wx15) + ((ra << 0wx10) + (d && 0wxffff))))
309 : monnier 411 end
310 : leunga 744 and fstorede {opcd, fs, ra, de, xop} =
311 :     let val fs = emit_FP fs
312 :     val ra = emit_GP ra
313 :     val de = emit_operand de
314 : george 545 in eWord32 ((opcd << 0wx1a) + ((fs << 0wx15) + ((ra << 0wx10) + (((de && 0wxfff) << 0wx4) + xop))))
315 : monnier 411 end
316 : george 545 and fstore {st, fs, ra, d} =
317 : leunga 744 (case (d, st) of
318 :     (I.RegOp rb, I.STFS) => fstorex {fs=fs, ra=ra, rb=rb, xop=0wx297}
319 :     | (I.RegOp rb, I.STFSE) => fstorex {fs=fs, ra=ra, rb=rb, xop=0wx29f}
320 :     | (I.RegOp rb, I.STFD) => fstorex {fs=fs, ra=ra, rb=rb, xop=0wx2d7}
321 :     | (I.RegOp rb, I.STFDE) => fstorex {fs=fs, ra=ra, rb=rb, xop=0wx2f7}
322 :     | (d, I.STFS) => fstored {fs=fs, ra=ra, d=d, opcd=0wx34}
323 :     | (de, I.STFSE) => fstorede {fs=fs, ra=ra, de=de, opcd=0wx3e, xop=0wxc}
324 :     | (d, I.STFD) => fstored {fs=fs, ra=ra, d=d, opcd=0wx36}
325 :     | (de, I.STFDE) => fstorede {fs=fs, ra=ra, de=de, opcd=0wx3e, xop=0wxe}
326 : george 545 )
327 : leunga 744 and unary' {ra, rt, OE, oper, Rc} =
328 :     let val ra = emit_GP ra
329 :     val rt = emit_GP rt
330 :     val OE = emit_bool OE
331 :     val oper = emit_unary oper
332 :     val Rc = emit_bool Rc
333 : george 545 in eWord32 ((ra << 0wx15) + ((rt << 0wx10) + ((OE << 0wxa) + ((oper << 0wx1) + (Rc + 0wx7c000000)))))
334 : monnier 411 end
335 : george 545 and unary {ra, rt, oper, OE, Rc} =
336 : leunga 744 (case oper of
337 :     I.NEG => unary' {ra=rt, rt=ra, oper=oper, OE=OE, Rc=Rc}
338 :     | _ => unary' {ra=ra, rt=rt, oper=oper, OE=OE, Rc=Rc}
339 : monnier 411 )
340 : leunga 744 and arith' {rt, ra, rb, OE, oper, Rc} =
341 :     let val rt = emit_GP rt
342 :     val ra = emit_GP ra
343 :     val rb = emit_GP rb
344 :     val OE = emit_bool OE
345 :     val oper = emit_arith oper
346 :     val Rc = emit_bool Rc
347 : george 545 in eWord32 ((rt << 0wx15) + ((ra << 0wx10) + ((rb << 0wxb) + ((OE << 0wxa) + ((oper << 0wx1) + (Rc + 0wx7c000000))))))
348 : monnier 411 end
349 : leunga 744 and arithi' {oper, rt, ra, im} =
350 :     let val oper = emit_arithi oper
351 :     val rt = emit_GP rt
352 :     val ra = emit_GP ra
353 :     val im = emit_operand im
354 : george 545 in eWord32 ((oper << 0wx1a) + ((rt << 0wx15) + ((ra << 0wx10) + (im && 0wxffff))))
355 : monnier 411 end
356 : leunga 744 and srawi {rs, ra, sh} =
357 :     let val rs = emit_GP rs
358 :     val ra = emit_GP ra
359 :     val sh = emit_operand sh
360 : george 545 in eWord32 ((rs << 0wx15) + ((ra << 0wx10) + (((sh && 0wx1f) << 0wxb) + 0wx7c000670)))
361 : monnier 411 end
362 : leunga 744 and sradi' {rs, ra, sh, sh2} =
363 :     let val rs = emit_GP rs
364 :     val ra = emit_GP ra
365 : george 545 in eWord32 ((rs << 0wx15) + ((ra << 0wx10) + ((sh << 0wxb) + ((sh2 << 0wx1) + 0wx7c000674))))
366 : monnier 245 end
367 : leunga 744 and sradi {rs, ra, sh} =
368 :     let val sh = emit_operand sh
369 : george 545 in sradi' {rs=rs, ra=ra, sh=(sh && 0wx1f), sh2=((sh << 0wx5) && 0wx1)}
370 : monnier 245 end
371 : george 545 and arith {oper, rt, ra, rb, OE, Rc} =
372 : leunga 744 (case oper of
373 :     (I.ADD | I.SUBF | I.MULLW | I.MULLD | I.MULHW | I.MULHWU | I.DIVW | I.DIVD | I.DIVWU | I.DIVDU) =>
374 :     arith' {oper=oper, rt=rt, ra=ra, rb=rb, OE=OE, Rc=Rc}
375 :     | _ => arith' {oper=oper, rt=ra, ra=rt, rb=rb, OE=OE, Rc=Rc}
376 : george 545 )
377 :     and arithi {oper, rt, ra, im} =
378 : leunga 744 (case oper of
379 :     (I.ADDI | I.ADDIS | I.SUBFIC | I.MULLI) => arithi' {oper=oper, rt=rt,
380 :     ra=ra, im=im}
381 :     | I.SRAWI => srawi {rs=ra, ra=rt, sh=im}
382 :     | I.SRADI => sradi {rs=ra, ra=rt, sh=im}
383 :     | _ => arithi' {oper=oper, rt=ra, ra=rt, im=im}
384 : george 545 )
385 : leunga 744 and Cmpl {bf, l, ra, rb} =
386 :     let val bf = emit_CC bf
387 :     val l = emit_bool l
388 :     val ra = emit_GP ra
389 :     val rb = emit_GP rb
390 : george 545 in eWord32 ((bf << 0wx17) + ((l << 0wx15) + ((ra << 0wx10) + ((rb << 0wxb) + 0wx7c000040))))
391 : monnier 245 end
392 : leunga 744 and Cmpli {bf, l, ra, ui} =
393 :     let val bf = emit_CC bf
394 :     val l = emit_bool l
395 :     val ra = emit_GP ra
396 :     val ui = emit_operand ui
397 : george 545 in eWord32 ((bf << 0wx17) + ((l << 0wx15) + ((ra << 0wx10) + ((ui && 0wxffff) + 0wx28000000))))
398 : monnier 245 end
399 : leunga 744 and Cmp {bf, l, ra, rb} =
400 :     let val bf = emit_CC bf
401 :     val l = emit_bool l
402 :     val ra = emit_GP ra
403 :     val rb = emit_GP rb
404 : george 545 in eWord32 ((bf << 0wx17) + ((l << 0wx15) + ((ra << 0wx10) + ((rb << 0wxb) + 0wx7c000000))))
405 : monnier 429 end
406 : leunga 744 and Cmpi {bf, l, ra, si} =
407 :     let val bf = emit_CC bf
408 :     val l = emit_bool l
409 :     val ra = emit_GP ra
410 :     val si = emit_operand si
411 : george 545 in eWord32 ((bf << 0wx17) + ((l << 0wx15) + ((ra << 0wx10) + ((si && 0wxffff) + 0wx2c000000))))
412 : monnier 245 end
413 : monnier 429 and compare {cmp, bf, l, ra, rb} =
414 : leunga 744 (case (cmp, rb) of
415 :     (I.CMP, I.RegOp rb) => Cmp {bf=bf, l=l, ra=ra, rb=rb}
416 :     | (I.CMPL, I.RegOp rb) => Cmpl {bf=bf, l=l, ra=ra, rb=rb}
417 :     | (I.CMP, si) => Cmpi {bf=bf, l=l, ra=ra, si=si}
418 :     | (I.CMPL, ui) => Cmpli {bf=bf, l=l, ra=ra, ui=ui}
419 : monnier 429 )
420 : leunga 744 and fcmp {bf, fa, fb, cmp} =
421 :     let val bf = emit_CC bf
422 :     val fa = emit_FP fa
423 :     val fb = emit_FP fb
424 :     val cmp = emit_fcmp cmp
425 : george 545 in eWord32 ((bf << 0wx17) + ((fa << 0wx10) + ((fb << 0wxb) + ((cmp << 0wx1) + 0wxfc000000))))
426 : monnier 429 end
427 : leunga 744 and funary {oper, ft, fb, Rc} =
428 :     let val oper = emit_funary oper
429 :     val ft = emit_FP ft
430 :     val fb = emit_FP fb
431 :     in
432 :     let
433 :     (*#line 423.12 "ppc/ppc.mdl"*)
434 :     val (opcd, xo) = oper
435 : george 545 in x_form {opcd=opcd, rt=ft, ra=0wx0, rb=fb, xo=xo, rc=Rc}
436 :     end
437 : monnier 245 end
438 : leunga 744 and farith {oper, ft, fa, fb, Rc} =
439 :     let val ft = emit_FP ft
440 :     val fa = emit_FP fa
441 :     val fb = emit_FP fb
442 :     in
443 :     let
444 :     (*#line 429.12 "ppc/ppc.mdl"*)
445 :     val (opcd, xo) = emit_farith oper
446 : george 545 in
447 : leunga 744 (case oper of
448 :     (I.FMUL | I.FMULS) => a_form {opcd=opcd, frt=ft, fra=fa, frb=0wx0,
449 :     frc=fb, xo=xo, rc=Rc}
450 :     | _ => a_form {opcd=opcd, frt=ft, fra=fa, frb=fb, frc=0wx0, xo=xo,
451 :     rc=Rc}
452 : george 545 )
453 :     end
454 : monnier 429 end
455 : leunga 744 and farith3 {oper, ft, fa, fc, fb, Rc} =
456 :     let val oper = emit_farith3 oper
457 :     val ft = emit_FP ft
458 :     val fa = emit_FP fa
459 :     val fc = emit_FP fc
460 :     val fb = emit_FP fb
461 :     in
462 :     let
463 :     (*#line 438.12 "ppc/ppc.mdl"*)
464 :     val (opcd, xo) = oper
465 : george 545 in a_form {opcd=opcd, frt=ft, fra=fa, frb=fb, frc=fc, xo=xo, rc=Rc}
466 :     end
467 : monnier 245 end
468 : leunga 744 and cr_bit {cc} =
469 :     let
470 :     (*#line 443.12 "ppc/ppc.mdl"*)
471 :     val (cr, bit) = cc
472 : george 545 in ((emit_CC cr) << 0wx2) + (itow
473 : leunga 744 (case bit of
474 :     I.LT => 0
475 :     | I.GT => 1
476 :     | I.EQ => 2
477 :     | I.SO => 3
478 :     | I.FL => 0
479 :     | I.FG => 1
480 :     | I.FE => 2
481 :     | I.FU => 3
482 :     | I.FX => 0
483 :     | I.FEX => 1
484 :     | I.VX => 2
485 :     | I.OX => 3
486 : george 545 ))
487 : monnier 429 end
488 : leunga 744 and ccarith {oper, bt, ba, bb} =
489 :     let val oper = emit_ccarith oper
490 :     in xl_form {opcd=0wx13, bt=cr_bit {cc=bt}, ba=cr_bit {cc=ba}, bb=cr_bit {cc=bb},
491 :     xo=oper, lk=false}
492 : monnier 429 end
493 : leunga 744 and twr {to, ra, rb} =
494 :     let val to = emit_int to
495 :     val ra = emit_GP ra
496 :     val rb = emit_GP rb
497 : george 545 in eWord32 ((to << 0wx15) + ((ra << 0wx10) + ((rb << 0wxb) + 0wx7c000008)))
498 : monnier 411 end
499 : leunga 744 and twi {to, ra, si} =
500 :     let val to = emit_int to
501 :     val ra = emit_GP ra
502 :     val si = emit_operand si
503 : george 545 in eWord32 ((to << 0wx15) + ((ra << 0wx10) + ((si && 0wxffff) + 0wxc000000)))
504 : monnier 411 end
505 : george 545 and tw {to, ra, si} =
506 : leunga 744 (case si of
507 :     I.RegOp rb => twr {to=to, ra=ra, rb=rb}
508 :     | _ => twi {to=to, ra=ra, si=si}
509 : george 545 )
510 : leunga 744 and tdr {to, ra, rb} =
511 :     let val to = emit_int to
512 :     val ra = emit_GP ra
513 :     val rb = emit_GP rb
514 : george 545 in eWord32 ((to << 0wx15) + ((ra << 0wx10) + ((rb << 0wxb) + 0wx7c000088)))
515 : monnier 411 end
516 : leunga 744 and tdi {to, ra, si} =
517 :     let val to = emit_int to
518 :     val ra = emit_GP ra
519 :     val si = emit_operand si
520 : george 545 in eWord32 ((to << 0wx15) + ((ra << 0wx10) + ((si && 0wxffff) + 0wx8000000)))
521 : monnier 411 end
522 : george 545 and td {to, ra, si} =
523 : leunga 744 (case si of
524 :     I.RegOp rb => tdr {to=to, ra=ra, rb=rb}
525 :     | _ => tdi {to=to, ra=ra, si=si}
526 : monnier 429 )
527 : leunga 744 and mcrf {bf, bfa} =
528 :     let val bf = emit_CC bf
529 :     val bfa = emit_CC bfa
530 : george 545 in eWord32 ((bf << 0wx17) + ((bfa << 0wx12) + 0wx4c000000))
531 :     end
532 : leunga 744 and mtspr' {rs, spr} =
533 :     let val rs = emit_GP rs
534 : george 545 in eWord32 ((rs << 0wx15) + ((spr << 0wxb) + 0wx7c0003a6))
535 :     end
536 : leunga 744 and mtspr {rs, spr} =
537 :     let val spr = emit_SPR spr
538 : george 545 in mtspr' {rs=rs, spr=((spr && 0wx1f) << 0wx5) + ((spr << 0wx5) && 0wx1f)}
539 : monnier 411 end
540 : leunga 744 and mfspr' {rt, spr} =
541 :     let val rt = emit_GP rt
542 : george 545 in eWord32 ((rt << 0wx15) + ((spr << 0wxb) + 0wx7c0002a6))
543 : monnier 411 end
544 : leunga 744 and mfspr {rt, spr} =
545 :     let val spr = emit_SPR spr
546 : george 545 in mfspr' {rt=rt, spr=((spr && 0wx1f) << 0wx5) + ((spr << 0wx5) && 0wx1f)}
547 : monnier 411 end
548 : leunga 744 and b {li, aa, lk} =
549 :     let val aa = emit_bool aa
550 :     val lk = emit_bool lk
551 : george 545 in eWord32 (((li && 0wxffffff) << 0wx2) + ((aa << 0wx1) + (lk + 0wx48000000)))
552 : monnier 411 end
553 : leunga 744 and be {li, aa, lk} =
554 :     let val aa = emit_bool aa
555 :     val lk = emit_bool lk
556 : george 545 in eWord32 (((li && 0wxffffff) << 0wx2) + ((aa << 0wx1) + (lk + 0wx58000000)))
557 : monnier 411 end
558 : leunga 744 and bc {bo, bi, bd, aa, lk} =
559 :     let val bo = emit_bo bo
560 :     val aa = emit_bool aa
561 :     val lk = emit_bool lk
562 : george 545 in eWord32 ((bo << 0wx15) + ((bi << 0wx10) + (((bd && 0wx3fff) << 0wx2) + ((aa << 0wx1) + (lk + 0wx40000000)))))
563 : monnier 411 end
564 : leunga 744 and bce {bo, bi, bd, aa, lk} =
565 :     let val bo = emit_bo bo
566 :     val aa = emit_bool aa
567 :     val lk = emit_bool lk
568 : george 545 in eWord32 ((bo << 0wx15) + ((bi << 0wx10) + (((bd && 0wx3fff) << 0wx2) + ((aa << 0wx1) + (lk + 0wx40000000)))))
569 : monnier 411 end
570 : leunga 744 and bclr {bo, bi, lk} =
571 :     let val bo = emit_bo bo
572 :     val lk = emit_bool lk
573 : george 545 in eWord32 ((bo << 0wx15) + ((bi << 0wx10) + (lk + 0wx4c000020)))
574 : monnier 411 end
575 : leunga 744 and bclre {bo, bi, lk} =
576 :     let val bo = emit_bo bo
577 :     val lk = emit_bool lk
578 : george 545 in eWord32 ((bo << 0wx15) + ((bi << 0wx10) + (lk + 0wx4c000022)))
579 :     end
580 : leunga 744 and bcctr {bo, bi, lk} =
581 :     let val bo = emit_bo bo
582 :     val lk = emit_bool lk
583 : george 545 in eWord32 ((bo << 0wx15) + ((bi << 0wx10) + (lk + 0wx4c000420)))
584 : monnier 411 end
585 : leunga 744 and bcctre {bo, bi, lk} =
586 :     let val bo = emit_bo bo
587 :     val lk = emit_bool lk
588 : george 545 in eWord32 ((bo << 0wx15) + ((bi << 0wx10) + (lk + 0wx4c000422)))
589 : monnier 411 end
590 : leunga 744 and rlwnm {rs, ra, sh, mb, me} =
591 :     let val rs = emit_GP rs
592 :     val ra = emit_GP ra
593 :     val sh = emit_GP sh
594 :     val mb = emit_int mb
595 :     val me = emit_int me
596 : george 545 in eWord32 ((rs << 0wx15) + ((ra << 0wx10) + ((sh << 0wxb) + ((mb << 0wx6) + ((me << 0wx1) + 0wx5c000000)))))
597 :     end
598 : leunga 744 and rlwinm {rs, ra, sh, mb, me} =
599 :     let val rs = emit_GP rs
600 :     val ra = emit_GP ra
601 :     val mb = emit_int mb
602 :     val me = emit_int me
603 : george 545 in eWord32 ((rs << 0wx15) + ((ra << 0wx10) + ((sh << 0wxb) + ((mb << 0wx6) + ((me << 0wx1) + 0wx54000000)))))
604 :     end
605 : leunga 744 and rldcl {rs, ra, sh, mb} =
606 :     let val rs = emit_GP rs
607 :     val ra = emit_GP ra
608 :     val sh = emit_GP sh
609 :     val mb = emit_int mb
610 : george 545 in eWord32 ((rs << 0wx15) + ((ra << 0wx10) + ((sh << 0wxb) + ((mb << 0wx6) + 0wx78000010))))
611 : monnier 411 end
612 : leunga 744 and rldicl {rs, ra, sh, mb, sh2} =
613 :     let val rs = emit_GP rs
614 :     val ra = emit_GP ra
615 :     val mb = emit_int mb
616 : george 545 in eWord32 ((rs << 0wx15) + ((ra << 0wx10) + ((sh << 0wxb) + ((mb << 0wx6) + ((sh2 << 0wx1) + 0wx78000000)))))
617 : monnier 429 end
618 : leunga 744 and rldcr {rs, ra, sh, mb} =
619 :     let val rs = emit_GP rs
620 :     val ra = emit_GP ra
621 :     val sh = emit_GP sh
622 :     val mb = emit_int mb
623 : george 545 in eWord32 ((rs << 0wx15) + ((ra << 0wx10) + ((sh << 0wxb) + ((mb << 0wx6) + 0wx78000012))))
624 : monnier 429 end
625 : leunga 744 and rldicr {rs, ra, sh, mb, sh2} =
626 :     let val rs = emit_GP rs
627 :     val ra = emit_GP ra
628 :     val mb = emit_int mb
629 : george 545 in eWord32 ((rs << 0wx15) + ((ra << 0wx10) + ((sh << 0wxb) + ((mb << 0wx6) + ((sh2 << 0wx1) + 0wx78000004)))))
630 : monnier 411 end
631 : leunga 744 and rldic {rs, ra, sh, mb, sh2} =
632 :     let val rs = emit_GP rs
633 :     val ra = emit_GP ra
634 :     val mb = emit_int mb
635 : george 545 in eWord32 ((rs << 0wx15) + ((ra << 0wx10) + ((sh << 0wxb) + ((mb << 0wx6) + ((sh2 << 0wx1) + 0wx78000008)))))
636 : monnier 429 end
637 : leunga 744 and rlwimi {rs, ra, sh, mb, me} =
638 :     let val rs = emit_GP rs
639 :     val ra = emit_GP ra
640 :     val mb = emit_int mb
641 :     val me = emit_int me
642 : george 545 in eWord32 ((rs << 0wx15) + ((ra << 0wx10) + ((sh << 0wxb) + ((mb << 0wx6) + ((me << 0wx1) + 0wx50000000)))))
643 : monnier 429 end
644 : leunga 744 and rldimi {rs, ra, sh, mb, sh2} =
645 :     let val rs = emit_GP rs
646 :     val ra = emit_GP ra
647 :     val mb = emit_int mb
648 : george 545 in eWord32 ((rs << 0wx15) + ((ra << 0wx10) + ((sh << 0wxb) + ((mb << 0wx6) + ((sh2 << 0wx1) + 0wx7800000c)))))
649 : monnier 429 end
650 : george 545 and rotate {oper, ra, rs, sh, mb, me} =
651 : leunga 744 (case (oper, me) of
652 :     (I.RLWNM, SOME me) => rlwnm {ra=ra, rs=rs, sh=sh, mb=mb, me=me}
653 :     | (I.RLDCL, _) => rldcl {ra=ra, rs=rs, sh=sh, mb=mb}
654 :     | (I.RLDCR, _) => rldcr {ra=ra, rs=rs, sh=sh, mb=mb}
655 : monnier 411 )
656 : leunga 744 and rotatei {oper, ra, rs, sh, mb, me} =
657 :     let val sh = emit_operand sh
658 : george 545 in
659 : leunga 744 (case (oper, me) of
660 :     (I.RLWINM, SOME me) => rlwinm {ra=ra, rs=rs, sh=sh, mb=mb, me=me}
661 :     | (I.RLWIMI, SOME me) => rlwimi {ra=ra, rs=rs, sh=sh, mb=mb, me=me}
662 :     | (I.RLDICL, _) => rldicl {ra=ra, rs=rs, sh=(sh && 0wx1f), sh2=((sh << 0wx5) && 0wx1),
663 :     mb=mb}
664 :     | (I.RLDICR, _) => rldicr {ra=ra, rs=rs, sh=(sh && 0wx1f), sh2=((sh << 0wx5) && 0wx1),
665 :     mb=mb}
666 :     | (I.RLDIC, _) => rldic {ra=ra, rs=rs, sh=(sh && 0wx1f), sh2=((sh << 0wx5) && 0wx1),
667 :     mb=mb}
668 :     | (I.RLDIMI, _) => rldimi {ra=ra, rs=rs, sh=(sh && 0wx1f), sh2=((sh << 0wx5) && 0wx1),
669 :     mb=mb}
670 : george 545 )
671 :     end
672 : monnier 411
673 : leunga 744 (*#line 533.7 "ppc/ppc.mdl"*)
674 : george 545 fun relative (I.LabelOp lexp) = (itow ((LabelExp.valueOf lexp) - ( ! loc))) ~>> 0wx2
675 :     | relative _ = error "relative"
676 : leunga 744 fun emitter instr =
677 :     let
678 : george 545 fun emitInstr (I.L{ld, rt, ra, d, mem}) = load {ld=ld, rt=rt, ra=ra, d=d}
679 :     | emitInstr (I.LF{ld, ft, ra, d, mem}) = fload {ld=ld, ft=ft, ra=ra, d=d}
680 :     | emitInstr (I.ST{st, rs, ra, d, mem}) = store {st=st, rs=rs, ra=ra, d=d}
681 : leunga 744 | emitInstr (I.STF{st, fs, ra, d, mem}) = fstore {st=st, fs=fs, ra=ra,
682 :     d=d}
683 :     | emitInstr (I.UNARY{oper, rt, ra, Rc, OE}) = unary {oper=oper, rt=rt,
684 :     ra=ra, OE=OE, Rc=Rc}
685 :     | emitInstr (I.ARITH{oper, rt, ra, rb, Rc, OE}) = arith {oper=oper, rt=rt,
686 :     ra=ra, rb=rb, OE=OE, Rc=Rc}
687 :     | emitInstr (I.ARITHI{oper, rt, ra, im}) = arithi {oper=oper, rt=rt, ra=ra,
688 :     im=im}
689 :     | emitInstr (I.ROTATE{oper, ra, rs, sh, mb, me}) = rotate {oper=oper,
690 :     ra=ra, rs=rs, sh=sh, mb=mb, me=me}
691 :     | emitInstr (I.ROTATEI{oper, ra, rs, sh, mb, me}) = rotatei {oper=oper,
692 :     ra=ra, rs=rs, sh=sh, mb=mb, me=me}
693 :     | emitInstr (I.COMPARE{cmp, l, bf, ra, rb}) = compare {cmp=cmp, bf=bf,
694 :     l=l, ra=ra, rb=rb}
695 :     | emitInstr (I.FCOMPARE{cmp, bf, fa, fb}) = fcmp {cmp=cmp, bf=bf, fa=fa,
696 :     fb=fb}
697 :     | emitInstr (I.FUNARY{oper, ft, fb, Rc}) = funary {oper=oper, ft=ft, fb=fb,
698 :     Rc=Rc}
699 :     | emitInstr (I.FARITH{oper, ft, fa, fb, Rc}) = farith {oper=oper, ft=ft,
700 :     fa=fa, fb=fb, Rc=Rc}
701 :     | emitInstr (I.FARITH3{oper, ft, fa, fb, fc, Rc}) = farith3 {oper=oper,
702 :     ft=ft, fa=fa, fb=fb, fc=fc, Rc=Rc}
703 :     | emitInstr (I.CCARITH{oper, bt, ba, bb}) = ccarith {oper=oper, bt=bt,
704 :     ba=ba, bb=bb}
705 : george 545 | emitInstr (I.MCRF{bf, bfa}) = mcrf {bf=bf, bfa=bfa}
706 :     | emitInstr (I.MTSPR{rs, spr}) = mtspr {rs=rs, spr=spr}
707 :     | emitInstr (I.MFSPR{rt, spr}) = mfspr {rt=rt, spr=spr}
708 :     | emitInstr (I.TW{to, ra, si}) = tw {to=to, ra=ra, si=si}
709 :     | emitInstr (I.TD{to, ra, si}) = td {to=to, ra=ra, si=si}
710 : leunga 744 | emitInstr (I.BC{bo, bf, bit, addr, LK, fall}) = bc {bo=bo, bi=cr_bit {cc=(bf,
711 :     bit)}, bd=relative addr, aa=false, lk=LK}
712 :     | emitInstr (I.BCLR{bo, bf, bit, LK, labels}) = bclr {bo=bo, bi=cr_bit {cc=(bf,
713 :     bit)}, lk=LK}
714 : george 545 | emitInstr (I.B{addr, LK}) = b {li=relative addr, aa=false, lk=LK}
715 :     | emitInstr (I.CALL{def, use, mem}) = bclr {bo=I.ALWAYS, bi=0wx0, lk=true}
716 :     | emitInstr (I.COPY{dst, src, impl, tmp}) = error "COPY"
717 :     | emitInstr (I.FCOPY{dst, src, impl, tmp}) = error "FCOPY"
718 :     | emitInstr (I.ANNOTATION{i, a}) = emitInstr i
719 : leunga 624 | emitInstr (I.SOURCE{}) = ()
720 :     | emitInstr (I.SINK{}) = ()
721 :     | emitInstr (I.PHI{}) = ()
722 : monnier 411 in
723 : leunga 744 emitInstr instr
724 : monnier 411 end
725 :    
726 : monnier 429 in S.STREAM{beginCluster=init,
727 : monnier 411 pseudoOp=pseudoOp,
728 :     emit=emitter,
729 : monnier 429 endCluster=doNothing,
730 : monnier 411 defineLabel=doNothing,
731 :     entryLabel=doNothing,
732 :     comment=doNothing,
733 :     exitBlock=doNothing,
734 : leunga 744 annotation=doNothing
735 : monnier 411 }
736 :     end
737 :     end
738 :    

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