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

Diff of /sml/trunk/src/MLRISC/instructions/shuffle.sml

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

revision 640, Tue May 9 02:33:09 2000 UTC revision 641, Thu May 11 01:16:45 2000 UTC
# Line 24  Line 24 
24    fun shuffle{mvInstr, ea} {regmap, tmp, dst, src} = let    fun shuffle{mvInstr, ea} {regmap, tmp, dst, src} = let
25      fun mv{dst, src, instrs} = List.revAppend(mvInstr{dst=dst,src=src}, instrs)      fun mv{dst, src, instrs} = List.revAppend(mvInstr{dst=dst,src=src}, instrs)
26      val TEMP = ~1      val TEMP = ~1
27      fun opnd dst = if dst = TEMP then Option.valOf tmp else ea dst      fun valOf(SOME x) = x
28          | valOf NONE = raise Option
29        fun opnd dst = if dst = TEMP then valOf tmp else ea dst
30    
31      (* perform unconstrained moves *)      (* perform unconstrained moves *)
32      fun loop((p as (rd,rs))::rest, changed, used, done, instrs) =      fun loop((p as (rd,rs))::rest, changed, used, done, instrs) =
# Line 42  Line 44 
44             | (false, (rd,rs)::acc, instrs) => let             | (false, (rd,rs)::acc, instrs) => let
45                 fun rename(p as (a,b)) = if equal(rd, b) then (a, TEMP) else p                 fun rename(p as (a,b)) = if equal(rd, b) then (a, TEMP) else p
46                 val acc' = (rd, rs) :: map rename acc                 val acc' = (rd, rs) :: map rename acc
47                 val instrs' = mv{dst=Option.valOf tmp,src=opnd rd,instrs=instrs}                 val instrs' = mv{dst=valOf tmp,src=opnd rd,instrs=instrs}
48                 val (_, acc'', instrs'') =                 val (_, acc'', instrs'') =
49                   loop(acc', false, map #2 acc', [], instrs')                   loop(acc', false, map #2 acc', [], instrs')
50               in cycle(acc'', instrs'')               in cycle(acc'', instrs'')

Legend:
Removed from v.640  
changed lines
  Added in v.641

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