SCM Repository
Annotation of /branches/vis12/src/compiler/gen/il/high-il.spec
Parent Directory
|
Revision Log
Revision 2027 - (view) (download)
1 : | jhr | 186 | # specification of operators for HighIL version of the IR. Each line (other than comments) |
2 : | jhr | 1640 | # specifies an operator using five fields, which are separated by ":". The fields are |
3 : | jhr | 186 | # name |
4 : | # argument type (optional) | ||
5 : | jhr | 1640 | # result arity |
6 : | jhr | 186 | # arity |
7 : | # comment (optional) | ||
8 : | # | ||
9 : | # type-indexed arithmetic operations | ||
10 : | jhr | 1640 | Add : ty : 1 : 2 : |
11 : | Sub : ty : 1 : 2 : | ||
12 : | Mul : ty : 1 : 2 : | ||
13 : | Div : ty : 1 : 2 : | ||
14 : | Neg : ty : 1 : 1 : | ||
15 : | Abs : ty : 1 : 1 : | ||
16 : | LT : ty : 1 : 2 : | ||
17 : | LTE : ty : 1 : 2 : | ||
18 : | EQ : ty : 1 : 2 : | ||
19 : | NEQ : ty : 1 : 2 : | ||
20 : | GT : ty : 1 : 2 : | ||
21 : | GTE : ty : 1 : 2 : | ||
22 : | Power : : 1 : 2 : raise real to integer power | ||
23 : | Not : : 1 : 1 : boolean negation | ||
24 : | Max : : 1 : 2 : | ||
25 : | Min : : 1 : 2 : | ||
26 : | jhr | 1295 | # Clamp<ty>(lo, hi, x) -- clamps x to the range lo..hi |
27 : | jhr | 1640 | Clamp : ty : 1 : 3 : clamp argument to range |
28 : | jhr | 1116 | # Lerp<ty>(a, b, t) -- computes a + t*(b-a) |
29 : | jhr | 1640 | Lerp : ty : 1 : 3 : linear interpolation between 0 and 1 |
30 : | jhr | 186 | # |
31 : | jhr | 400 | # tensor/vector operations |
32 : | # | ||
33 : | jhr | 1640 | Dot : ty : 1 : 2 : |
34 : | MulVecMat : ty : 1 : 2 : vector times matrix multiplication (type is matrix type) | ||
35 : | MulMatVec : ty : 1 : 2 : matrix times vector multiplication (type is matrix type) | ||
36 : | jhr | 1941 | MulMatMat : ty * ty : 1 : 2 : matrix times matrix multiplication |
37 : | jhr | 1939 | MulVecTen3 : ty : 1 : 2 : vector times 3rd-order tensor multiplication (type is tensor type) |
38 : | jhr | 1941 | MulTen3Vec : ty : 1 : 2 : 3rd-order tensor times vector multiplication (type is tensor type) |
39 : | jhr | 1945 | # ColonMul<ty1,ty2>(T1, T2) -- computes T1:T2, where T1 (resp. T2) has type ty1 (resp. ty2) |
40 : | ColonMul : ty * ty : 1 : 2 : colon product | ||
41 : | jhr | 1640 | Cross : : 1 : 2 : |
42 : | Outer : ty : 1 : 2 : vector outer product (type is result type) | ||
43 : | jhr | 1116 | # Norm<ty>(x) -- returns the norm of the tensor x, which has type ty |
44 : | jhr | 1640 | Norm : ty : 1 : 1 : |
45 : | Normalize : ty : 1 : 1 : | ||
46 : | Scale : ty : 1 : 2 : scalar*tensor multiplication | ||
47 : | PrincipleEvec : ty : 1 : 2 : principle eigenvector; ty is result vector type | ||
48 : | Eigen2x2 : : 1 : 1 : Eigenvector and values for 2x2 matrix | ||
49 : | Eigen3x3 : : 1 : 1 : Eigenvector and values for 3x3 matrix | ||
50 : | jhr | 1116 | # Identity<n>() -- nxn identity matrix |
51 : | jhr | 1640 | Identity : int : 1 : 0 : identity matrix |
52 : | jhr | 1116 | # Zero<ty>() -- zero tensor |
53 : | jhr | 1640 | Zero : ty : 1 : 0 : identity matrix |
54 : | jhr | 1116 | # Trace<ty>(m) -- computes trace of matrix m; ty is type of matrix |
55 : | jhr | 1640 | Trace : ty : 1 : 1 : compute trace of matrix |
56 : | Slice : ty * mask : 1 : 1 : tensor slice; type is tensor argument type | ||
57 : | TensorSub : ty : 1 : * : tensor subscript (special case of slice) | ||
58 : | jhr | 186 | # |
59 : | jhr | 1640 | # tuple and sequence operations |
60 : | Select : ty * int : 1 : 1 : select field from tuple value | ||
61 : | SeqSub : ty : 1 : 2 : index a sequence | ||
62 : | jhr | 1687 | MkDynamic : ty * int : 1 : 1 : make a fixed-length sequence dynamic |
63 : | Append : ty : 2 : 1 : append an element onto a dynamic sequence | ||
64 : | Prepend : ty : 2 : 1 : prepend an element onto a dynamic sequence | ||
65 : | Concat : ty : 2 : 1 : concatenate two dynamic sequences | ||
66 : | jhr | 1925 | # Length<ty> -- return the length of a sequence with type ty{} |
67 : | Length : ty : 1 : 1 : return the length of a dynamic sequence | ||
68 : | jhr | 1640 | # |
69 : | jhr | 186 | # conversions |
70 : | jhr | 1640 | IntToReal : : 1 : 1 : |
71 : | TruncToInt : : 1 : 1 : | ||
72 : | RoundToInt : : 1 : 1 : | ||
73 : | CeilToInt : : 1 : 1 : | ||
74 : | FloorToInt : : 1 : 1 : | ||
75 : | jhr | 186 | # |
76 : | # image/field operations | ||
77 : | jhr | 1640 | Kernel : Kernel.kernel * int : 1 : 0 : Kernel<h, k>, where h is the kernel and k is level of differentiation |
78 : | Inside : int : 1 : 2 : args are position, field | ||
79 : | Field : int : 1 : 2 : Field<d> is d-dimension reconstructed field; args are image, kernel | ||
80 : | Probe : ty * ty : 1 : 2 : Probe<domTy, rngTy>(fld, pos) probes fld at pos. | ||
81 : | AddField : : 1 : 2 : field addition | ||
82 : | SubField : : 1 : 2 : field subtraction | ||
83 : | ScaleField : : 1 : 2 : field scaling | ||
84 : | NegField : : 1 : 1 : field negation | ||
85 : | DiffField : : 1 : 1 : field differentiation | ||
86 : | jhr | 226 | # |
87 : | jhr | 2027 | # nrrd file loading |
88 : | LoadSeq : ty * string : 1 : 0 : load sequence from nrrd file | ||
89 : | LoadImage : ty * string * ImageInfo.info : 1 : 0 : load image from nrrd file | ||
90 : | # | ||
91 : | jhr | 226 | # inputs |
92 : | jhr | 2011 | Input : input : 0 : 0 : program input |
93 : | jhr | 1640 | # |
94 : | # printing support for debugging | ||
95 : | Print : tys : 0 : * : print strings |
root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |
Powered by ViewVC 1.0.0 |