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

SCM Repository

[diderot] Diff of /branches/pure-cfg/src/compiler/low-il/check-low-il.sml
ViewVC logotype

Diff of /branches/pure-cfg/src/compiler/low-il/check-low-il.sml

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

revision 1521, Mon Oct 10 14:19:33 2011 UTC revision 1522, Mon Oct 10 15:34:37 2011 UTC
# Line 40  Line 40 
40              | Op.MulMatVec(d1, d2) => (Ty.vecTy d1, [Ty.TensorTy[d1, d2], Ty.vecTy d2])              | Op.MulMatVec(d1, d2) => (Ty.vecTy d1, [Ty.TensorTy[d1, d2], Ty.vecTy d2])
41              | Op.MulMatMat(d1, d2, d3) => (Ty.TensorTy[d1, d3], [Ty.TensorTy[d1, d2], Ty.TensorTy[d2, d3]])              | Op.MulMatMat(d1, d2, d3) => (Ty.TensorTy[d1, d3], [Ty.TensorTy[d1, d2], Ty.TensorTy[d2, d3]])
42              | Op.Cross => (vec3Ty, [vec3Ty, vec3Ty])              | Op.Cross => (vec3Ty, [vec3Ty, vec3Ty])
43              | Op.Select(ty as Ty.IVecTy 1, _) => raise Fail("sigOf: invalid operator " ^ Op.toString rator)              | Op.Select(ty as Ty.SeqTy(elemTy, n), _) => (elemTy, [ty])
             | Op.Select(ty as Ty.IVecTy d, _) => (Ty.intTy, [ty])  
44              | Op.Select(ty as Ty.TensorTy[d], _) => (Ty.realTy, [ty])              | Op.Select(ty as Ty.TensorTy[d], _) => (Ty.realTy, [ty])
45              | Op.Norm(ty as Ty.TensorTy _) => (Ty.realTy, [ty])              | Op.Norm(ty as Ty.TensorTy _) => (Ty.realTy, [ty])
46              | Op.Normalize d => (Ty.vecTy d, [Ty.vecTy d])              | Op.Normalize d => (Ty.vecTy d, [Ty.vecTy d])
# Line 49  Line 48 
48              | Op.PrincipleEvec _ => raise Fail "Op.PrincipleEvec unimplemented"              | Op.PrincipleEvec _ => raise Fail "Op.PrincipleEvec unimplemented"
49              | Op.Identity d => (Ty.TensorTy[d,d], [])              | Op.Identity d => (Ty.TensorTy[d,d], [])
50              | Op.Zero ty => (ty, [])              | Op.Zero ty => (ty, [])
51              | Op.Subscript(Ty.IVecTy d) => (Ty.intTy, [Ty.IVecTy d, Ty.intTy])              | Op.Subscript(ty as Ty.SeqTy(elemTy, n)) => (elemTy, [ty, Ty.intTy])
52              | Op.Subscript(ty as Ty.TensorTy dd) => (Ty.realTy, ty :: List.map (fn _ => Ty.intTy) dd)              | Op.Subscript(ty as Ty.TensorTy dd) => (Ty.realTy, ty :: List.map (fn _ => Ty.intTy) dd)
53              | Op.Ceiling d => (Ty.vecTy d, [Ty.vecTy d])              | Op.Ceiling d => (Ty.vecTy d, [Ty.vecTy d])
54              | Op.Floor d => (Ty.vecTy d, [Ty.vecTy d])              | Op.Floor d => (Ty.vecTy d, [Ty.vecTy d])
55              | Op.Round d => (Ty.vecTy d, [Ty.vecTy d])              | Op.Round d => (Ty.vecTy d, [Ty.vecTy d])
56              | Op.Trunc d => (Ty.vecTy d, [Ty.vecTy d])              | Op.Trunc d => (Ty.vecTy d, [Ty.vecTy d])
57              | Op.IntToReal => (Ty.realTy, [Ty.intTy])              | Op.IntToReal => (Ty.realTy, [Ty.intTy])
58              | Op.RealToInt d => (Ty.IVecTy d, [Ty.vecTy d])              | Op.RealToInt d => (Ty.SeqTy(Ty.IntTy, d), [Ty.TensorTy[d]])
59    (* FIXME: the type of RealToInt should be
60                | Op.RealToInt d => (Ty.SeqTy(Ty.IntTy, d), [Ty.SeqTy(Ty.realTy, d)])
61    *)
62              | Op.ImageAddress info => (Ty.AddrTy info, [Ty.ImageTy info])              | Op.ImageAddress info => (Ty.AddrTy info, [Ty.ImageTy info])
63              | Op.LoadVoxels(info, n) => (Ty.vecTy n, [Ty.AddrTy info])              | Op.LoadVoxels(info, n) => (Ty.vecTy n, [Ty.AddrTy info])
64              | Op.PosToImgSpace info => let              | Op.PosToImgSpace info => let
# Line 76  Line 78 
78        | typeOfCons (expectedTy, tys as ty1::_) =        | typeOfCons (expectedTy, tys as ty1::_) =
79            if List.all (fn ty => Ty.same(ty1, ty)) tys            if List.all (fn ty => Ty.same(ty1, ty)) tys
80              then (case (expectedTy, ty1)              then (case (expectedTy, ty1)
81                 of (Ty.IVecTy n, Ty.IVecTy 1) => (n = List.length tys)                 of (Ty.SeqTy(_, n), Ty.IntTy) => (n = List.length tys)
82                  | (Ty.TensorTy dd, Ty.TensorTy dd') => (dd = List.length tys :: dd')                  | (Ty.TensorTy dd, Ty.TensorTy dd') => (dd = List.length tys :: dd')
83                  | _ => false                  | _ => false
84                (* end case *))                (* end case *))

Legend:
Removed from v.1521  
changed lines
  Added in v.1522

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