Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/branches/idlbasis-devel/src/MLRISC/ppc/emit/ppcMC.sml
ViewVC logotype

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

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

Legend:
Removed from v.470  
changed lines
  Added in v.545

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