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

Diff of /sml/trunk/src/MLRISC/sparc/instructions/sparcPeephole.sml

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

revision 1084, Thu Feb 21 18:52:44 2002 UTC revision 1085, Fri Feb 22 00:15:55 2002 UTC
# Line 26  Line 26 
26     fun peephole instrs =     fun peephole instrs =
27         let         let
28  (*#line 21.8 "sparcPeephole.peep"*)  (*#line 21.8 "sparcPeephole.peep"*)
29             fun isZero (I.LAB le) = ((Eval.valueOf le) = 0)handle _ => false             fun isZero (I.LAB le) = (((Eval.valueOf le) = 0) handle _ => false
30    )
31               | isZero (I.REG r) = (CB.registerNum r) = 0               | isZero (I.REG r) = (CB.registerNum r) = 0
32               | isZero (I.IMMED i) = i = 0               | isZero (I.IMMED i) = i = 0
33               | isZero _ = false               | isZero _ = false
# Line 74  Line 74 
74    
75  (*#line 31.8 "sparcPeephole.peep"*)  (*#line 31.8 "sparcPeephole.peep"*)
76             fun loop (current, instrs) =             fun loop (current, instrs) =
77                 let val v_3 = current                 let val v_13 = current
78                 in                 in
79                    (case v_3 of                    (case v_13 of
80                      op :: v_2 =>                      op :: v_12 =>
81                      let val (v_1, v_0) = v_2                      let val (v_11, v_10) = v_12
82                      in                      in
83                         let val i = v_1                         let val i = v_11
84                             and rest = v_0                             and rest = v_10
85                         in (if (removable i)                         in (if (removable i)
86                               then (loop (rest, instrs))                               then (loop (rest, instrs))
87                               else                               else
88                               let val i = v_1                               let val i = v_11
89                                   and rest = v_0                                   and rest = v_10
90                               in loop (rest, i :: instrs)                               in loop (rest, i :: instrs)
91                               end)                               end)
92                         end                         end

Legend:
Removed from v.1084  
changed lines
  Added in v.1085

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