15 |
structure SrcIL = HighIL |
structure SrcIL = HighIL |
16 |
structure SrcOp = HighOps |
structure SrcOp = HighOps |
17 |
structure DstIL = MidIL |
structure DstIL = MidIL |
18 |
|
structure DstTy = MidILTypes |
19 |
structure DstOp = MidOps |
structure DstOp = MidOps |
20 |
structure DstV = DstIL.Var |
structure DstV = DstIL.Var |
21 |
structure VMap = SrcIL.Var.Map |
structure VMap = SrcIL.Var.Map |
61 |
val t' = DstV.new "r" |
val t' = DstV.new "r" |
62 |
in |
in |
63 |
realLit (t', n) :: |
realLit (t', n) :: |
64 |
assign (t, DstOp.Add DstOp.realTy, [fd, t']) :: |
assign (t, DstOp.Add DstTy.realTy, [fd, t']) :: |
65 |
code |
code |
66 |
end |
end |
67 |
val code = |
val code = |
99 |
(* generate code for probing the field (D^k (v * h)) at pos *) |
(* generate code for probing the field (D^k (v * h)) at pos *) |
100 |
fun probe (result, (k, v, h), pos) = let |
fun probe (result, (k, v, h), pos) = let |
101 |
val ImageInfo.ImgInfo{dim, ty=([], ty), ...} = v |
val ImageInfo.ImgInfo{dim, ty=([], ty), ...} = v |
102 |
val dimTy = DstOp.VecTy dim |
val dimTy = DstTy.VecTy dim |
103 |
val s = Kernel.support h |
val s = Kernel.support h |
104 |
(* generate the transform code *) |
(* generate the transform code *) |
105 |
val x = DstV.new "x" (* image-space position *) |
val x = DstV.new "x" (* image-space position *) |
175 |
val code = |
val code = |
176 |
intLit(t1, offset) :: |
intLit(t1, offset) :: |
177 |
assign(t2, DstOp.Select(2*s, i), [n]) :: |
assign(t2, DstOp.Select(2*s, i), [n]) :: |
178 |
assign(index, DstOp.Add(DstOp.IntTy), [t1, t2]) :: |
assign(index, DstOp.Add(DstTy.intTy), [t1, t2]) :: |
179 |
code |
code |
180 |
val indices = index::indices |
val indices = index::indices |
181 |
in |
in |