65 |
| Ty.TensorTy[n, m] => CL.T_Named(N.matTy(n,m)) |
| Ty.TensorTy[n, m] => CL.T_Named(N.matTy(n,m)) |
66 |
| Ty.SeqTy(Ty.IntTy, n) => CL.T_Named(N.ivecTy n) |
| Ty.SeqTy(Ty.IntTy, n) => CL.T_Named(N.ivecTy n) |
67 |
| Ty.SeqTy(ty, n) => CL.T_Array(trType ty, SOME n) |
| Ty.SeqTy(ty, n) => CL.T_Array(trType ty, SOME n) |
68 |
|
| Ty.DynSeqTy _ => CL.T_Named N.dynSeqTy |
69 |
| Ty.AddrTy(ImageInfo.ImgInfo{ty=(_, rTy), ...}) => CL.T_Ptr(CL.T_Num rTy) |
| Ty.AddrTy(ImageInfo.ImgInfo{ty=(_, rTy), ...}) => CL.T_Ptr(CL.T_Num rTy) |
70 |
| Ty.ImageTy(ImageInfo.ImgInfo{dim, ...}) => CL.T_Ptr(CL.T_Named(N.imageTy dim)) |
| Ty.ImageTy(ImageInfo.ImgInfo{dim, ...}) => CL.T_Ptr(CL.T_Named(N.imageTy dim)) |
71 |
| _ => raise Fail(concat["TreeToC.trType(", Ty.toString ty, ")"]) |
| _ => raise Fail(concat["TreeToC.trType(", Ty.toString ty, ")"]) |
191 |
| (Op.Subscript(Ty.TensorTy[_,_]), [m, ix, jx]) => matIndex (m, ix, jx) |
| (Op.Subscript(Ty.TensorTy[_,_]), [m, ix, jx]) => matIndex (m, ix, jx) |
192 |
| (Op.Subscript ty, t::(ixs as _::_)) => |
| (Op.Subscript ty, t::(ixs as _::_)) => |
193 |
raise Fail(concat["Subscript<", Ty.toString ty, "> unsupported"]) |
raise Fail(concat["Subscript<", Ty.toString ty, "> unsupported"]) |
194 |
|
| (Op.MkDynamic(ty, n), [seq]) => CL.mkApply("DYNSEQ_MK(", [ |
195 |
|
CL.mkSizeof(trType ty), CL.mkInt(IntInf.fromInt n), seq |
196 |
|
]) |
197 |
|
| (Op.Append ty, [seq, x]) => CL.mkApply("DYNSEQ_APPEND(", [ |
198 |
|
CL.mkSizeof(trType ty), seq, x |
199 |
|
]) |
200 |
|
| (Op.Prepend ty, [x, seq]) => CL.mkApply("DYNSEQ_PREPEND(", [ |
201 |
|
CL.mkSizeof(trType ty), x, seq |
202 |
|
]) |
203 |
|
| (Op.Concat ty, [seq1, seq2]) => CL.mkApply("DYNSEQ_CONCAT(", [ |
204 |
|
CL.mkSizeof(trType ty), seq1, seq2 |
205 |
|
]) |
206 |
| (Op.Ceiling d, args) => CL.mkApply(N.addTySuffix("ceil", d), args) |
| (Op.Ceiling d, args) => CL.mkApply(N.addTySuffix("ceil", d), args) |
207 |
| (Op.Floor d, args) => CL.mkApply(N.addTySuffix("floor", d), args) |
| (Op.Floor d, args) => CL.mkApply(N.addTySuffix("floor", d), args) |
208 |
| (Op.Round d, args) => CL.mkApply(N.addTySuffix("round", d), args) |
| (Op.Round d, args) => CL.mkApply(N.addTySuffix("round", d), args) |
253 |
| IL.E_Op(rator, args) => trOp (rator, trExps(env, args)) |
| IL.E_Op(rator, args) => trOp (rator, trExps(env, args)) |
254 |
| IL.E_Apply(f, args) => trApply(f, trExps(env, args)) |
| IL.E_Apply(f, args) => trApply(f, trExps(env, args)) |
255 |
| IL.E_Cons(Ty.TensorTy[n], args) => CL.mkApply(N.mkVec n, trExps(env, args)) |
| IL.E_Cons(Ty.TensorTy[n], args) => CL.mkApply(N.mkVec n, trExps(env, args)) |
256 |
|
| IL.E_Cons(Ty.SeqTy(ty, n), args) => CL.mkApply("Diderot_MkSeq", |
257 |
|
CL.mkSizeof(trType ty) :: CL.mkInt(IntInf.fromInt n) :: trExps(env, args)) |
258 |
| IL.E_Cons(ty, _) => raise Fail(concat["E_Cons(", Ty.toString ty, ", _) in expression"]) |
| IL.E_Cons(ty, _) => raise Fail(concat["E_Cons(", Ty.toString ty, ", _) in expression"]) |
259 |
(* end case *)) |
(* end case *)) |
260 |
|
|