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

SCM Repository

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

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

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

revision 3765, Mon Apr 18 16:13:13 2016 UTC revision 3766, Mon Apr 18 16:13:31 2016 UTC
# Line 67  Line 67 
67              | Op.RMul => (Ty.realTy, [Ty.realTy, Ty.realTy])              | Op.RMul => (Ty.realTy, [Ty.realTy, Ty.realTy])
68              | Op.RDiv => (Ty.realTy, [Ty.realTy, Ty.realTy])              | Op.RDiv => (Ty.realTy, [Ty.realTy, Ty.realTy])
69              | Op.RNeg => (Ty.realTy, [Ty.realTy])              | Op.RNeg => (Ty.realTy, [Ty.realTy])
             | Op.RClamp => (Ty.realTy, [Ty.realTy, Ty.realTy, Ty.realTy])  
             | Op.RLerp => (Ty.realTy, [Ty.realTy, Ty.realTy, Ty.realTy])  
             | Op.VAdd d => (Ty.VecTy d, [Ty.VecTy d, Ty.VecTy d])  
             | Op.VSub d => (Ty.VecTy d, [Ty.VecTy d, Ty.VecTy d])  
             | Op.VScale d => (Ty.VecTy d, [Ty.realTy, Ty.VecTy d])  
             | Op.VMul d => (Ty.VecTy d, [Ty.VecTy d, Ty.VecTy d])  
             | Op.VNeg d => (Ty.VecTy d, [Ty.VecTy d])  
 (*  
 | Op.VSum of shape * int  
 | Op.VClamp of int  
 | Op.VLerp of int  
 *)  
70              | Op.LT ty => (Ty.BoolTy, [ty, ty])              | Op.LT ty => (Ty.BoolTy, [ty, ty])
71              | Op.LTE ty => (Ty.BoolTy, [ty, ty])              | Op.LTE ty => (Ty.BoolTy, [ty, ty])
72              | Op.EQ ty => (Ty.BoolTy, [ty, ty])              | Op.EQ ty => (Ty.BoolTy, [ty, ty])
# Line 89  Line 77 
77              | Op.Abs ty => (ty, [ty])              | Op.Abs ty => (ty, [ty])
78              | Op.Max ty => (ty, [ty, ty])              | Op.Max ty => (ty, [ty, ty])
79              | Op.Min ty => (ty, [ty, ty])              | Op.Min ty => (ty, [ty, ty])
80                | Op.Clamp ty => (ty, [Ty.realTy, Ty.realTy, ty])
81                | Op.Lerp ty => (ty, [ty, ty, Ty.realTy])
82                | Op.VAdd d => (Ty.VecTy d, [Ty.VecTy d, Ty.VecTy d])
83                | Op.VSub d => (Ty.VecTy d, [Ty.VecTy d, Ty.VecTy d])
84                | Op.VScale d => (Ty.VecTy d, [Ty.realTy, Ty.VecTy d])
85                | Op.VMul d => (Ty.VecTy d, [Ty.VecTy d, Ty.VecTy d])
86                | Op.VNeg d => (Ty.VecTy d, [Ty.VecTy d])
87                | Op.VSum d => (Ty.realTy, [Ty.VecTy d])
88    (*
89    TensorIndex
90    *)
91              | Op.EigenVecs2x2 => eigenSig 2              | Op.EigenVecs2x2 => eigenSig 2
92              | Op.EigenVecs3x3 => eigenSig 3              | Op.EigenVecs3x3 => eigenSig 3
93              | Op.EigenVals2x2 => (Ty.SeqTy(Ty.realTy, SOME 2), [Ty.TensorTy[2,2]])              | Op.EigenVals2x2 => (Ty.SeqTy(Ty.realTy, SOME 2), [Ty.TensorTy[2,2]])
94              | Op.EigenVals3x3 => (Ty.SeqTy(Ty.realTy, SOME 3), [Ty.TensorTy[3,3]])              | Op.EigenVals3x3 => (Ty.SeqTy(Ty.realTy, SOME 3), [Ty.TensorTy[3,3]])
95              | Op.Zero ty => (ty, [])              | Op.Zero ty => (ty, [])
96              | Op.Select(ty as Ty.TupleTy tys, i) => (List.nth(tys, i-1), [ty])              | Op.Select(ty as Ty.TupleTy tys, i) => (List.nth(tys, i-1), [ty])
             | Op.Index(ty as Ty.TensorTy[d], _) => (Ty.realTy, [ty])  
97              | Op.Subscript(ty as Ty.SeqTy(elemTy, _)) => (elemTy, [ty, Ty.intTy])              | Op.Subscript(ty as Ty.SeqTy(elemTy, _)) => (elemTy, [ty, Ty.intTy])
98              | 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)])
99              | Op.Prepend ty => (Ty.SeqTy(ty, NONE), [ty, Ty.SeqTy(ty, NONE)])              | Op.Prepend ty => (Ty.SeqTy(ty, NONE), [ty, Ty.SeqTy(ty, NONE)])
# Line 118  Line 116 
116              | Op.Trunc d => (Ty.vecTy d, [Ty.vecTy d])              | Op.Trunc d => (Ty.vecTy d, [Ty.vecTy d])
117              | Op.IntToReal => (Ty.realTy, [Ty.intTy])              | Op.IntToReal => (Ty.realTy, [Ty.intTy])
118              | Op.RealToInt 1 => (Ty.IntTy, [Ty.realTy])              | Op.RealToInt 1 => (Ty.IntTy, [Ty.realTy])
119              | Op.RealToInt d => (Ty.SeqTy(Ty.IntTy, SOME d), [Ty.TensorTy[d]])              | Op.RealToInt d => (Ty.SeqTy(Ty.IntTy, SOME d), [Ty.VecTy d])
120  (* not sure if we will need these  (* not sure if we will need these
121        | R_All of ty        | R_All of ty
122        | R_Exists of ty        | R_Exists of ty
# Line 129  Line 127 
127        | R_Mean of ty        | R_Mean of ty
128        | R_Variance of ty        | R_Variance of ty
129  *)  *)
130    (* FIXME: these should probably be compiled down to lower-level operartions at this point!
131              | Op.Transform info => let              | Op.Transform info => let
132                  val dim = ImageInfo.dim info                  val dim = ImageInfo.dim info
133                  in                  in
134                    if (dim = 1)                    if (dim = 1)
135                      then (Ty.TensorTy[], [Ty.ImageTy info])                      then (Ty.realTy, [Ty.ImageTy info])
136                      else (Ty.TensorTy[dim, dim], [Ty.ImageTy info])                      else (Ty.matrixTy(dim, dim), [Ty.ImageTy info])
137                  end                  end
138              | Op.Translate info => let              | Op.Translate info => let
139                  val dim = ImageInfo.dim info                  val dim = ImageInfo.dim info
140                  in                  in
141                    if (dim = 1)                    if (dim = 1)
142                      then (Ty.TensorTy[], [Ty.ImageTy info])                      then (Ty.realTy, [Ty.ImageTy info])
143                      else (Ty.TensorTy[dim], [Ty.ImageTy info])                      else (Ty.matrixTy(dim, dim), [Ty.ImageTy info])
144                  end                  end
 (*  
             | Op.ControlIndex(info, ctl, ?) =>  
145  *)  *)
146                | Op.ControlIndex(info, _, _) => (Ty.IntTy, [Ty.ImageTy info, Ty.IntTy])
147              | Op.Inside(info, _) => (Ty.BoolTy, [Ty.vecTy(ImageInfo.dim info), Ty.ImageTy info])              | Op.Inside(info, _) => (Ty.BoolTy, [Ty.vecTy(ImageInfo.dim info), Ty.ImageTy info])
148              | Op.ImageDim(info, _) => (Ty.IntTy, [Ty.ImageTy info])              | Op.ImageDim(info, _) => (Ty.IntTy, [Ty.ImageTy info])
149              | Op.LoadSeq(ty, _) => (ty, [])              | Op.LoadSeq(ty, _) => (ty, [])

Legend:
Removed from v.3765  
changed lines
  Added in v.3766

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