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 859 - (view) (download)

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

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