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/trunk/src/MLRISC/ppc/emit/ppcAsm.sml
ViewVC logotype

Diff of /sml/trunk/src/MLRISC/ppc/emit/ppcAsm.sml

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

revision 1538, Tue Jul 13 19:04:05 2004 UTC revision 1539, Tue Jul 13 19:05:30 2004 UTC
# Line 224  Line 224 
224       | asm_bit (I.OX) = "so"       | asm_bit (I.OX) = "so"
225     and emit_bit x = emit (asm_bit x)     and emit_bit x = emit (asm_bit x)
226    
227  (*#line 570.7 "ppc/ppc.mdl"*)  (*#line 576.7 "ppc/ppc.mdl"*)
228     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")
229            then            then
230            ( emit (String.substring (s, 0, (size s) - 1));            ( emit (String.substring (s, 0, (size s) - 1));
# Line 234  Line 234 
234              emit "x" ))              emit "x" ))
235       | emitx (s, _) = emit s       | emitx (s, _) = emit s
236    
237  (*#line 576.7 "ppc/ppc.mdl"*)  (*#line 582.7 "ppc/ppc.mdl"*)
238     fun eOERc {OE=false, Rc=false} = ()     fun eOERc {OE=false, Rc=false} = ()
239       | eOERc {OE=false, Rc=true} = emit "."       | eOERc {OE=false, Rc=true} = emit "."
240       | eOERc {OE=true, Rc=false} = emit "o"       | eOERc {OE=true, Rc=false} = emit "o"
241       | eOERc {OE=true, Rc=true} = emit "o."       | eOERc {OE=true, Rc=true} = emit "o."
242    
243  (*#line 580.7 "ppc/ppc.mdl"*)  (*#line 586.7 "ppc/ppc.mdl"*)
244     fun eRc false = ""     fun eRc false = ""
245       | eRc true = "."       | eRc true = "."
246    
247  (*#line 581.7 "ppc/ppc.mdl"*)  (*#line 587.7 "ppc/ppc.mdl"*)
248     fun cr_bit (cr, bit) = (4 * (CellsBasis.physicalRegisterNum cr)) +     fun cr_bit (cr, bit) = (4 * (CellsBasis.physicalRegisterNum cr)) +
249         (case bit of         (case bit of
250           I.LT => 0           I.LT => 0
# Line 261  Line 261 
261         | I.OX => 3         | I.OX => 3
262         )         )
263    
264  (*#line 588.7 "ppc/ppc.mdl"*)  (*#line 594.7 "ppc/ppc.mdl"*)
265     fun eCRbit x = emit (Int.toString (cr_bit x))     fun eCRbit x = emit (Int.toString (cr_bit x))
266    
267  (*#line 589.7 "ppc/ppc.mdl"*)  (*#line 595.7 "ppc/ppc.mdl"*)
268     fun eLK true = emit "l"     fun eLK true = emit "l"
269       | eLK false = ()       | eLK false = ()
270    
271  (*#line 590.7 "ppc/ppc.mdl"*)  (*#line 596.7 "ppc/ppc.mdl"*)
272     fun eI (I.RegOp _) = ()     fun eI (I.RegOp _) = ()
273       | eI _ = emit "i"       | eI _ = emit "i"
274    
275  (*#line 591.7 "ppc/ppc.mdl"*)  (*#line 597.7 "ppc/ppc.mdl"*)
276     fun eBI (bo, bf, bit) =     fun eBI (bo, bf, bit) =
277         (case (bo, CellsBasis.physicalRegisterNum bf) of         (case (bo, CellsBasis.physicalRegisterNum bf) of
278           (I.ALWAYS, _) => ()           (I.ALWAYS, _) => ()
# Line 281  Line 281 
281         | (_, n) => emit ((("4*cr" ^ (Int.toString n)) ^ "+") ^ (asm_bit bit))         | (_, n) => emit ((("4*cr" ^ (Int.toString n)) ^ "+") ^ (asm_bit bit))
282         )         )
283    
284  (*#line 597.7 "ppc/ppc.mdl"*)  (*#line 603.7 "ppc/ppc.mdl"*)
285     fun emit_bo bo = emit     fun emit_bo bo = emit
286         (case bo of         (case bo of
287           I.TRUE => "t"           I.TRUE => "t"
# Line 297  Line 297 
297              else "f")              else "f")
298         )         )
299    
300  (*#line 608.7 "ppc/ppc.mdl"*)  (*#line 614.7 "ppc/ppc.mdl"*)
301     fun eME (SOME me) =     fun eME (SOME me) =
302         ( emit ", ";         ( emit ", ";
303           emit_int me )           emit_int me )
304       | eME NONE = ()       | eME NONE = ()
305    
306  (*#line 611.7 "ppc/ppc.mdl"*)  (*#line 617.7 "ppc/ppc.mdl"*)
307     fun addr (ra, I.RegOp rb) =     fun addr (ra, I.RegOp rb) =
308         ( emitCell ra;         ( emitCell ra;
309           emit ", ";           emit ", ";
# Line 460  Line 460 
460             emitCell spr;             emitCell spr;
461             emit "\t";             emit "\t";
462             emitCell rt )             emitCell rt )
463           | I.LWARX{rt, ra, rb} =>
464             ( emit "lwarx\t";
465               emitCell rt;
466               emit ", ";
467               emitCell ra;
468               emit ", ";
469               emitCell rb )
470           | I.STWCX{rs, ra, rb} =>
471             ( emit "stwcx.\t";
472               emitCell rs;
473               emit ", ";
474               emitCell ra;
475               emit ", ";
476               emitCell rb )
477         | I.TW{to, ra, si} =>         | I.TW{to, ra, si} =>
478           ( emit "tw";           ( emit "tw";
479             eI si;             eI si;

Legend:
Removed from v.1538  
changed lines
  Added in v.1539

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