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

SCM Repository

[diderot] Diff of /branches/vis12/src/compiler/c-util/c-ty-translate.sml
ViewVC logotype

Diff of /branches/vis12/src/compiler/c-util/c-ty-translate.sml

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

revision 1857, Fri Apr 20 19:58:00 2012 UTC revision 1858, Fri Apr 20 20:14:41 2012 UTC
# Line 101  Line 101 
101              | Ty.StringTy => [CL.mkAssign(dst, src)]              | Ty.StringTy => [CL.mkAssign(dst, src)]
102              | Ty.IntTy => [CL.mkAssign(dst, src)]              | Ty.IntTy => [CL.mkAssign(dst, src)]
103              | Ty.TensorTy[] => [CL.mkAssign(dst, src)]              | Ty.TensorTy[] => [CL.mkAssign(dst, src)]
104              | Ty.TensorTy[n] => List.tabulate (n,              | Ty.TensorTy[n] => let
105                    val src' = CL.mkCast(CL.T_Named(N.unionTy n), src)
106                    in
107                      List.tabulate (n,
108                  fn i => CL.mkAssign(                  fn i => CL.mkAssign(
109                    subscript (dst, i),                        subscript (CL.mkUnOp(CL.%&, dst), i),
110                    subscript (CL.mkSelect(src, "r"), i)))                        subscript (CL.mkSelect(src', "r"), i)))
111                    end
112              | Ty.TensorTy[n, m] => List.concat(List.tabulate(n,              | Ty.TensorTy[n, m] => List.concat(List.tabulate(n,
113                  fn i => List.tabulate (m,                  fn i => List.tabulate (m,
114                    fn j => CL.mkAssign(                    fn j => CL.mkAssign(
# Line 138  Line 142 
142              | Ty.IntTy => [CL.mkAssign(dst, src)]              | Ty.IntTy => [CL.mkAssign(dst, src)]
143              | Ty.TensorTy[] => [CL.mkAssign(dst, src)]              | Ty.TensorTy[] => [CL.mkAssign(dst, src)]
144              | Ty.TensorTy[n] => [CL.mkAssign(              | Ty.TensorTy[n] => [CL.mkAssign(
145                  CL.mkSelect(dst, "v"),                  dst,
146                  CL.mkApply(N.mkVec n, List.tabulate(n, fn i => subscript(src, i))))]                  CL.mkApply(N.mkVec n, List.tabulate(n, fn i => subscript(src, i))))]
147              | Ty.TensorTy[n, m] => List.tabulate(n,              | Ty.TensorTy[n, m] => List.tabulate(n,
148                  fn i => CL.mkAssign(                  fn i => CL.mkAssign(

Legend:
Removed from v.1857  
changed lines
  Added in v.1858

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