1 |
# specification of operators for MidIL version of the IR. Each line (other than comments) |
# specification of operators for MidIR version of the IR. Each line (other than comments) |
2 |
# specifies an operator using five fields, which are separated by ":". The fields are |
# specifies an operator using five fields, which are separated by ":". The fields are |
3 |
# name |
# name |
4 |
# argument type (optional) |
# argument type (optional) |
8 |
# |
# |
9 |
# Operations with effects are denoted by a "!" as the first character of the line. |
# Operations with effects are denoted by a "!" as the first character of the line. |
10 |
# |
# |
11 |
# type-indexed arithmetic operations |
# integer operations |
12 |
IAdd : : 1 : 2 : integer addition |
IAdd : : 1 : 2 : integer addition |
13 |
ISub : : 1 : 2 : |
ISub : : 1 : 2 : integer subtraction |
14 |
IMul : : 1 : 2 : |
IMul : : 1 : 2 : integer multiplication |
15 |
IDiv : : 1 : 2 : |
IDiv : : 1 : 2 : integer division |
16 |
IMod : : 1 : 2 : integer modulo |
IMod : : 1 : 2 : integer modulo |
17 |
INeg : : 1 : 1 : |
INeg : : 1 : 1 : integer negation |
18 |
LT : ty : 1 : 2 : |
LT : ty : 1 : 2 : |
19 |
LTE : ty : 1 : 2 : |
LTE : ty : 1 : 2 : |
20 |
EQ : ty : 1 : 2 : |
EQ : ty : 1 : 2 : |
31 |
Lerp : ty : 1 : 3 : linear interpolation between 0 and 1 |
Lerp : ty : 1 : 3 : linear interpolation between 0 and 1 |
32 |
# |
# |
33 |
### vector operations |
### vector operations |
34 |
|
# |
35 |
|
# Dist<ty>(T1,T2) -- computes the distance between T1 and T2. (to be moved to Ein) |
36 |
|
Dist : ty : 1: 2 : |
37 |
# Normalize<n>(v) -- returns the unit vector in direction u; n is the length ov u |
# Normalize<n>(v) -- returns the unit vector in direction u; n is the length ov u |
38 |
Normalize : int : 1 : 1 : |
Normalize : int : 1 : 1 : |
39 |
PrincipleEvec : ty : 1 : 2 : principle eigenvector; ty is result vector type |
PrincipleEvec : ty : 1 : 2 : principle eigenvector; ty is result vector type |
42 |
EigenVals2x2 : : 1 : 1 : Eigen values for 2x2 matrix |
EigenVals2x2 : : 1 : 1 : Eigen values for 2x2 matrix |
43 |
EigenVals3x3 : : 1 : 1 : Eigen values for 3x3 matrix |
EigenVals3x3 : : 1 : 1 : Eigen values for 3x3 matrix |
44 |
# Zero<ty>() -- zero tensor |
# Zero<ty>() -- zero tensor |
45 |
Zero : ty : 1 : 0 : identity matrix |
Zero : ty : 1 : 0 : all zeros tensor |
46 |
# |
# |
47 |
### tuple operations |
### tuple operations |
48 |
# |
# |
65 |
# Length<ty> -- return the length of a sequence with type ty[] |
# Length<ty> -- return the length of a sequence with type ty[] |
66 |
Length : ty : 1 : 1 : return the length of a dynamic sequence |
Length : ty : 1 : 1 : return the length of a dynamic sequence |
67 |
# |
# |
68 |
|
# SphereQuery<posType,seqTy>(??) |
69 |
|
SphereQuery : ty * ty : 1 : 2 : find strands within |
70 |
|
# |
71 |
# compute integral parts of reals |
# compute integral parts of reals |
72 |
Ceiling : int : 1 : 1 : compute real ceiling of a vector |
Ceiling : int : 1 : 1 : compute real ceiling of a vector |
73 |
Floor : int : 1 : 1 : compute real floor of a vector |
Floor : int : 1 : 1 : compute real floor of a vector |
78 |
IntToReal : : 1 : 1 : |
IntToReal : : 1 : 1 : |
79 |
RealToInt : int : 1 : 1 : cast real vector to int vector |
RealToInt : int : 1 : 1 : cast real vector to int vector |
80 |
# |
# |
81 |
|
# reduction operations |
82 |
|
R_All : ty : 1 : 3 : |
83 |
|
R_Exists : ty : 1 : 3 : |
84 |
|
R_Max : ty : 1 : 3 : |
85 |
|
R_Min : ty : 1 : 3 : |
86 |
|
R_Sum : ty : 1 : 3 : |
87 |
|
R_Product : ty : 1 : 3 : |
88 |
|
R_Mean : ty : 1 : 3 : |
89 |
|
R_Variance : ty : 1 : 4 : |
90 |
|
# |
91 |
### image/kernel operations |
### image/kernel operations |
92 |
# |
# |
93 |
Kernel : Kernel.kernel * int : 1 : 0 : Kernel<h, k>, where h is the kernel and k is level of differentiation |
Kernel : Kernel.kernel * int : 1 : 0 : Kernel<h, k>, where h is the kernel and k is level of differentiation |
122 |
# |
# |
123 |
# printing support for debugging |
# printing support for debugging |
124 |
!Print : tys : 0 : * : print strings |
!Print : tys : 0 : * : print strings |
|
# |
|
|
# unlifted math functions |
|
|
MathFn : MathFns.t : 1 : * : math function |
|