Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /branches/pure-cfg/src/compiler/high-to-mid/high-to-mid.sml
ViewVC logotype

Diff of /branches/pure-cfg/src/compiler/high-to-mid/high-to-mid.sml

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

revision 564, Wed Feb 23 22:34:31 2011 UTC revision 565, Thu Feb 24 18:34:48 2011 UTC
# Line 98  Line 98 
98      fun expandOp (env, y, rator, args) = let      fun expandOp (env, y, rator, args) = let
99            fun assign rator' =            fun assign rator' =
100                  [(y, DstIL.OP(rator', renameList(env, args)))]                  [(y, DstIL.OP(rator', renameList(env, args)))]
101              fun cvtToInt rator' = let
102                    val t = DstIL.Var.new ("t", DstTy.realTy)
103                    in [
104                      (t, DstIL.OP(rator', renameList(env, args))),
105                      (y, DstIL.OP(DstOp.RealToInt 1, [t]))
106                    ] end
107            fun dummy () = [(y, DstIL.LIT(Literal.Int 0))]            fun dummy () = [(y, DstIL.LIT(Literal.Int 0))]
108            in            in
109              case rator              case rator
# Line 127  Line 133 
133                | SrcOp.Pow => assign DstOp.Pow                | SrcOp.Pow => assign DstOp.Pow
134                | SrcOp.Not => assign DstOp.Not                | SrcOp.Not => assign DstOp.Not
135                | SrcOp.IntToReal => assign DstOp.IntToReal                | SrcOp.IntToReal => assign DstOp.IntToReal
136                | SrcOp.TruncToInt => assign (DstOp.TruncToInt 1)                | SrcOp.CeilToInt => cvtToInt (DstOp.Ceiling 1)
137                | SrcOp.RoundToInt => assign (DstOp.RoundToInt 1)                | SrcOp.FloorToInt => cvtToInt (DstOp.Floor 1)
138                | SrcOp.CeilToInt => assign (DstOp.CeilToInt 1)                | SrcOp.RoundToInt => cvtToInt (DstOp.Round 1)
139                | SrcOp.FloorToInt => assign (DstOp.FloorToInt 1)                | SrcOp.TruncToInt => cvtToInt (DstOp.Trunc 1)
140                | SrcOp.Kernel _ => dummy()                | SrcOp.Kernel _ => dummy()
141                | SrcOp.LoadImage info => assign (DstOp.LoadImage info)                | SrcOp.LoadImage info => assign (DstOp.LoadImage info)
142                | SrcOp.Inside _ => (case args                | SrcOp.Inside _ => (case args

Legend:
Removed from v.564  
changed lines
  Added in v.565

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