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

SCM Repository

[diderot] Diff of /branches/vis15/src/compiler/cxx-util/tree-to-cxx.sml
ViewVC logotype

Diff of /branches/vis15/src/compiler/cxx-util/tree-to-cxx.sml

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

revision 3918, Mon May 30 06:31:35 2016 UTC revision 3919, Mon May 30 06:53:48 2016 UTC
# Line 211  Line 211 
211              | IR.E_Lit(Literal.Real f) => CL.mkFlt(f, Env.realTy env)              | IR.E_Lit(Literal.Real f) => CL.mkFlt(f, Env.realTy env)
212              | IR.E_Lit(Literal.String s) => CL.mkStr s              | IR.E_Lit(Literal.String s) => CL.mkStr s
213              | IR.E_Op(rator, args) => trOp (env, rator, trExps(env, args))              | IR.E_Op(rator, args) => trOp (env, rator, trExps(env, args))
214              | IR.E_Vec(w, pw, args) => let              | IR.E_Vec(w, pw, args) => CL.mkApply(RN.vcons w, trExps (env, args))
                 val args = trExps (env, args)  
                 val args = if (w < pw) then args @ List.tabulate(pw-w, fn _ => zero) else args  
                 in  
                   CL.mkVec(CL.T_Named("vec" ^ Int.toString pw), args)  
                 end  
215              | IR.E_Cons(args, Ty.TensorTy shape) => raise Fail "unexpected E_Cons"              | IR.E_Cons(args, Ty.TensorTy shape) => raise Fail "unexpected E_Cons"
216              | IR.E_Seq(args, ty) => raise Fail "unexpected E_Seq"              | IR.E_Seq(args, ty) => raise Fail "unexpected E_Seq"
217              | IR.E_Pack(layout, args) => raise Fail "unexpected E_Pack"              | IR.E_Pack(layout, args) => raise Fail "unexpected E_Pack"
218  (* FIXME: check if e is aligned and use "vload_aligned" in that case *)  (* FIXME: check if e is aligned and use "vload_aligned" in that case *)
219              | IR.E_VLoad(layout, e, i) =>              | IR.E_VLoad(layout, e, i) =>
220                  CL.mkTemplateApply("vload",                  CL.mkApply(RN.vload(Ty.nthWidth(layout, i)),
                   [trType(env, Ty.nthVec(layout, i))],  
221                    [CL.mkBinOp(trExp(env, e), CL.#+, intExp(Ty.offsetOf(layout, i)))])                    [CL.mkBinOp(trExp(env, e), CL.#+, intExp(Ty.offsetOf(layout, i)))])
222              | _ => raise Fail "trExp"              | _ => raise Fail "trExp"
223            (* end case *))            (* end case *))

Legend:
Removed from v.3918  
changed lines
  Added in v.3919

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