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

SCM Repository

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

Diff of /branches/pure-cfg/src/compiler/high-to-mid/probe.sml

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

revision 634, Thu Mar 17 03:42:15 2011 UTC revision 635, Thu Mar 17 03:42:51 2011 UTC
# Line 61  Line 61 
61                    mkVar (0, l, [])                    mkVar (0, l, [])
62                  end                  end
63  val _ = print(concat["probeElem: ", Partials.partialToString pdOp, " in ", Int.toString(List.length convCoeffs), "D space\n"])  val _ = print(concat["probeElem: ", Partials.partialToString pdOp, " in ", Int.toString(List.length convCoeffs), "D space\n"])
64          (* for each dimension in space, we evaluate the kernel at the coordinates for that axis. *)          (* for each dimension in space, we evaluate the kernel at the coordinates for that axis.
65             * the coefficients are
66             *      h_{s-i} (f - i) for 1-s <= i <= s
67             *)
68            val coeffCode = let            val coeffCode = let
69                  fun gen (x, k, (d, code)) = let                  fun gen (x, k, (d, code)) = let
70                        val fd = newVar_dim ("f", d, DstTy.realTy)                        val fd = newVar_dim ("f", d, DstTy.realTy)
71                        val a = DstV.new ("a", vecsTy)                        val a = DstV.new ("a", vecsTy)
72                        val tmps = List.tabulate(2*s,                        val tmps = List.tabulate(2*s,
73                              fn i => (DstV.new("t"^Int.toString i, DstTy.realTy), s - (i+1)))                              fn i => (DstV.new("t"^Int.toString i, DstTy.realTy), i - s))
74                        fun mkArg ((t, n), code) = let                        fun mkArg ((t, 0), code) = (t, DstIL.VAR fd) :: code
75                            | mkArg ((t, n), code) = let
76                                val (rator, n) = if (n < 0) then (DstOp.Sub, ~n) else (DstOp.Add, n)
77                              val t' = DstV.new ("r", DstTy.realTy)                              val t' = DstV.new ("r", DstTy.realTy)
78                              in                              in
79                                realLit (t', n) ::                                realLit (t', n) ::
80                                assign (t, DstOp.Add DstTy.realTy, [fd, t']) ::                                assign (t, rator DstTy.realTy, [fd, t']) ::
81                                code                                code
82                              end                              end
83                        val code =                        val code =

Legend:
Removed from v.634  
changed lines
  Added in v.635

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