237 |
| asm_bit (I.OX) = "so" |
| asm_bit (I.OX) = "so" |
238 |
and emit_bit x = emit (asm_bit x) |
and emit_bit x = emit (asm_bit x) |
239 |
|
|
240 |
(*#line 602.7 "ppc/ppc.mdl"*) |
(*#line 608.7 "ppc/ppc.mdl"*) |
241 |
fun emitx (s, I.RegOp _) = (if ((String.sub (s, (size s) - 1)) = #"e") |
fun emitx (s, I.RegOp _) = (if ((String.sub (s, (size s) - 1)) = #"e") |
242 |
then |
then |
243 |
( emit (String.substring (s, 0, (size s) - 1)); |
( emit (String.substring (s, 0, (size s) - 1)); |
247 |
emit "x" )) |
emit "x" )) |
248 |
| emitx (s, _) = emit s |
| emitx (s, _) = emit s |
249 |
|
|
250 |
(*#line 608.7 "ppc/ppc.mdl"*) |
(*#line 614.7 "ppc/ppc.mdl"*) |
251 |
fun eOERc {OE=false, Rc=false} = () |
fun eOERc {OE=false, Rc=false} = () |
252 |
| eOERc {OE=false, Rc=true} = emit "." |
| eOERc {OE=false, Rc=true} = emit "." |
253 |
| eOERc {OE=true, Rc=false} = emit "o" |
| eOERc {OE=true, Rc=false} = emit "o" |
254 |
| eOERc {OE=true, Rc=true} = emit "o." |
| eOERc {OE=true, Rc=true} = emit "o." |
255 |
|
|
256 |
(*#line 612.7 "ppc/ppc.mdl"*) |
(*#line 618.7 "ppc/ppc.mdl"*) |
257 |
fun eRc false = "" |
fun eRc false = "" |
258 |
| eRc true = "." |
| eRc true = "." |
259 |
|
|
260 |
(*#line 613.7 "ppc/ppc.mdl"*) |
(*#line 619.7 "ppc/ppc.mdl"*) |
261 |
fun cr_bit (cr, bit) = (4 * (CellsBasis.physicalRegisterNum cr)) + |
fun cr_bit (cr, bit) = (4 * (CellsBasis.physicalRegisterNum cr)) + |
262 |
(case bit of |
(case bit of |
263 |
I.LT => 0 |
I.LT => 0 |
274 |
| I.OX => 3 |
| I.OX => 3 |
275 |
) |
) |
276 |
|
|
277 |
(*#line 620.7 "ppc/ppc.mdl"*) |
(*#line 626.7 "ppc/ppc.mdl"*) |
278 |
fun eCRbit x = emit (Int.toString (cr_bit x)) |
fun eCRbit x = emit (Int.toString (cr_bit x)) |
279 |
|
|
280 |
(*#line 621.7 "ppc/ppc.mdl"*) |
(*#line 627.7 "ppc/ppc.mdl"*) |
281 |
fun eLK true = emit "l" |
fun eLK true = emit "l" |
282 |
| eLK false = () |
| eLK false = () |
283 |
|
|
284 |
(*#line 622.7 "ppc/ppc.mdl"*) |
(*#line 628.7 "ppc/ppc.mdl"*) |
285 |
fun eI (I.RegOp _) = () |
fun eI (I.RegOp _) = () |
286 |
| eI _ = emit "i" |
| eI _ = emit "i" |
287 |
|
|
288 |
(*#line 623.7 "ppc/ppc.mdl"*) |
(*#line 629.7 "ppc/ppc.mdl"*) |
289 |
fun eBI (bo, bf, bit) = |
fun eBI (bo, bf, bit) = |
290 |
(case (bo, CellsBasis.physicalRegisterNum bf) of |
(case (bo, CellsBasis.physicalRegisterNum bf) of |
291 |
(I.ALWAYS, _) => () |
(I.ALWAYS, _) => () |
294 |
| (_, n) => emit ((("4*cr" ^ (Int.toString n)) ^ "+") ^ (asm_bit bit)) |
| (_, n) => emit ((("4*cr" ^ (Int.toString n)) ^ "+") ^ (asm_bit bit)) |
295 |
) |
) |
296 |
|
|
297 |
(*#line 629.7 "ppc/ppc.mdl"*) |
(*#line 635.7 "ppc/ppc.mdl"*) |
298 |
fun emit_bo bo = emit |
fun emit_bo bo = emit |
299 |
(case bo of |
(case bo of |
300 |
I.TRUE => "t" |
I.TRUE => "t" |
310 |
else "f") |
else "f") |
311 |
) |
) |
312 |
|
|
313 |
(*#line 640.7 "ppc/ppc.mdl"*) |
(*#line 646.7 "ppc/ppc.mdl"*) |
314 |
fun eME (SOME me) = |
fun eME (SOME me) = |
315 |
( emit ", "; |
( emit ", "; |
316 |
emit_int me ) |
emit_int me ) |
317 |
| eME NONE = () |
| eME NONE = () |
318 |
|
|
319 |
(*#line 643.7 "ppc/ppc.mdl"*) |
(*#line 649.7 "ppc/ppc.mdl"*) |
320 |
fun addr (ra, I.RegOp rb) = |
fun addr (ra, I.RegOp rb) = |
321 |
( emitCell ra; |
( emitCell ra; |
322 |
emit ", "; |
emit ", "; |