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/ra/risc-ra.sml
 [smlnj] / sml / trunk / src / MLRISC / ra / risc-ra.sml

# Diff of /sml/trunk/src/MLRISC/ra/risc-ra.sml

revision 822, Tue May 8 21:08:11 2001 UTC revision 823, Tue May 8 21:25:15 2001 UTC
# Line 134  Line 134
134     fun x - y = Word.toIntX(Word.-(Word.fromInt x, Word.fromInt y))     fun x - y = Word.toIntX(Word.-(Word.fromInt x, Word.fromInt y))
135
136     (* GetReg specialized to integer and floating point registers *)     (* GetReg specialized to integer and floating point registers *)
137       fun isDedicated (len, arr, others) r =
138         (r < len andalso Array.sub(arr, r)) orelse List.exists (fn d => r = d) others
139
140       fun mark(arr, _, [], others) = others
141         | mark(arr, len, r::rs, others) = let
142             val r = C.registerId r
143           in
144             if r >= len then mark(arr, len, rs, r::others)
145             else (Array.update(arr, r, true); mark(arr, len, rs, others))
146           end
147
148
149
150     local     local
151        val {low,high} = C.cellRange C.GP        val {low,high} = C.cellRange C.GP
152           val arr = Array.array(high+1,false)
153           val others = mark(arr, high+1, Int.dedicated, [])
154     in     in
155         structure GR = GetReg(val first=low val nRegs=high-low+1         structure GR = GetReg(val first=low val nRegs=high-low+1
156                               val available=map C.registerId Int.avail)                               val available=map C.registerId Int.avail)
157         val dedicatedR = Array.array(high+1,false)         val dedicatedR : int -> bool = isDedicated (high+1, arr, others)
val _ = app (fn r => Array.update(dedicatedR,C.registerId r,true))
Int.dedicated

158     end     end
159     local     local
160        val {low,high} = C.cellRange C.FP        val {low,high} = C.cellRange C.FP
161          val arr = Array.array(high+1,false)
162          val others = mark(arr, high+1, Float.dedicated, [])
163     in     in
164        structure FR = GetReg(val first=low val nRegs=high-low+1        structure FR = GetReg(val first=low val nRegs=high-low+1
165                              val available=map C.registerId Float.avail)                              val available=map C.registerId Float.avail)
166        val dedicatedF = Array.array(high+1,false)        val dedicatedF : int -> bool = isDedicated(high+1, arr, others)
val _ = app (fn r => Array.update(dedicatedF,C.registerId r,true))
Float.dedicated
167     end     end
168
169     (* Spill integer register *)     (* Spill integer register *)

Legend:
 Removed from v.822 changed lines Added in v.823