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

SCM Repository

[diderot] Diff of /branches/charisee/src/compiler/c-util/tree-to-c-fn.sml
ViewVC logotype

Diff of /branches/charisee/src/compiler/c-util/tree-to-c-fn.sml

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

revision 2827, Tue Nov 11 00:18:38 2014 UTC revision 2828, Wed Nov 12 06:30:58 2014 UTC
# Line 93  Line 93 
93    
94      (*creates global var if it's not a vector type*)      (*creates global var if it's not a vector type*)
95      fun localType(ty,isVecTy) = (case ty      fun localType(ty,isVecTy) = (case ty
96          of Ty.TensorTy [t] =>(case (isVecTy t)          of Ty.TensorTy [3] => CLang.T_Named(N.LocalTy [3])
97            | Ty.TensorTy [t] =>(case (isVecTy t)
98              of true => CLang.T_Named(N.LocalTy [t])              of true => CLang.T_Named(N.LocalTy [t])
99              | _ => trType ty              | _ => trType ty
100              (* end case *))              (* end case *))
# Line 189  Line 190 
190               | (Op.baseAddr(ImageInfo.ImgInfo{ty=(_,rTy), ...}) ,[a])=>               | (Op.baseAddr(ImageInfo.ImgInfo{ty=(_,rTy), ...}) ,[a])=>
191                  CL.E_Cast(CL.T_Ptr(CL.T_Num rTy),CL.mkIndirect(a, "data"))                  CL.E_Cast(CL.T_Ptr(CL.T_Num rTy),CL.mkIndirect(a, "data"))
192              | (Op.baseAddr _,_)=> CL.mkBinOp(CL.E_Str"baseString", CL.#-, CL.E_Str"none")              | (Op.baseAddr _,_)=> CL.mkBinOp(CL.E_Str"baseString", CL.#-, CL.E_Str"none")
             | (Op.imgAddr(Vinfo,indexAtTy, dim), [base,a,b])=>  
193    
194                  CL.mkBinOp(base, CL.#+, CL.mkBinOp(b, CL.#+,  CL.mkBinOp(CL.mkInt 77, CL.#*, a)))              | (Op.imgAddr(_,Ty.imgIndex ty, _), [base,shift] )=>(case ty
195                    of []  =>CL.mkBinOp(base, CL.#+,shift)
196                    | [0]  => CL.mkBinOp(base, CL.#+,shift)
197                    | [i]  => CL.mkBinOp(CL.mkInt(IntInf.fromInt i), CL.#+, CL.mkBinOp(base, CL.#+,shift))
198                    | _    =>raise Fail"Img addr larger than vector"
199                    (*end case*))
200            | (Op.Transform(_,i),[a]) => CL.mkIndirect(a, "w2i["^(Int.toString i)^"].v")            | (Op.Transform(_,i),[a]) => CL.mkIndirect(a, "w2i["^(Int.toString i)^"].v")
201              | (Op.Translate(ImageInfo.ImgInfo{ty=(_,rTy), ...}),[a])=>CL.mkIndirect(a, "tVec")              | (Op.Translate(ImageInfo.ImgInfo{ty=(_,rTy), ...}),[a])=>CL.mkIndirect(a, "tVec")
202              | (Op.Abs(Ty.IntTy), args) => CL.mkApply("abs", args)              | (Op.Abs(Ty.IntTy), args) => CL.mkApply("abs", args)

Legend:
Removed from v.2827  
changed lines
  Added in v.2828

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