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

SCM Repository

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

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

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

revision 2398, Sat Jul 6 23:07:40 2013 UTC revision 2400, Sun Jul 7 13:29:54 2013 UTC
# Line 169  Line 169 
169    
170          (****************************)          (****************************)
171    
172    (*Is coeff val ints? if so don't need decideadd function, can just used addI *)
173    
174      fun expandEvalKernel (result, d, h, k, [x]) = let      fun expandEvalKernel (result, d, h, k, [x]) = let
175            val {isCont, segs} = Kernel.curve (h, k)            val {isCont, segs} = Kernel.curve (h, k)
176          (* degree of polynomial *)          (* degree of polynomial *)
# Line 183  Line 185 
185            val ty = DstTy.vecTy d            val ty = DstTy.vecTy d
186            val coeffs = List.tabulate (deg+1,            val coeffs = List.tabulate (deg+1,
187                  fn i => DstIL.Var.new("a"^Int.toString i, ty))                  fn i => DstIL.Var.new("a"^Int.toString i, ty))
188    
189          (* code to define the coefficient vectors *)          (* code to define the coefficient vectors *)
190            val coeffVecs = let            val coeffVecs = let
191                  fun mk (x, (i, code)) = let                  fun mk (x, (i, code)) = let
# Line 219  Line 222 
222                        stms*)                        stms*)
223    
224                  val replaceAdd= decideAdd(ty, [coeff, m])                  val replaceAdd= decideAdd(ty, [coeff, m])
225                (*I think add here is just used on ints, so don't need decideAdd function*)
226                  val stms =                  val stms =
227                                (m', DstIL.OP(DstOp.IMul, [x, s])) ::                                (m', DstIL.OP(DstOp.IMul, [x, s])) ::
228                                (s, replaceAdd) ::                                (s, replaceAdd) ::
# Line 233  Line 237 
237                        [(result, DstIL.VAR a0)]                        [(result, DstIL.VAR a0)]
238                    | a0::r => let                    | a0::r => let
239                        val (m, stms) = eval (1, r)                        val (m, stms) = eval (1, r)
240    
241                          val replaceAdd=decideAdd(ty, [a0,m])                          val replaceAdd=decideAdd(ty, [a0,m])
242                                        in                                        in
243                                  List.rev ((result, replaceAdd)::stms)                                  List.rev ((result, replaceAdd)::stms)

Legend:
Removed from v.2398  
changed lines
  Added in v.2400

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