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

SCM Repository

[diderot] Diff of /branches/vis12-cl/src/compiler/cl-target/tree-to-cl.sml
ViewVC logotype

Diff of /branches/vis12-cl/src/compiler/cl-target/tree-to-cl.sml

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

revision 1792, Wed Apr 4 11:28:02 2012 UTC revision 1793, Thu Apr 5 09:53:28 2012 UTC
# Line 60  Line 60 
60              | Ty.SeqTy(Ty.IntTy, n) => CL.T_Named(RN.ivecTy n)              | Ty.SeqTy(Ty.IntTy, n) => CL.T_Named(RN.ivecTy n)
61              | Ty.SeqTy(Ty.TensorTy[] , n) => CL.T_Named(RN.vecTy n)              | Ty.SeqTy(Ty.TensorTy[] , n) => CL.T_Named(RN.vecTy n)
62              | Ty.SeqTy(ty, n) => CL.T_Array(trType ty, SOME n)              | Ty.SeqTy(ty, n) => CL.T_Array(trType ty, SOME n)
63              | Ty.AddrTy(ImageInfo.ImgInfo{ty=(_, rTy), ...}) => imageDataPtrTy rTy              | Ty.AddrTy info => imageDataPtrTy(ImageInfo.sampleTy info)
64              | Ty.ImageTy(ImageInfo.ImgInfo{dim, ...}) => CL.T_Named(RN.imageTy dim)              | Ty.ImageTy info => CL.T_Named(RN.imageTy(ImageInfo.dim info))
65              | _ => raise Fail(concat["TreeToC.trType(", Ty.toString ty, ")"])              | _ => raise Fail(concat["TreeToC.trType(", Ty.toString ty, ")"])
66            (* end case *))            (* end case *))
67    
# Line 191  Line 191 
191              | (Op.RealToInt 1, [a]) => CL.mkCast(!RN.gIntTy, a)              | (Op.RealToInt 1, [a]) => CL.mkCast(!RN.gIntTy, a)
192              | (Op.RealToInt d, args) => CL.mkApply(RN.vecftoi d, args)              | (Op.RealToInt d, args) => CL.mkApply(RN.vecftoi d, args)
193  (* FIXME: need type info *)  (* FIXME: need type info *)
194              | (Op.ImageAddress(ImageInfo.ImgInfo{ty=(_,rTy), ...}), [a as CL.E_Indirect(_,field)]) => let              | (Op.ImageAddress info, [a as CL.E_Indirect(_,field)]) => let
195                  val cTy = imageDataPtrTy rTy                  val cTy = imageDataPtrTy(ImageInfo.sampleTy info)
196                  in                  in
197                    CL.mkCast(cTy,                    CL.mkCast(cTy,
198                      CL.mkSelect(CL.mkVar RN.globalImageDataName, RN.imageDataName field))                      CL.mkSelect(CL.mkVar RN.globalImageDataName, RN.imageDataName field))
# Line 207  Line 207 
207                  end                  end
208              | (Op.LoadVoxels _, [a]) =>              | (Op.LoadVoxels _, [a]) =>
209                  raise Fail("impossible " ^ Op.toString rator)                  raise Fail("impossible " ^ Op.toString rator)
210              | (Op.PosToImgSpace(ImageInfo.ImgInfo{dim, ...}), [img, pos]) =>              | (Op.PosToImgSpace info, [img, pos]) =>
211                  CL.mkApply(RN.toImageSpace dim, [CL.mkUnOp(CL.%&,img), pos])                  CL.mkApply(RN.toImageSpace(ImageInfo.dim info), [CL.mkUnOp(CL.%&,img), pos])
212              | (Op.TensorToWorldSpace(info, ty), [v, x]) =>              | (Op.TensorToWorldSpace(info, ty), [v, x]) =>
213                  CL.mkApply(RN.toWorldSpace ty, [CL.mkUnOp(CL.%&,v), x])                  CL.mkApply(RN.toWorldSpace ty, [CL.mkUnOp(CL.%&,v), x])
214              | (Op.LoadImage info, [a]) =>              | (Op.LoadImage info, [a]) =>
215                  raise Fail("impossible " ^ Op.toString rator)                  raise Fail("impossible " ^ Op.toString rator)
216              | (Op.Inside(ImageInfo.ImgInfo{dim, ...}, s), [pos, img]) =>              | (Op.Inside(info, s), [pos, img]) =>
217                  CL.mkApply(RN.inside dim, [pos, CL.mkUnOp(CL.%&,img), intExp s])                  CL.mkApply(RN.inside(ImageInfo.dim info), [pos, CL.mkUnOp(CL.%&,img), intExp s])
218              | (Op.Input(ty, name, desc), []) =>              | (Op.Input(ty, name, desc), []) =>
219                  raise Fail("impossible " ^ Op.toString rator)                  raise Fail("impossible " ^ Op.toString rator)
220              | (Op.InputWithDefault(ty, name, desc), [a]) =>              | (Op.InputWithDefault(ty, name, desc), [a]) =>

Legend:
Removed from v.1792  
changed lines
  Added in v.1793

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