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 4050, Sun Jun 26 21:48:29 2016 UTC revision 4051, Sun Jun 26 22:33:17 2016 UTC
# Line 24  Line 24 
24              (tplTy, [Ty.TensorTy[dim, dim]])              (tplTy, [Ty.TensorTy[dim, dim]])
25            end            end
26    
27        fun chkIndex (idx, bnd) = ((0 <= idx) andalso (idx < bnd))
28    
29    (* Return the signature of a HighIL operator. *)    (* Return the signature of a HighIL operator. *)
30      fun sigOf rator = (case rator      fun sigOf rator = (case rator
31             of Op.IAdd => (Ty.IntTy, [Ty.IntTy, Ty.IntTy])             of Op.IAdd => (Ty.IntTy, [Ty.IntTy, Ty.IntTy])
# Line 49  Line 51 
51              | Op.Eigen2x2 => eigenSig 2              | Op.Eigen2x2 => eigenSig 2
52              | Op.Eigen3x3 => eigenSig 3              | Op.Eigen3x3 => eigenSig 3
53              | Op.Zero ty => (ty, [])              | Op.Zero ty => (ty, [])
54              | Op.TensorIndex(ty, _) => (Ty.realTy, [ty])              | Op.TensorIndex(ty as Ty.TensorTy shp, idxs) =>
55                    if ListPair.allEq chkIndex (idxs, shp)
56                      then (Ty.realTy, [ty])
57                      else raise Fail("sigOf: invalid index in operator " ^ Op.toString rator)
58              | Op.Select(ty as Ty.TupleTy tys, i) =>              | Op.Select(ty as Ty.TupleTy tys, i) =>
59                  if (1 <= i) andalso (i <= length tys)                  if (1 <= i) andalso (i <= length tys)
60                    then (List.nth(tys, i-1), [ty])                    then (List.nth(tys, i-1), [ty])

Legend:
Removed from v.4050  
changed lines
  Added in v.4051

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