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 593, Tue Apr 4 07:26:33 2000 UTC revision 594, Tue Apr 4 23:41:47 2000 UTC
# Line 19  Line 19 
19    
20     val show_cellset = MLRiscControl.getFlag "asm-show-cellset"     val show_cellset = MLRiscControl.getFlag "asm-show-cellset"
21     val show_region  = MLRiscControl.getFlag "asm-show-region"     val show_region  = MLRiscControl.getFlag "asm-show-region"
22       val indent_copies = MLRiscControl.getFlag "asm-indent-copies"
23    
24     fun error msg = MLRiscErrorMsg.error("PPCAsmEmitter",msg)     fun error msg = MLRiscErrorMsg.error("PPCAsmEmitter",msg)
25    
# Line 32  Line 33 
33         fun emit s = (tabbing(!tabs); tabs := 0; newline := false; emit' s)         fun emit s = (tabbing(!tabs); tabs := 0; newline := false; emit' s)
34         fun nl() = (tabs := 0; if !newline then () else (newline := true; emit' "\n"))         fun nl() = (tabs := 0; if !newline then () else (newline := true; emit' "\n"))
35         fun comma() = emit ","         fun comma() = emit ","
36         fun tab() = tabs := !tabs + 1         fun tab() = tabs := 1
37           fun indent() = tabs := 2
38         fun ms n = let val s = Int.toString n         fun ms n = let val s = Int.toString n
39                    in  if n<0 then "-"^String.substring(s,1,size s-1)                    in  if n<0 then "-"^String.substring(s,1,size s-1)
40                        else s                        else s
# Line 328  Line 330 
330         emit "(";         emit "(";
331         emit_GP ra;         emit_GP ra;
332         emit ")" )         emit ")" )
333     fun emitInstr instr =     fun emitInstr' instr =
        ( tab ();  
   
334         (         (
335          case instr of          case instr of
336          I.L{ld, rt, ra, d, mem} =>          I.L{ld, rt, ra, d, mem} =>
# Line 526  Line 526 
526        | I.ANNOTATION{i, a} =>        | I.ANNOTATION{i, a} =>
527          ( emitInstr i;          ( emitInstr i;
528          comment (Annotations.toString a))          comment (Annotations.toString a))
529         );         )
530         nl ())            and emitInstr i = (tab(); emitInstr' i; nl())
531            and emitInstrs [] = ()            and emitInstrIndented i = (indent(); emitInstr' i; nl())
532              | emitInstrs (i::is) =            and emitInstrs instrs =
533             (emitInstr i; app (fn i => (tab(); emitInstr i)) is)             app (if !indent_copies then emitInstrIndented
534                    else emitInstr) instrs
535        in  emitInstr end        in  emitInstr end
536    
537     in  S.STREAM{beginCluster=init,     in  S.STREAM{beginCluster=init,

Legend:
Removed from v.593  
changed lines
  Added in v.594

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