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

SCM Repository

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

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

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

revision 3804, Tue May 3 18:03:41 2016 UTC revision 3937, Mon Jun 6 13:16:10 2016 UTC
# Line 39  Line 39 
39              | Op.RMul => (Ty.realTy, [Ty.realTy, Ty.realTy])              | Op.RMul => (Ty.realTy, [Ty.realTy, Ty.realTy])
40              | Op.RDiv => (Ty.realTy, [Ty.realTy, Ty.realTy])              | Op.RDiv => (Ty.realTy, [Ty.realTy, Ty.realTy])
41              | Op.RNeg => (Ty.realTy, [Ty.realTy])              | Op.RNeg => (Ty.realTy, [Ty.realTy])
42                | Op.RClamp => (Ty.realTy, [Ty.realTy, Ty.realTy, Ty.realTy])
43                | Op.RLerp => (Ty.realTy, [Ty.realTy, Ty.realTy, Ty.realTy])
44              | Op.VAdd d => (Ty.vecTy d, [Ty.vecTy d, Ty.vecTy d])              | Op.VAdd d => (Ty.vecTy d, [Ty.vecTy d, Ty.vecTy d])
45              | Op.VSub d => (Ty.vecTy d, [Ty.vecTy d, Ty.vecTy d])              | Op.VSub d => (Ty.vecTy d, [Ty.vecTy d, Ty.vecTy d])
46              | Op.VScale d => (Ty.vecTy d, [Ty.realTy, Ty.vecTy d])              | Op.VScale d => (Ty.vecTy d, [Ty.realTy, Ty.vecTy d])
47              | Op.VMul d => (Ty.vecTy d, [Ty.vecTy d, Ty.vecTy d])              | Op.VMul d => (Ty.vecTy d, [Ty.vecTy d, Ty.vecTy d])
48              | Op.VNeg d => (Ty.vecTy d, [Ty.vecTy d])              | Op.VNeg d => (Ty.vecTy d, [Ty.vecTy d])
49              | Op.VSum d => (Ty.realTy, [Ty.vecTy d])              | Op.VSum d => (Ty.realTy, [Ty.vecTy d])
50              | Op.VProj(d, i) => (Ty.realTy, [Ty.vecTy d])              | Op.VIndex(d, i) => (Ty.realTy, [Ty.vecTy d])
51              | Op.TensorIndex(ty, _) => (Ty.realTy, [ty])              | Op.VClamp d => (Ty.vecTy d, [Ty.vecTy d, Ty.realTy, Ty.realTy])
52              | Op.ProjectLast(ty as Ty.TensorTy dd, _) => (Ty.TensorTy[List.last dd], [ty])              | Op.VMapClamp d => (Ty.vecTy d, [Ty.vecTy d, Ty.vecTy d, Ty.vecTy d])
53                | Op.VLerp d => (Ty.vecTy d, [Ty.vecTy d, Ty.vecTy d, Ty.realTy])
54                | Op.TensorIndex(ty as Ty.TensorTy(_::_::_), _) => (Ty.realTy, [ty])
55                | Op.ProjectLast(ty as Ty.TensorTy(dd as _::_::_), _) => (Ty.TensorTy[List.last dd], [ty])
56              | Op.LT ty => (Ty.BoolTy, [ty, ty])              | Op.LT ty => (Ty.BoolTy, [ty, ty])
57              | Op.LTE ty => (Ty.BoolTy, [ty, ty])              | Op.LTE ty => (Ty.BoolTy, [ty, ty])
58              | Op.EQ ty => (Ty.BoolTy, [ty, ty])              | Op.EQ ty => (Ty.BoolTy, [ty, ty])
# Line 58  Line 63 
63              | Op.Abs ty => (ty, [ty])              | Op.Abs ty => (ty, [ty])
64              | Op.Max ty => (ty, [ty, ty])              | Op.Max ty => (ty, [ty, ty])
65              | Op.Min ty => (ty, [ty, ty])              | Op.Min ty => (ty, [ty, ty])
             | Op.Clamp ty => (ty, [ty, ty, ty])  
             | Op.Lerp ty => (ty, [ty, ty, Ty.realTy])  
66              | Op.EigenVecs2x2 => eigenSig 2              | Op.EigenVecs2x2 => eigenSig 2
67              | Op.EigenVecs3x3 => eigenSig 3              | Op.EigenVecs3x3 => eigenSig 3
68              | Op.EigenVals2x2 => (Ty.SeqTy(Ty.realTy, SOME 2), [Ty.TensorTy[2,2]])              | Op.EigenVals2x2 => (Ty.SeqTy(Ty.realTy, SOME 2), [Ty.TensorTy[2,2]])
# Line 74  Line 77 
77              | Op.Range => (Ty.SeqTy(Ty.intTy, NONE), [Ty.IntTy, Ty.IntTy])              | Op.Range => (Ty.SeqTy(Ty.intTy, NONE), [Ty.IntTy, Ty.IntTy])
78              | Op.Length ty => (Ty.intTy, [Ty.SeqTy(ty, NONE)])              | Op.Length ty => (Ty.intTy, [Ty.SeqTy(ty, NONE)])
79              | Op.SphereQuery(ptTy, strandTy) => (Ty.SeqTy(strandTy, NONE), [ptTy, Ty.realTy])              | Op.SphereQuery(ptTy, strandTy) => (Ty.SeqTy(strandTy, NONE), [ptTy, Ty.realTy])
80                | Op.Sqrt => (Ty.realTy, [Ty.realTy])
81                | Op.Cos => (Ty.realTy, [Ty.realTy])
82                | Op.ArcCos => (Ty.realTy, [Ty.realTy])
83                | Op.Sin => (Ty.realTy, [Ty.realTy])
84                | Op.ArcSin => (Ty.realTy, [Ty.realTy])
85                | Op.Tan => (Ty.realTy, [Ty.realTy])
86                | Op.ArcTan => (Ty.realTy, [Ty.realTy])
87              | Op.Ceiling d => (Ty.vecTy d, [Ty.vecTy d])              | Op.Ceiling d => (Ty.vecTy d, [Ty.vecTy d])
88              | Op.Floor d => (Ty.vecTy d, [Ty.vecTy d])              | Op.Floor d => (Ty.vecTy d, [Ty.vecTy d])
89              | Op.Round d => (Ty.vecTy d, [Ty.vecTy d])              | Op.Round d => (Ty.vecTy d, [Ty.vecTy d])
# Line 81  Line 91 
91              | Op.IntToReal => (Ty.realTy, [Ty.intTy])              | Op.IntToReal => (Ty.realTy, [Ty.intTy])
92              | Op.RealToInt 1 => (Ty.IntTy, [Ty.realTy])              | Op.RealToInt 1 => (Ty.IntTy, [Ty.realTy])
93              | Op.RealToInt d => (Ty.SeqTy(Ty.IntTy, SOME d), [Ty.TensorTy[d]])              | Op.RealToInt d => (Ty.SeqTy(Ty.IntTy, SOME d), [Ty.TensorTy[d]])
 (* FIXME: the type of RealToInt should be  
             | Op.RealToInt d => (Ty.SeqTy(Ty.IntTy, d), [Ty.SeqTy(Ty.realTy, d)])  
 *)  
94  (* not sure if we will need these  (* not sure if we will need these
95        | R_All of ty        | R_All of ty
96        | R_Exists of ty        | R_Exists of ty
# Line 109  Line 116 
116                  else (Ty.TensorTy[dim], [Ty.ImageTy info])                  else (Ty.TensorTy[dim], [Ty.ImageTy info])
117                      end                      end
118              | Op.ControlIndex(info, _, _) => (Ty.intTy, [Ty.ImageTy info, Ty.IntTy])              | Op.ControlIndex(info, _, _) => (Ty.intTy, [Ty.ImageTy info, Ty.IntTy])
119              | Op.LoadVoxel(info) => (Ty.realTy, [Ty.ImageTy info, Ty.IntTy])              | Op.LoadVoxel info => (Ty.realTy, [Ty.ImageTy info, Ty.IntTy])
120              | Op.Inside(info, _) => let              | Op.Inside(info, _) => let
121                  val idxTy = (case ImageInfo.dim info                  val idxTy = (case ImageInfo.dim info
122                         of 1 => Ty.IntTy                         of 1 => Ty.IntTy
# Line 137  Line 144 
144            List.all (fn ty' => Ty.same(ty, ty')) tys andalso (List.length tys = n)            List.all (fn ty' => Ty.same(ty, ty')) tys andalso (List.length tys = n)
145        | typeOfSeq _ = false        | typeOfSeq _ = false
146    
147        fun isStrandTy (Ty.StrandTy _) = true
148          | isStrandTy _ = false
149    
150        fun isBoolTy Ty.BoolTy = true
151          | isBoolTy _ = false
152    
153    end    end
154    
155  structure CheckLow = CheckIRFn (  structure CheckLow = CheckIRFn (

Legend:
Removed from v.3804  
changed lines
  Added in v.3937

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