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

SCM Repository

[diderot] Diff of /branches/vis15/src/compiler/simplify/simplify.sml
ViewVC logotype

Diff of /branches/vis15/src/compiler/simplify/simplify.sml

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

revision 4207, Thu Jul 14 15:11:26 2016 UTC revision 4228, Mon Jul 18 22:07:47 2016 UTC
# Line 179  Line 179 
179            (* end case *))            (* end case *))
180    
181      and simplifyExp (errStrm, exp, stms) = let      and simplifyExp (errStrm, exp, stms) = let
182              fun doBorderCtl (f, args) = let
183                    val (ctl, arg) = if Var.same(BasisVars.image_border, f)
184                            then (BorderCtl.Default(hd args), hd(tl args))
185                          else if Var.same(BasisVars.image_clamp, f)
186                            then (BorderCtl.Clamp, hd args)
187                          else if Var.same(BasisVars.image_mirror, f)
188                            then (BorderCtl.Mirror, hd args)
189                          else if Var.same(BasisVars.image_wrap, f)
190                            then (BorderCtl.Wrap, hd args)
191                            else raise Fail "impossible"
192                    in
193                      S.E_BorderCtl(ctl, arg)
194                    end
195            fun doPrimApply (f, tyArgs, args, ty) = let            fun doPrimApply (f, tyArgs, args, ty) = let
196                  val (stms, xs) = simplifyExpsToVars (errStrm, args, stms)                  val (stms, xs) = simplifyExpsToVars (errStrm, args, stms)
197                  in                  in
198                    case Var.kindOf f                    if Basis.isBorderCtl f
199                        then (stms, doBorderCtl (f, xs))
200                        else (case Var.kindOf f
201                     of Var.BasisVar => let                     of Var.BasisVar => let
202                          fun cvtTyArg (Types.TYPE tv) = S.TY(cvtTy(TU.resolve tv))                          fun cvtTyArg (Types.TYPE tv) = S.TY(cvtTy(TU.resolve tv))
203                            | cvtTyArg (Types.DIFF dv) = S.DIFF(TU.monoDiff(TU.resolveDiff dv))                            | cvtTyArg (Types.DIFF dv) = S.DIFF(TU.monoDiff(TU.resolveDiff dv))
# Line 193  Line 208 
208                            (stms, S.E_Prim(f, tyArgs, xs, cvtTy ty))                            (stms, S.E_Prim(f, tyArgs, xs, cvtTy ty))
209                          end                          end
210                      | _ => raise Fail "bogus prim application"                      | _ => raise Fail "bogus prim application"
211                    (* end case *)                        (* end case *))
212                  end                  end
213            in            in
214              case exp              case exp

Legend:
Removed from v.4207  
changed lines
  Added in v.4228

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