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

Diff of /sml/trunk/src/MLRISC/x86/instructions/x86Peephole.sml

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

revision 645, Mon May 15 07:17:30 2000 UTC revision 646, Tue May 16 02:52:54 2000 UTC
# Line 7  Line 7 
7     let fun isStackPtr(I.Direct r) = regmap r = 4     let fun isStackPtr(I.Direct r) = regmap r = 4
8           | isStackPtr _ = false           | isStackPtr _ = false
9    
10           fun isZero(I.Immed n) = n = 0
11             | isZero(I.ImmedLabel le) = I.LabelExp.valueOf le = 0
12             | isZero _ = false
13    
14         fun loop(code, instrs) =         fun loop(code, instrs) =
15             (case code of             (case code of
16               [] => rev instrs               [] => rev instrs
# Line 48  Line 52 
52               rest => if isStackPtr dst then loop(rest, j::i::instrs)               rest => if isStackPtr dst then loop(rest, j::i::instrs)
53                       else loop(rest, I.POP dst::instrs)                       else loop(rest, I.POP dst::instrs)
54    
55               | (i as I.MOVE{mvOp=I.MOVL, src, dst as I.Direct _})::rest =>
56                 if isZero src then
57                    loop(rest, I.BINARY{binOp=I.XORL, src=dst, dst=dst}::instrs)
58                 else
59                    loop(rest, i::instrs)
60    
61             | i::rest => loop(rest, i::instrs)             | i::rest => loop(rest, i::instrs)
62             )             )
63     in  loop(instrs, [])     in  loop(instrs, [])

Legend:
Removed from v.645  
changed lines
  Added in v.646

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