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 1008, Fri Dec 14 21:01:29 2001 UTC revision 1009, Wed Jan 9 19:44:22 2002 UTC
# Line 31  Line 31 
31    fun shuffle{mvInstr, ea} {tmp, dst, src} = let    fun shuffle{mvInstr, ea} {tmp, dst, src} = let
32      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)
33    
     fun valOf(SOME x) = x  
       | valOf NONE = raise Option  
   
34      fun opnd dst = case dst of      fun opnd dst = case dst of
35                       TEMP     => valOf tmp                       TEMP     => Option.valOf tmp
36                     | CELL dst => ea dst                     | CELL dst => ea dst
37    
38      (* perform unconstrained moves *)      (* perform unconstrained moves *)
# Line 55  Line 52 
52                 fun rename(p as (a,b)) =                 fun rename(p as (a,b)) =
53                     if equalObj(rd, b) then (a, TEMP) else p                     if equalObj(rd, b) then (a, TEMP) else p
54                 val acc' = (rd, rs) :: map rename acc                 val acc' = (rd, rs) :: map rename acc
55                 val instrs' = mv{dst=valOf tmp,src=opnd rd,instrs=instrs}                 val instrs' = mv{dst=Option.valOf tmp, src=opnd rd, instrs=instrs}
56                 val (_, acc'', instrs'') =                 val (_, acc'', instrs'') =
57                   loop(acc', false, map #2 acc', [], instrs')                   loop(acc', false, map #2 acc', [], instrs')
58               in cycle(acc'', instrs'')               in cycle(acc'', instrs'')

Legend:
Removed from v.1008  
changed lines
  Added in v.1009

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