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

SCM Repository

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

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

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

revision 1422, Thu Jun 30 21:38:22 2011 UTC revision 1423, Fri Jul 1 04:06:26 2011 UTC
# Line 123  Line 123 
123              | (Op.Min, args) => CL.mkApply(RN.min, castArgs (!RN.gRealTy) args)              | (Op.Min, args) => CL.mkApply(RN.min, castArgs (!RN.gRealTy) args)
124              | (Op.Clamp ty, [lo, hi, x]) => CL.mkApply(RN.clamp, [x, lo, hi])              | (Op.Clamp ty, [lo, hi, x]) => CL.mkApply(RN.clamp, [x, lo, hi])
125              | (Op.Lerp ty, args) => (case ty              | (Op.Lerp ty, args) => (case ty
126                   of Ty.TensorTy[] => CL.mkApply(RN.lerp, args)                   of Ty.TensorTy[] => CL.mkApply(RN.lerp, castArgs (!RN.gRealTy) args)
127                    | Ty.TensorTy[n] => CL.mkApply(RN.lerp, args)                    | Ty.TensorTy[n] => CL.mkApply(RN.lerp, castArgs (CL.T_Named(RN.vecTy n)) args)
128                    | _ => raise Fail(concat[                    | _ => raise Fail(concat[
129                      "lerp<", Ty.toString ty, "> not supported"                      "lerp<", Ty.toString ty, "> not supported"
130                        ])                        ])
# Line 202  Line 202 
202              | (Op.PosToImgSpace(ImageInfo.ImgInfo{dim, ...}), [img, pos]) =>              | (Op.PosToImgSpace(ImageInfo.ImgInfo{dim, ...}), [img, pos]) =>
203                  CL.mkApply(RN.toImageSpace dim, [CL.mkUnOp(CL.%&,img), pos])                  CL.mkApply(RN.toImageSpace dim, [CL.mkUnOp(CL.%&,img), pos])
204              | (Op.TensorToWorldSpace(info, ty), [v, x]) =>              | (Op.TensorToWorldSpace(info, ty), [v, x]) =>
205                  CL.mkApply(RN.toWorldSpace ty, [v, x])                  CL.mkApply(RN.toWorldSpace ty, [CL.mkUnOp(CL.%&,v), x])
206              | (Op.LoadImage info, [a]) =>              | (Op.LoadImage info, [a]) =>
207                  raise Fail("impossible " ^ Op.toString rator)                  raise Fail("impossible " ^ Op.toString rator)
208              | (Op.Inside(ImageInfo.ImgInfo{dim, ...}, s), [pos, img]) =>              | (Op.Inside(ImageInfo.ImgInfo{dim, ...}, s), [pos, img]) =>
# Line 255  Line 255 
255                    [CL.mkCall(RN.identityMat n, [lhs])]                    [CL.mkCall(RN.identityMat n, [lhs])]
256                | IL.E_Op(Op.Zero(Ty.TensorTy[m,n]), args) =>                | IL.E_Op(Op.Zero(Ty.TensorTy[m,n]), args) =>
257                    [CL.mkCall(RN.zeroMat(m,n), [lhs])]                    [CL.mkCall(RN.zeroMat(m,n), [lhs])]
258                | IL.E_Op(Op.TensorToWorldSpace(info, ty as Ty.TensorTy[_,_]), args) =>                | IL.E_Op(Op.TensorToWorldSpace(info, ty as Ty.TensorTy[_,_]), [img,src]) =>
259                    [CL.mkCall(RN.toWorldSpace ty, lhs :: trExps(env, args))]                    [CL.mkCall(RN.toWorldSpace ty, lhs :: [CL.mkUnOp(CL.%&,trExp(env, img)),trExp(env, src)] )]
260                | IL.E_Op(Op.LoadVoxels(info, n), [a]) =>                | IL.E_Op(Op.LoadVoxels(info, n), [a]) =>
261                    if (n > 1)                    if (n > 1)
262                      then let                      then let

Legend:
Removed from v.1422  
changed lines
  Added in v.1423

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