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

SCM Repository

[diderot] Diff of /branches/vis12/src/compiler/translate/translate.sml
ViewVC logotype

Diff of /branches/vis12/src/compiler/translate/translate.sml

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

revision 2026, Thu Oct 11 00:26:15 2012 UTC revision 2027, Thu Oct 11 10:40:12 2012 UTC
# Line 202  Line 202 
202                  val indices = List.mapPartial cvt indices                  val indices = List.mapPartial cvt indices
203                  in                  in
204                    if List.all (fn b => b) mask                    if List.all (fn b => b) mask
205                      then [IL.ASSGN(lhs, IL.OP(HighOps.TensorSub(IL.Var.ty x), x::indices))]                      then [IL.ASSGN(lhs, IL.OP(Op.TensorSub(IL.Var.ty x), x::indices))]
206                      else [IL.ASSGN(lhs, IL.OP(HighOps.Slice(IL.Var.ty lhs, mask), x::indices))]                      else [IL.ASSGN(lhs, IL.OP(Op.Slice(IL.Var.ty lhs, mask), x::indices))]
207                  end                  end
208  (* DEPRECATED  (* DEPRECATED
209              | S.E_Input(_, name, desc, NONE) =>              | S.E_Input(_, name, desc, NONE) =>
210                  [IL.ASSGN(lhs, IL.OP(HighOps.Input(IL.Var.ty lhs, name, desc), []))]                  [IL.ASSGN(lhs, IL.OP(Op.Input(IL.Var.ty lhs, name, desc), []))]
211              | S.E_Input(_, name, desc, SOME dflt) =>              | S.E_Input(_, name, desc, SOME dflt) =>
212                  [IL.ASSGN(lhs, IL.OP(HighOps.InputWithDefault(IL.Var.ty lhs, name, desc), [lookup env dflt]))]                  [IL.ASSGN(lhs, IL.OP(Op.InputWithDefault(IL.Var.ty lhs, name, desc), [lookup env dflt]))]
213  *)  *)
214              | S.E_Coerce{srcTy, dstTy, x} => (case (srcTy, dstTy)              | S.E_Coerce{srcTy, dstTy, x} => (case (srcTy, dstTy)
215                   of (Ty.T_Int, Ty.T_Tensor _) =>                   of (Ty.T_Int, Ty.T_Tensor _) =>
216                        [IL.ASSGN(lhs, IL.OP(HighOps.IntToReal, [lookup env x]))]                        [IL.ASSGN(lhs, IL.OP(Op.IntToReal, [lookup env x]))]
217                    | (Ty.T_Sequence(ty, Ty.DimConst n), Ty.T_DynSequence _) =>                    | (Ty.T_Sequence(ty, Ty.DimConst n), Ty.T_DynSequence _) =>
218                        [IL.ASSGN(lhs, IL.OP(HighOps.MkDynamic(cvtTy ty, n), [lookup env x]))]                        [IL.ASSGN(lhs, IL.OP(Op.MkDynamic(cvtTy ty, n), [lookup env x]))]
219                    | (Ty.T_Field _, Ty.T_Field _) =>                    | (Ty.T_Field _, Ty.T_Field _) =>
220                      (* change in continuity is a no-op *)                      (* change in continuity is a no-op *)
221                        [IL.ASSGN(lhs, IL.VAR(lookup env x))]                        [IL.ASSGN(lhs, IL.VAR(lookup env x))]
222                    | _ => raise Fail "unsupported type coercion"                    | _ => raise Fail "unsupported type coercion"
223                  (* end case *))                  (* end case *))
224              | S.E_LoadSeq(ty, nrrd) => raise Fail "FIXME"              | S.E_LoadSeq(ty, nrrd) => [IL.ASSGN(lhs, IL.OP(Op.LoadSeq(cvtTy ty, nrrd), []))]
225              | S.E_LoadImage(ty, nrrd, info) => raise Fail "FIXME"              | S.E_LoadImage(ty, nrrd, info) => [IL.ASSGN(lhs, IL.OP(Op.LoadImage(cvtTy ty, nrrd, info), []))]
226            (* end case *))            (* end case *))
227    
228    (* add nodes to save the strand state, followed by an exit node *)    (* add nodes to save the strand state, followed by an exit node *)

Legend:
Removed from v.2026  
changed lines
  Added in v.2027

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