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

SCM Repository

[diderot] Diff of /branches/charisee/src/compiler/high-to-mid/high-to-mid.sml
ViewVC logotype

Diff of /branches/charisee/src/compiler/high-to-mid/high-to-mid.sml

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

revision 2667, Thu Jun 5 18:54:12 2014 UTC revision 2668, Thu Jun 12 03:29:04 2014 UTC
# Line 25  Line 25 
25      structure shift = ShiftEin      structure shift = ShiftEin
26      structure split = SplitEin      structure split = SplitEin
27      structure E=Ein      structure E=Ein
28        structure mk=mkOperators
29    
30     datatype peanut=    O of  SrcOp.rator | E of Ein.ein |Nope     datatype peanut=    O of  SrcOp.rator | E of Ein.ein |Nope
31    
32      val testing =0      val testing =1
33      fun getRHS x  = (case SrcIL.Var.binding x      fun getRHS x  = (case SrcIL.Var.binding x
34          of SrcIL.VB_RHS(SrcIL.OP(rator, args)) => (O rator, args)          of SrcIL.VB_RHS(SrcIL.OP(rator, args)) => (O rator, args)
35          | SrcIL.VB_RHS(SrcIL.VAR x') => getRHS x'          | SrcIL.VB_RHS(SrcIL.VAR x') => getRHS x'
# Line 166  Line 167 
167   *)   *)
168    
169    
170    
171        fun mkDot n =mk.innerProduct([n],[n])
172        val  mkDivS  =mk.divScalar
173        fun mkScale n=mk.scaleTen [n]
174    
175    
176        fun mkEin(rator,args)= DstIL.EINAPP(rator, args)
177    
178    
179    
180      fun arity (SrcTy.TensorTy[]) = 1      fun arity (SrcTy.TensorTy[]) = 1
181        | arity (SrcTy.TensorTy[d]) = d        | arity (SrcTy.TensorTy[d]) = d
182        | arity _ = raise Fail "arity"        | arity _ = raise Fail "arity"
# Line 200  Line 211 
211                | SrcOp.Min => assign DstOp.Min                | SrcOp.Min => assign DstOp.Min
212                | SrcOp.Clamp ty => assign (DstOp.Clamp(cvtTy ty))                | SrcOp.Clamp ty => assign (DstOp.Clamp(cvtTy ty))
213                | SrcOp.Lerp ty => assign (DstOp.Lerp(cvtTy ty))                | SrcOp.Lerp ty => assign (DstOp.Lerp(cvtTy ty))
214                | SrcOp.Norm ty => assign (DstOp.Norm(cvtTy ty))                | SrcOp.Sqrt=>assign DstOp.Sqrt
               | SrcOp.Normalize ty => assign (DstOp.Normalize(arity ty))  
215    
216                | SrcOp.PrincipleEvec ty => assign (DstOp.PrincipleEvec(cvtTy ty))                | SrcOp.PrincipleEvec ty => assign (DstOp.PrincipleEvec(cvtTy ty))
217    

Legend:
Removed from v.2667  
changed lines
  Added in v.2668

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