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/ppcAsm.sml
ViewVC logotype

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

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

revision 858, Wed Jun 27 21:20:27 2001 UTC revision 859, Wed Jun 27 21:43:12 2001 UTC
# Line 20  Line 20 
20    
21     val show_cellset = MLRiscControl.getFlag "asm-show-cellset"     val show_cellset = MLRiscControl.getFlag "asm-show-cellset"
22     val show_region  = MLRiscControl.getFlag "asm-show-region"     val show_region  = MLRiscControl.getFlag "asm-show-region"
23       val show_cutsTo = MLRiscControl.getFlag "asm-show-cutsto"
24     val indent_copies = MLRiscControl.getFlag "asm-indent-copies"     val indent_copies = MLRiscControl.getFlag "asm-indent-copies"
25    
26     fun error msg = MLRiscErrorMsg.error("PPCAsmEmitter",msg)     fun error msg = MLRiscErrorMsg.error("PPCAsmEmitter",msg)
# Line 49  Line 50 
50         fun entryLabel lab = defineLabel lab         fun entryLabel lab = defineLabel lab
51         fun comment msg = (tab(); emit("/* " ^ msg ^ " */"))         fun comment msg = (tab(); emit("/* " ^ msg ^ " */"))
52         fun annotation a = (comment(Annotations.toString a); nl())         fun annotation a = (comment(Annotations.toString a); nl())
53           fun getAnnotations() = error "getAnnotations"
54         fun doNothing _ = ()         fun doNothing _ = ()
55         fun emit_region mem = comment(I.Region.toString mem)         fun emit_region mem = comment(I.Region.toString mem)
56         val emit_region =         val emit_region =
# Line 64  Line 66 
66           if !show_cellset then emit_cellset else doNothing           if !show_cellset then emit_cellset else doNothing
67         fun emit_defs cellset = emit_cellset("defs: ",cellset)         fun emit_defs cellset = emit_cellset("defs: ",cellset)
68         fun emit_uses cellset = emit_cellset("uses: ",cellset)         fun emit_uses cellset = emit_cellset("uses: ",cellset)
69           val emit_cutsTo =
70             if !show_cutsTo then AsmFormatUtil.emit_cutsTo emit
71             else doNothing
72         fun emitter instr =         fun emitter instr =
73         let         let
74     fun asm_spr (I.XER) = "xer"     fun asm_spr (I.XER) = "xer"
# Line 218  Line 223 
223       | asm_bit (I.OX) = "so"       | asm_bit (I.OX) = "so"
224     and emit_bit x = emit (asm_bit x)     and emit_bit x = emit (asm_bit x)
225    
226  (*#line 563.7 "ppc/ppc.mdl"*)  (*#line 570.7 "ppc/ppc.mdl"*)
227     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")
228            then            then
229            ( emit (String.substring (s, 0, (size s) - 1));            ( emit (String.substring (s, 0, (size s) - 1));
# Line 228  Line 233 
233              emit "x" ))              emit "x" ))
234       | emitx (s, _) = emit s       | emitx (s, _) = emit s
235    
236  (*#line 569.7 "ppc/ppc.mdl"*)  (*#line 576.7 "ppc/ppc.mdl"*)
237     fun eOERc {OE=false, Rc=false} = ()     fun eOERc {OE=false, Rc=false} = ()
238       | eOERc {OE=false, Rc=true} = emit "."       | eOERc {OE=false, Rc=true} = emit "."
239       | eOERc {OE=true, Rc=false} = emit "o"       | eOERc {OE=true, Rc=false} = emit "o"
240       | eOERc {OE=true, Rc=true} = emit "o."       | eOERc {OE=true, Rc=true} = emit "o."
241    
242  (*#line 573.7 "ppc/ppc.mdl"*)  (*#line 580.7 "ppc/ppc.mdl"*)
243     fun eRc false = ""     fun eRc false = ""
244       | eRc true = "."       | eRc true = "."
245    
246  (*#line 574.7 "ppc/ppc.mdl"*)  (*#line 581.7 "ppc/ppc.mdl"*)
247     fun cr_bit (cr, bit) = (4 * (C.physicalRegisterNum cr)) +     fun cr_bit (cr, bit) = (4 * (C.physicalRegisterNum cr)) +
248         (case bit of         (case bit of
249           I.LT => 0           I.LT => 0
# Line 255  Line 260 
260         | I.OX => 3         | I.OX => 3
261         )         )
262    
263  (*#line 581.7 "ppc/ppc.mdl"*)  (*#line 588.7 "ppc/ppc.mdl"*)
264     fun eCRbit x = emit (Int.toString (cr_bit x))     fun eCRbit x = emit (Int.toString (cr_bit x))
265    
266  (*#line 582.7 "ppc/ppc.mdl"*)  (*#line 589.7 "ppc/ppc.mdl"*)
267     fun eLK true = emit "l"     fun eLK true = emit "l"
268       | eLK false = ()       | eLK false = ()
269    
270  (*#line 583.7 "ppc/ppc.mdl"*)  (*#line 590.7 "ppc/ppc.mdl"*)
271     fun eI (I.RegOp _) = ()     fun eI (I.RegOp _) = ()
272       | eI _ = emit "i"       | eI _ = emit "i"
273    
274  (*#line 584.7 "ppc/ppc.mdl"*)  (*#line 591.7 "ppc/ppc.mdl"*)
275     fun eBI (bo, bf, bit) =     fun eBI (bo, bf, bit) =
276         (case (bo, C.physicalRegisterNum bf) of         (case (bo, C.physicalRegisterNum bf) of
277           (I.ALWAYS, _) => ()           (I.ALWAYS, _) => ()
# Line 275  Line 280 
280         | (_, n) => emit ((("4*cr" ^ (Int.toString n)) ^ "+") ^ (asm_bit bit))         | (_, n) => emit ((("4*cr" ^ (Int.toString n)) ^ "+") ^ (asm_bit bit))
281         )         )
282    
283  (*#line 590.7 "ppc/ppc.mdl"*)  (*#line 597.7 "ppc/ppc.mdl"*)
284     fun emit_bo bo = emit     fun emit_bo bo = emit
285         (case bo of         (case bo of
286           I.TRUE => "t"           I.TRUE => "t"
# Line 291  Line 296 
296              else "f")              else "f")
297         )         )
298    
299  (*#line 601.7 "ppc/ppc.mdl"*)  (*#line 608.7 "ppc/ppc.mdl"*)
300     fun eME (SOME me) =     fun eME (SOME me) =
301         ( emit ", ";         ( emit ", ";
302           emit_int me )           emit_int me )
303       | eME NONE = ()       | eME NONE = ()
304    
305  (*#line 604.7 "ppc/ppc.mdl"*)  (*#line 611.7 "ppc/ppc.mdl"*)
306     fun addr (ra, I.RegOp rb) =     fun addr (ra, I.RegOp rb) =
307         ( emitCell ra;         ( emitCell ra;
308           emit ", ";           emit ", ";
# Line 492  Line 497 
497             eLK LK;             eLK LK;
498             emit "\t";             emit "\t";
499             emit_operand addr )             emit_operand addr )
500         | I.CALL{def, use, mem} =>         | I.CALL{def, use, cutsTo, mem} =>
501           ( emit "blrl";           ( emit "blrl";
502             emit_region mem;             emit_region mem;
503             emit_defs def;             emit_defs def;
504             emit_uses use )             emit_uses use;
505               emit_cutsTo cutsTo )
506         | I.COPY{dst, src, impl, tmp} => emitInstrs (Shuffle.shuffle {tmp=tmp,         | I.COPY{dst, src, impl, tmp} => emitInstrs (Shuffle.shuffle {tmp=tmp,
507              dst=dst, src=src})              dst=dst, src=src})
508         | I.FCOPY{dst, src, impl, tmp} => emitInstrs (Shuffle.shufflefp {tmp=tmp,         | I.FCOPY{dst, src, impl, tmp} => emitInstrs (Shuffle.shufflefp {tmp=tmp,
# Line 524  Line 530 
530                  entryLabel=entryLabel,                  entryLabel=entryLabel,
531                  comment=comment,                  comment=comment,
532                  exitBlock=doNothing,                  exitBlock=doNothing,
533                  annotation=annotation                  annotation=annotation,
534                    getAnnotations=getAnnotations
535                 }                 }
536     end     end
537  end  end

Legend:
Removed from v.858  
changed lines
  Added in v.859

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