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

SCM Repository

[diderot] Diff of /branches/vis15/src/compiler/high-ir/check-high.sml
ViewVC logotype

Diff of /branches/vis15/src/compiler/high-ir/check-high.sml

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

revision 3506, Fri Dec 18 04:03:54 2015 UTC revision 3508, Fri Dec 18 14:19:30 2015 UTC
# Line 48  Line 48 
48              | Op.PrincipleEvec(resTy as Ty.TensorTy[d]) => (resTy, [Ty.TensorTy[d,d]])              | Op.PrincipleEvec(resTy as Ty.TensorTy[d]) => (resTy, [Ty.TensorTy[d,d]])
49              | Op.Eigen2x2 => eigenSig 2              | Op.Eigen2x2 => eigenSig 2
50              | Op.Eigen3x3 => eigenSig 3              | Op.Eigen3x3 => eigenSig 3
51              | Op.Slice(ty as Ty.TensorTy dd, m) => let              | Op.Zero ty => (ty, [])
52                | Op.TensorSlice(ty as Ty.TensorTy dd, m) => let
53                  val (resDims, idxDims) = let                  val (resDims, idxDims) = let
54                        fun f (d, false, (rds, ids)) = (d::rds, ids)                        fun f (d, false, (rds, ids)) = (d::rds, ids)
55                          | f (_, true, (rds, ids)) = (rds, Ty.IntTy::ids)                          | f (_, true, (rds, ids)) = (rds, Ty.IntTy::ids)
# Line 58  Line 59 
59                  in                  in
60                    (Ty.TensorTy resDims, ty::idxDims)                    (Ty.TensorTy resDims, ty::idxDims)
61                  end                  end
62              | Op.TensorSub(ty as Ty.TensorTy dd) =>              | Op.TensorIndex(ty as Ty.TensorTy dd) =>
63                  (Ty.realTy, ty :: List.map (fn _ => Ty.IntTy) dd)                  (Ty.realTy, ty :: List.map (fn _ => Ty.IntTy) dd)
64              | Op.Select(ty as Ty.TupleTy tys, i) =>              | Op.Select(ty as Ty.TupleTy tys, i) =>
65                  if (1 <= i) andalso (i <= length tys)                  if (1 <= i) andalso (i <= length tys)
66                    then (List.nth(tys, i-1), [ty])                    then (List.nth(tys, i-1), [ty])
67                    else raise Fail("sigOf: invalid operator " ^ Op.toString rator)                    else raise Fail("sigOf: invalid operator " ^ Op.toString rator)
68              | Op.SeqSub(ty as Ty.SeqTy(elemTy, _)) => (elemTy, [ty, Ty.IntTy])              | Op.Subscript(ty as Ty.SeqTy(elemTy, _)) => (elemTy, [ty, Ty.IntTy])
69              | Op.MkDynamic(ty, n) => (Ty.SeqTy(ty, NONE), [Ty.SeqTy(ty, SOME n)])              | Op.MkDynamic(ty, n) => (Ty.SeqTy(ty, NONE), [Ty.SeqTy(ty, SOME n)])
70              | Op.Prepend ty => (Ty.SeqTy(ty, NONE), [ty, Ty.SeqTy(ty, NONE)])              | Op.Prepend ty => (Ty.SeqTy(ty, NONE), [ty, Ty.SeqTy(ty, NONE)])
71              | Op.Append ty => (Ty.SeqTy(ty, NONE), [Ty.SeqTy(ty, NONE), ty])              | Op.Append ty => (Ty.SeqTy(ty, NONE), [Ty.SeqTy(ty, NONE), ty])
72              | Op.Concat ty => (Ty.SeqTy(ty, NONE), [Ty.SeqTy(ty, NONE), Ty.SeqTy(ty, NONE)])              | Op.Concat ty => (Ty.SeqTy(ty, NONE), [Ty.SeqTy(ty, NONE), Ty.SeqTy(ty, NONE)])
73                | Op.Range => (Ty.SeqTy(Ty.intTy, NONE), [Ty.IntTy, Ty.IntTy])
74              | Op.Length ty => (Ty.intTy, [Ty.SeqTy(ty, NONE)])              | Op.Length ty => (Ty.intTy, [Ty.SeqTy(ty, NONE)])
75                | Op.SphereQuery(ptTy, strandTy) => (Ty.SeqTy(strandTy, NONE), [ptTy, Ty.realTy])
76              | Op.IntToReal => (Ty.realTy, [Ty.IntTy])              | Op.IntToReal => (Ty.realTy, [Ty.IntTy])
77              | Op.TruncToInt => (Ty.IntTy, [Ty.realTy])              | Op.TruncToInt => (Ty.IntTy, [Ty.realTy])
78              | Op.RoundToInt => (Ty.IntTy, [Ty.realTy])              | Op.RoundToInt => (Ty.IntTy, [Ty.realTy])
79              | Op.CeilToInt => (Ty.IntTy, [Ty.realTy])              | Op.CeilToInt => (Ty.IntTy, [Ty.realTy])
80              | Op.FloorToInt => (Ty.IntTy, [Ty.realTy])              | Op.FloorToInt => (Ty.IntTy, [Ty.realTy])
81    (* not sure if we will need these
82          | R_All of ty
83          | R_Exists of ty
84          | R_Max of ty
85          | R_Min of ty
86          | R_Sum of ty
87          | R_Product of ty
88          | R_Mean of ty
89          | R_Variance of ty
90    *)
91              | Op.Kernel _ => (Ty.KernelTy, [])              | Op.Kernel _ => (Ty.KernelTy, [])
92              | Op.Inside dim => (Ty.BoolTy, [Ty.vecTy dim, Ty.FieldTy])              | Op.Inside dim => (Ty.BoolTy, [Ty.vecTy dim, Ty.FieldTy])
 (* ??  
             | Op.ProbeWithCtl(domTy, rngTy) => (rngTy, [Ty.FieldTy, domTy])  
 *)  
93              | Op.ImageDim(info, _) => (Ty.IntTy, [Ty.ImageTy info])              | Op.ImageDim(info, _) => (Ty.IntTy, [Ty.ImageTy info])
94              | Op.BorderCtlDefault info =>              | Op.BorderCtlDefault info =>
95                  (Ty.ImageTy info, [Ty.ImageTy info, Ty.TensorTy(ImageInfo.voxelShape info)])                  (Ty.ImageTy info, [Ty.ImageTy info, Ty.TensorTy(ImageInfo.voxelShape info)])

Legend:
Removed from v.3506  
changed lines
  Added in v.3508

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