Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Tracker SCM

SCM Repository

[smlnj] Diff of /sml/trunk/src/MLRISC/flowgraph/gasPseudoOps.sml
ViewVC logotype

Diff of /sml/trunk/src/MLRISC/flowgraph/gasPseudoOps.sml

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

revision 1022, Thu Jan 17 13:39:45 2002 UTC revision 1023, Thu Jan 17 14:02:05 2002 UTC
# Line 65  Line 65 
65      String.concat      String.concat
66        (map (fn lab => (Fmt.format fmt [Fmt.STR (lexpToString(T.LABEL lab))])) labs)        (map (fn lab => (Fmt.format fmt [Fmt.STR (lexpToString(T.LABEL lab))])) labs)
67    
68    fun toString(PB.ALIGN_SZ n)     = Fmt.format ".align %d" [Fmt.INT n]    fun toString(PB.ALIGN_SZ n)     = Fmt.format "\t.align\t%d" [Fmt.INT n]
69      | toString(PB.ALIGN_ENTRY)    = ".align 4"                  (* 16 byte boundary *)      | toString(PB.ALIGN_ENTRY)    = "\t.align\t4"       (* 16 byte boundary *)
70      | toString(PB.ALIGN_LABEL)    = ".p2align 4,,7"      | toString(PB.ALIGN_LABEL)    = "\t.p2align\t4,,7"
71    
72      | toString(PB.DATA_LABEL lab) = Label.fmt labFmt lab ^ ":"      | toString(PB.DATA_LABEL lab) = Label.fmt labFmt lab ^ ":"
73      | toString(PB.DATA_READ_ONLY) = ".section      .rodata"      | toString(PB.DATA_READ_ONLY) = "\t.section\t.rodata"
74      | toString(PB.DATA)           = ".data"      | toString(PB.DATA)           = "\t.data"
75      | toString(PB.BSS)            = ".section      .bss"      | toString(PB.BSS)            = "\t.section\t.bss"
76      | toString(PB.TEXT)           = ".text"      | toString(PB.TEXT)           = "\t.text"
77      | toString(PB.SECTION at)     = ".section     " ^ Atom.toString at      | toString(PB.SECTION at)     = "\t.section\t" ^ Atom.toString at
78    
79      | toString(PB.REORDER)        = ""      | toString(PB.REORDER)        = ""
80      | toString(PB.NOREORDER)      = ""      | toString(PB.NOREORDER)      = ""
81    
82      | toString(PB.INT{sz, i})     =      | toString(PB.INT{sz, i})     = let
83          String.concat          fun join [] = []
84             ((case sz            | join [lexp] = [lexpToString lexp]
85               of 8  => ".byte "            | join (lexp::r) = lexpToString lexp :: "," :: join r
86                | 16 => ".short "          val pop = (case sz
87                | 32 => ".int "                 of 8 => "\t.byte\t"
88                    | 16 => "\t.short\t"
89                    | 32 => "\t.int\t"
90                | 64 => error "INT64"                | 64 => error "INT64"
91              (*esac*)) :: map (fn lexp => lexpToString lexp ^ " ") i)                (* end case *))
92            in
93              String.concat (pop :: join i)
94            end
95    
96      | toString(PB.ASCII s)        = Fmt.format ".ascii \"%s\"" [Fmt.STR s]      | toString(PB.ASCII s)        =
97            Fmt.format "\t.ascii\t\"%s\"" [Fmt.STR(String.toCString s)]
98      | toString(PB.ASCIIZ s)       =      | toString(PB.ASCIIZ s)       =
99           Fmt.format ".ascii \"%s\"" [Fmt.STR (String.toCString s)]          Fmt.format "\t.ascii \"%s\"" [Fmt.STR(String.toCString s)]
100    
101      | toString(PB.SPACE sz)       = Fmt.format ".space %d" [Fmt.INT sz]      | toString(PB.SPACE sz)       = Fmt.format "\t.space\t%d" [Fmt.INT sz]
102    
103      | toString(PB.FLOAT{sz, f})   =      | toString(PB.FLOAT{sz, f})   = let
104           String.concat          fun join [] = []
105             ((case sz            | join [f] = [f]
106               of 32 => ".single "            | join (f::r) = f :: "," :: join r
107                | 64 => ".double "          val pop = (case sz
108                | 128 => ".extended "                 of 32 => "\t.single "
109              (*easc*)) :: f)                  | 64 => "\t.double "
110                    | 128 => "\t.extended "
111                  (* end case *))
112            in
113              String.concat (pop :: join f)
114            end
115    
116      | toString(PB.IMPORT labs) = decls(".extern %s", labs)      | toString(PB.IMPORT labs) = decls("\t.extern\t%s", labs)
117      | toString(PB.EXPORT labs) = decls(".global %s", labs)      | toString(PB.EXPORT labs) = decls("\t.global\t%s", labs)
118      | toString(PB.COMMENT txt) = Fmt.format "/* %s */" [Fmt.STR txt]      | toString(PB.COMMENT txt) = Fmt.format "/* %s */" [Fmt.STR txt]
119    
120    

Legend:
Removed from v.1022  
changed lines
  Added in v.1023

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