38 |
| addTySuffix (stem, TargetTy.T_Vec n) = addVecSuffix stem n |
| addTySuffix (stem, TargetTy.T_Vec n) = addVecSuffix stem n |
39 |
| addTySuffix (stem, ty) = raise Fail(concat["invalid type ", TargetTy.toString ty, " for ", stem]) |
| addTySuffix (stem, ty) = raise Fail(concat["invalid type ", TargetTy.toString ty, " for ", stem]) |
40 |
|
|
41 |
val vecTy = addVecSuffix "vec" |
fun vecTy n = concat["vec", Int.toString n, !gRealSuffix, "_t"] |
42 |
val ivecTy = addIVecSuffix "vec" |
fun ivecTy n = concat["vec", Int.toString n, !gIntSuffix, "_t"] |
43 |
fun imageTy n = concat["Diderot_image", Int.toString n, "D_t"] |
fun imageTy n = concat["Diderot_image", Int.toString n, "D_t"] |
44 |
|
|
45 |
(* names of generated functions *) |
(* names of generated functions *) |
47 |
fun strandInit strand = strand ^ "_InitState" |
fun strandInit strand = strand ^ "_InitState" |
48 |
fun strandTy strand = concat["Strand_", strand, "_t"] |
fun strandTy strand = concat["Strand_", strand, "_t"] |
49 |
|
|
50 |
|
(* scalar math functions *) |
51 |
|
fun max ty = addTySuffix ("max", ty) |
52 |
|
fun min ty = addTySuffix ("min", ty) |
53 |
|
|
54 |
(* vector math functions *) |
(* vector math functions *) |
55 |
val mkVec = addVecSuffix "vec" |
val mkVec = addVecSuffix "vec" |
56 |
val scale = addVecSuffix "scale" |
val scale = addVecSuffix "scale" |