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

SCM Repository

[diderot] Diff of /trunk/src/compiler/translate/translate-basis.sml
ViewVC logotype

Diff of /trunk/src/compiler/translate/translate-basis.sml

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

revision 183, Wed Jul 28 16:28:10 2010 UTC revision 188, Thu Jul 29 22:28:39 2010 UTC
# Line 9  Line 9 
9  structure TranslateBasis : sig  structure TranslateBasis : sig
10    
11      val translate : (HighIL.var * Var.var * Types.meta_var list * HighIL.var list)      val translate : (HighIL.var * Var.var * Types.meta_var list * HighIL.var list)
12            -> HighIL.simple_stmt list            -> HighIL.assign list
13    
14    end = struct    end = struct
15    
# Line 19  Line 19 
19      structure TU = TypeUtil      structure TU = TypeUtil
20      structure MV = MetaVar      structure MV = MetaVar
21    
22      fun assign (y, rator, xs) = [IL.ASSIGN(y, IL.OP(rator, xs))]      fun assign (y, rator, xs) = [(y, IL.OP(rator, xs))]
23    
24      fun simpleOP rator (y, [], xs) = assign (y, rator, xs)      fun simpleOP rator (y, [], xs) = assign (y, rator, xs)
25    
# Line 28  Line 28 
28              | shp => raise Fail("unresolved shape " ^ TU.shapeToString shp)              | shp => raise Fail("unresolved shape " ^ TU.shapeToString shp)
29            (* end case *))            (* end case *))
30    
31      (* build a table that maps Basis variables to their translation functions *)
32      val tbl = let      val tbl = let
33            val tbl = Var.Tbl.mkTable (128, Fail "Translate table")            val tbl = Var.Tbl.mkTable (128, Fail "Translate table")
34            in            in
# Line 42  Line 43 
43                  (mul_tr,        fn (y, sv, [t, r]) => tensorOp OP.Scale (y, sv, [r, t])),                  (mul_tr,        fn (y, sv, [t, r]) => tensorOp OP.Scale (y, sv, [r, t])),
44                  (div_ii,        simpleOp(OP.Div OP.IntTy)),                  (div_ii,        simpleOp(OP.Div OP.IntTy)),
45                  (div_rr,        simpleOp(OP.Div(OP.TensorTy[]))),                  (div_rr,        simpleOp(OP.Div(OP.TensorTy[]))),
46                  (div_tr,        fn (y, [SK], xs) => ??), (*FIXME*)                  (div_tr,        tensorOp OP.InvScale),
47                  (lt_ii,         simpleOp(OP.LT OP.IntTy)),                  (lt_ii,         simpleOp(OP.LT OP.IntTy)),
48                  (lt_rr,         simpleOp(OP.LT(OP.TensorTy[]))),                  (lt_rr,         simpleOp(OP.LT(OP.TensorTy[]))),
49                  (lte_ii,        simpleOp(OP.LTE OP.IntTy)),                  (lte_ii,        simpleOp(OP.LTE OP.IntTy)),
# Line 86  Line 87 
87                  (kn_bspln5,     fn (y, [], xs) => ??, (*FIXME*)                  (kn_bspln5,     fn (y, [], xs) => ??, (*FIXME*)
88                  (kn_ctmr,       fn (y, [], xs) => ??, (*FIXME*)                  (kn_ctmr,       fn (y, [], xs) => ??, (*FIXME*)
89                  (kn_tent,       fn (y, [], xs) => ??, (*FIXME*)                  (kn_tent,       fn (y, [], xs) => ??, (*FIXME*)
90                  (i2r,           fn (y, [], xs) => ??, (*FIXME*)                  (i2r,           simpleOp OP.IntToReal),
91                  (input,         fn (y, [TK], xs) => ??) (*FIXME*)                  (input,         fn (y, [TK], xs) => ??) (*FIXME*)
92                ];                ];
93              tbl              tbl

Legend:
Removed from v.183  
changed lines
  Added in v.188

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