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

SCM Repository

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

Diff of /trunk/src/compiler/mid-il/check-mid-il.sml

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

revision 420, Sun Oct 17 02:23:55 2010 UTC revision 435, Tue Oct 19 13:14:20 2010 UTC
# Line 1  Line 1 
1  (* check-mid-il.sml  (* check-mid-il.sml
2   *   *
3   * COPYRIGHT (c) 2010 The Diderot Project (http://diderot.cs.uchicago.edu)   * COPYRIGHT (c) 2010 The Diderot Project (http://diderot-language.cs.uchicago.edu)
4   * All rights reserved.   * All rights reserved.
5   *)   *)
6    
# Line 54  Line 54 
54                  (Ty.AddrTy, List.tabulate(dim, fn _ => Ty.intTy))                  (Ty.AddrTy, List.tabulate(dim, fn _ => Ty.intTy))
55              | Op.LoadVoxels(_, d) => (Ty.VecTy d, [Ty.AddrTy])              | Op.LoadVoxels(_, d) => (Ty.VecTy d, [Ty.AddrTy])
56              | Op.Transform(ImageInfo.ImgInfo{dim, ...}) => (Ty.VecTy dim, [Ty.VecTy dim])              | Op.Transform(ImageInfo.ImgInfo{dim, ...}) => (Ty.VecTy dim, [Ty.VecTy dim])
57              | Op.EvalKernel(d, _, _) => (Ty.realTy, [Ty.VecTy d])              | Op.EvalKernel(d, _, _) => (Ty.VecTy d, [Ty.VecTy d])
58              | Op.LoadImage _ => (Ty.ImageTy, [])              | Op.LoadImage _ => (Ty.ImageTy, [])
59              | Op.Inside(ImageInfo.ImgInfo{dim, ...}) => (Ty.BoolTy, [Ty.VecTy dim, Ty.ImageTy])              | Op.Inside(ImageInfo.ImgInfo{dim, ...}) => (Ty.BoolTy, [Ty.VecTy dim])
60              | Op.Input(ty, _) => (ty, [])              | Op.Input(ty, _) => (ty, [])
61              | Op.InputWithDefault(ty, _) => (ty, [ty])              | Op.InputWithDefault(ty, _) => (ty, [ty])
62              | _ => raise Fail("sigOf: invalid operator " ^ Op.toString rator)              | _ => raise Fail("sigOf: invalid operator " ^ Op.toString rator)
# Line 64  Line 64 
64    
65      fun typeOfCons [] = NONE      fun typeOfCons [] = NONE
66        | typeOfCons tys =        | typeOfCons tys =
67            if List.all (fn ty => Ty.same(Ty.IVecTy 0, ty)) tys            if List.all (fn ty => Ty.same(Ty.intTy, ty)) tys
68              then SOME(Ty.IVecTy(List.length tys))              then SOME(Ty.IVecTy(List.length tys))
69            else if List.all (fn ty => Ty.same(Ty.VecTy 0, ty)) tys            else if List.all (fn ty => Ty.same(Ty.realTy, ty)) tys
70              then SOME(Ty.VecTy(List.length tys))              then SOME(Ty.VecTy(List.length tys))
71              else NONE              else NONE
72    

Legend:
Removed from v.420  
changed lines
  Added in v.435

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