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 1273, Mon Jun 6 10:46:20 2011 UTC revision 1284, Tue Jun 7 09:39:24 2011 UTC
# Line 162  Line 162 
162              | (Op.Scale(Ty.TensorTy[n]), [s, v]) => CL.mkBinOp(s, CL.#*, v)              | (Op.Scale(Ty.TensorTy[n]), [s, v]) => CL.mkBinOp(s, CL.#*, v)
163              | (Op.CL, _) => raise Fail "CL unimplemented"              | (Op.CL, _) => raise Fail "CL unimplemented"
164              | (Op.PrincipleEvec ty, _) => raise Fail "PrincipleEvec unimplemented"              | (Op.PrincipleEvec ty, _) => raise Fail "PrincipleEvec unimplemented"
165  (*              | (Op.Subscript(Ty.IVecTy n), [v, CL.E_Int(ix, _)]) => vecIndex (v, Int.fromLarge ix)
166              | (Op.Subscript(Ty.IVecTy n), [v, ix]) => let              | (Op.Subscript(Ty.IVecTy n), [v, ix]) => let
167                  val unionTy = CL.T_Named(concat["union", Int.toString n, !RN.gIntSuffix, "_t"])                  val unionTy = CL.T_Named(concat["union", Int.toString n, !RN.gIntSuffix, "_t"])
168                  val vecExp = CL.mkSelect(CL.mkCast(unionTy, v), "i")                  val vecExp = CL.mkSelect(CL.mkCast(unionTy, v), "i")
169                  in                  in
170                    CL.mkSubscript(vecExp, ix)                    CL.mkSubscript(vecExp, ix)
171                  end                  end
172                | (Op.Subscript(Ty.TensorTy[n]), [v, CL.E_Int(ix, _)]) => vecIndex (v, Int.fromLarge ix)
173              | (Op.Subscript(Ty.TensorTy[n]), [v, ix]) => let              | (Op.Subscript(Ty.TensorTy[n]), [v, ix]) => let
174                  val unionTy = CL.T_Named(concat["union", Int.toString n, !RN.gRealSuffix, "_t"])                  val unionTy = CL.T_Named(concat["union", Int.toString n, !RN.gRealSuffix, "_t"])
175                  val vecExp = CL.mkSelect(CL.mkCast(unionTy, v), "r")                  val vecExp = CL.mkSelect(CL.mkCast(unionTy, v), "r")
176                  in                  in
177                    CL.mkSubscript(vecExp, ix)                    CL.mkSubscript(vecExp, ix)
178                  end                  end
179              | (Op.Subscript(Ty.TensorTy[_,_]), [m, ix, jx]) =>              | (Op.Subscript(Ty.TensorTy[_,_]), [m, ix, CL.E_Int(jx, _)]) =>
180                  CL.mkSubscript(CL.mkSelect(CL.mkSubscript(m, ix), "r"), jx)                  vecIndex(CL.mkSubscript(m, ix), Int.fromLarge jx)
181  *)              | (Op.Subscript(Ty.TensorTy[_,n]), [m, ix, jx]) => let
182                    val unionTy = CL.T_Named(concat["union", Int.toString n, !RN.gRealSuffix, "_t"])
183                    val vecExp = CL.mkSelect(CL.mkCast(unionTy, CL.mkSubscript(m, ix)), "r")
184                    in
185                      CL.mkSubscript(vecExp, jx)
186                    end
187              | (Op.Subscript ty, t::(ixs as _::_)) =>              | (Op.Subscript ty, t::(ixs as _::_)) =>
188                  raise Fail(concat["Subscript<", Ty.toString ty, "> unsupported"])                  raise Fail(concat["Subscript<", Ty.toString ty, "> unsupported"])
189              | (Op.Ceiling d, args) => CL.mkApply("ceil", args)              | (Op.Ceiling d, args) => CL.mkApply("ceil", args)

Legend:
Removed from v.1273  
changed lines
  Added in v.1284

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