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

SCM Repository

[diderot] Diff of /trunk/src/compiler/high-il/check-ops.sml
ViewVC logotype

Diff of /trunk/src/compiler/high-il/check-ops.sml

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

revision 406, Fri Oct 15 12:12:10 2010 UTC revision 407, Fri Oct 15 12:27:09 2010 UTC
# Line 2  Line 2 
2   *   *
3   * COPYRIGHT (c) 2010 The Diderot Project (http://diderot.cs.uchicago.edu)   * COPYRIGHT (c) 2010 The Diderot Project (http://diderot.cs.uchicago.edu)
4   * All rights reserved.   * All rights reserved.
5     *
6     * Return the signature of a HighIL operator.
7   *)   *)
8    
9  structure CheckOps : OPERATOR_TY = struct  structure CheckOps : OPERATOR_TY = struct
# Line 35  Line 37 
37              | Op.Norm => (Ty.realTy, [ty])              | Op.Norm => (Ty.realTy, [ty])
38              | Op.Scale ty => (ty, [Ty.realTy, ty])              | Op.Scale ty => (ty, [Ty.realTy, ty])
39              | Op.InvScale ty => (ty, [ty, Ty.realTy])              | Op.InvScale ty => (ty, [ty, Ty.realTy])
40              | Op.CL =>              | Op.CL => (Ty.realTy, [Ty.TensorTy[3, 3]])
41              | Op.PrincipleEvec ty => (Ty.realTy, [ty])              | Op.PrincipleEvec(resTy as Ty.TensorTy[d]) => (resTy, [Ty.TensorTy[d,d]])
42              | Op.Slice(ty as Ty.Tensor dd, m) => let              | Op.Slice(ty as Ty.TensorTy dd, m) => let
43                  val (resDims, idxDims) = let                  val (resDims, idxDims) = let
44                        fun f (d, false, (rds, ids)) = (d::rds, ids)                        fun f (d, false, (rds, ids)) = (d::rds, ids)
45                          | f (_, true, (rds, ids)) = (rds, Ty.IntTy::ids)                          | f (_, true, (rds, ids)) = (rds, Ty.IntTy::ids)
# Line 47  Line 49 
49                  in                  in
50                    (Ty.Tensor rds, ty::idxDims)                    (Ty.Tensor rds, ty::idxDims)
51                  end                  end
52              | Op.Subscript(ty as Ty.Tensor dd) =>              | Op.Subscript(ty as Ty.TensorTy dd) =>
53                  (Ty.realTy, ty :: List.map (fn _ => Ty.IntTy) dd)                  (Ty.realTy, ty :: List.map (fn _ => Ty.IntTy) dd)
54              | Op.IntToReal => (Ty.realTy, [Ty.IntTy])              | Op.IntToReal => (Ty.realTy, [Ty.IntTy])
55              | Op.TruncToInt => (Ty.IntTy, [Ty.realTy])              | Op.TruncToInt => (Ty.IntTy, [Ty.realTy])
# Line 56  Line 58 
58              | Op.FloorToInt => (Ty.IntTy, [Ty.realTy])              | Op.FloorToInt => (Ty.IntTy, [Ty.realTy])
59              | Op.Kernel _ => (Ty.KernelTy, [])              | Op.Kernel _ => (Ty.KernelTy, [])
60              | Op.LoadImage _ => (Ty.ImageTy, [])              | Op.LoadImage _ => (Ty.ImageTy, [])
61              | Op.Convolve =>              | Op.Convolve => (Ty.FieldTy, [Ty.ImageTy, Ty.KernelTy])
62              | Op.Inside =>  (* FIXME: need dimension of vector *)
63                | Op.Inside => (Ty.BoolTy, ??)
64              | Op.Field _ => (Ty.FieldTy, [])              | Op.Field _ => (Ty.FieldTy, [])
65              | Op.AddField =>  (Ty.FieldTy, [Ty.FieldTy, Ty.FieldTy])              | Op.AddField =>  (Ty.FieldTy, [Ty.FieldTy, Ty.FieldTy])
66              | Op.ScaleField => (Ty.FieldTy, [Ty.realTy, Ty.FieldTy])              | Op.ScaleField => (Ty.FieldTy, [Ty.realTy, Ty.FieldTy])
67              | Op.NegField => (Ty.FieldTy, [Ty.FieldTy])              | Op.NegField => (Ty.FieldTy, [Ty.FieldTy])
68              | Op.DiffField => (Ty.FieldTy, [Ty.FieldTy])              | Op.DiffField => (Ty.FieldTy, [Ty.FieldTy])
69    (* FIXME: need dimension of position vector and shape of range *)
70              | Op.Probe => ??              | Op.Probe => ??
71              | Op.Input of string              | Op.Input of string
72              | Op.InputWithDefault of string              | Op.InputWithDefault of string

Legend:
Removed from v.406  
changed lines
  Added in v.407

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