Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /branches/vis12/src/compiler/gen/il/mid-il.spec
ViewVC logotype

Diff of /branches/vis12/src/compiler/gen/il/mid-il.spec

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/src/compiler/gen/il/mid-il.spec revision 1484, Sun Sep 4 14:35:20 2011 UTC branches/vis12/src/compiler/gen/il/mid-il.spec revision 2331, Fri Mar 29 13:19:50 2013 UTC
# Line 1  Line 1 
1  # specification of operators for MidIL version of the IR.  Each line (other than comments)  # specification of operators for MidIL version of the IR.  Each line (other than comments)
2  # specifies an operator using four 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)
5    #       result arity
6  #       arity  #       arity
7  #       comment                 (optional)  #       comment                 (optional)
8  #  #
9    # Operations with effects are denoted by a "!" as the first character of the line.
10    #
11  # type-indexed arithmetic operations  # type-indexed arithmetic operations
12  Add : ty : 2 :  Add : ty : 1 : 2 :
13  Sub : ty : 2 :  Sub : ty : 1 : 2 :
14  Mul : ty : 2 :  Mul : ty : 1 : 2 :
15  Div : ty : 2 :  Div : ty : 1 : 2 :
16  Neg : ty : 1 :  Neg : ty : 1 : 1 :
17  Abs : ty : 1 :  Abs : ty : 1 : 1 :
18  LT : ty : 2 :  LT : ty : 1 : 2 :
19  LTE : ty : 2 :  LTE : ty : 1 : 2 :
20  EQ : ty : 2 :  EQ : ty : 1 : 2 :
21  NEQ : ty : 2 :  NEQ : ty : 1 : 2 :
22  GT : ty : 2 :  GT : ty : 1 : 2 :
23  GTE : ty : 2 :  GTE : ty : 1 : 2 :
24  Not : : 1 : boolean negation  Not : : 1 : 1 : boolean negation
25  Max : : 2 :  Max : : 1 : 2 :
26  Min : : 2 :  Min : : 1 : 2 :
27  # Clamp<ty>(lo, hi, x) -- clamps x to the range lo..hi  # Clamp<ty>(lo, hi, x) -- clamps x to the range lo..hi
28  Clamp : ty : 3 : clamp argument to range  Clamp : ty : 1 : 3 : clamp argument to range
29  # Lerp<ty>(a, b, t) -- computes a + t*(b-a)  # Lerp<ty>(a, b, t) -- computes a + t*(b-a)
30  Lerp : ty : 3 : linear interpolation between 0 and 1  Lerp : ty : 1 : 3 : linear interpolation between 0 and 1
31  #  #
32  ### vector operations  ### vector operations
33  # Dot<n>(u, v)  -- computes dot product of u and v; n specifies u and v's arity  # Dot<n>(u, v)  -- computes dot product of u and v; n specifies u and v's arity
34  Dot : int : 2 :  Dot : int : 1 : 2 :
35  # MulVecMat<m,n>(v, M) -- computes v*M, where M is an mxn-matrix and v is an m-vector  # MulVecMat<m,n>(v, M) -- computes v*M, where M is an mxn-matrix and v is an m-vector
36  MulVecMat : int * int : 2 : vector times matrix multiplication  MulVecMat : int * int : 1 : 2 : vector times matrix multiplication
37  # MulMatVec<m,n>(M, v) -- computes M*v, where M is an mxn-matrix and v is a n-vector  # MulMatVec<m,n>(M, v) -- computes M*v, where M is an mxn-matrix and v is a n-vector
38  MulMatVec : int * int : 2 : matrix times vector multiplication (type is matrix type)  MulMatVec : int * int : 1 : 2 : matrix times vector multiplication (type is matrix type)
39  # MulMatMat<m,n,p>(M, N) -- computes M*N, where M is an mxn-matrix and N is an nxp-matrix  # MulMatMat<m,n,p>(M, N) -- computes M*N, where M is an mxn-matrix and N is an nxp-matrix
40  MulMatMat : int * int * int : 2 : matrix times matrix multiplication  MulMatMat : int * int * int : 1 : 2 : matrix times matrix multiplication
41    # MulVecTen3<m,n,p>(v, T) -- computes v*T, where T is an mxnxp-tensor and v is an m-vector
42    MulVecTen3 : int * int * int : 1 : 2 : vector times 3rd-order tensor multiplication
43    # MulTen3Vec<m,n,p>(v, T) -- computes T*v, where T is an mxnxp-tensor and v is a p-vector
44    MulTen3Vec : int * int * int : 1 : 2 : 3rd-order tensor times vector multiplication
45    # ColonMul<ty1,ty2>(T1, T2) -- computes T1:T2, where T1 (resp. T2) has type ty1 (resp. ty2)
46    ColonMul : ty * ty : 1 : 2 : colon product
47  # Cross(u, v)   -- computes cross product of u and v  # Cross(u, v)   -- computes cross product of u and v
48  Cross : : 2 :  Cross : : 1 : 2 :
 # Select<ty,i>(u)  -- select ith element of vector u; ty specifies u's type (IVec or Vec)  
 Select : ty * int : 1 :  
49  # Norm<ty>(x) -- returns the norm of the tensor x, which has type ty  # Norm<ty>(x) -- returns the norm of the tensor x, which has type ty
50  Norm : ty : 1 :  Norm : ty : 1 : 1 :
51  # 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
52  Normalize : int : 1 :  Normalize : int : 1 : 1 :
53  # Scale<ty>(s,u) -- multiply scalar s time tensor u; ty specifies u's type  # Scale<ty>(s,u) -- multiply scalar s time tensor u; ty specifies u's type
54  Scale : ty : 2 : scalar*tensor multiplication  Scale : ty : 1 : 2 : scalar*tensor multiplication
55  PrincipleEvec : ty : 2 : principle eigenvector; ty is result vector type  PrincipleEvec : ty : 1 : 2 : principle eigenvector; ty is result vector type
56    EigenVecs2x2 : : 1 : 1 : Eigen vectors and values for 2x2 matrix
57    EigenVecs3x3 : : 1 : 1 : Eigen vectors and values for 3x3 matrix
58    EigenVals2x2 : : 1 : 1 : Eigen values for 2x2 matrix
59    EigenVals3x3 : : 1 : 1 : Eigen values for 3x3 matrix
60  # Identity<n>() -- nxn identity matrix  # Identity<n>() -- nxn identity matrix
61  Identity : int : 0 : identity matrix  Identity : int : 1 : 0 : identity matrix
62  # Zero<ty>() -- zero tensor  # Zero<ty>() -- zero tensor
63  Zero : ty : 0 : identity matrix  Zero : ty : 1 : 0 : identity matrix
64  # Trace<n>(m) -- computes trace of nxn matrix m  # Trace<n>(M) -- computes trace of nxn matrix M
65  Trace : int : 1 : compute trace of matrix  Trace : int : 1 : 1 : compute trace of matrix
66  Subscript : ty : 2 :  # Transpose<n,m>(M) -- computes transpose of nxm matrix
67    Transpose : int * int : 1 : 1 : compute transpose of matrix
68    #
69    # operations on sequences
70    # Select<ty,i>(u)  -- select ith element of tuple; ty is tuple type
71    Select : ty * int : 1 : 1 :
72    # Index<ty,i>(u)  -- select ith element of sequence; ty is sequence type
73    Index : ty * int : 1 : 1 :
74    # Subscript<ty>(u,i) -- select ith element of sequence; ty is type of sequence
75    Subscript : ty : 1 : 2 :
76    # MkDynamic<ty,n> -- make a sequence with type ty{n} into a dynamic sequence
77    !MkDynamic : ty * int : 1 : 1 : make a fixed-length sequence dynamic
78    !Append : ty : 2 : 1 : append an element onto a dynamic sequence
79    !Prepend : ty : 2 : 1 : prepend an element onto a dynamic sequence
80    !Concat : ty : 2 : 1 : concatenate two dynamic sequences
81    # Length<ty> -- return the length of a sequence with type ty{}
82    Length : ty : 1 : 1 : return the length of a dynamic sequence
83  #  #
84  # compute integral parts of reals  # compute integral parts of reals
85  Ceiling : int : 1 : compute real ceiling of a vector  Ceiling : int : 1 : 1 : compute real ceiling of a vector
86  Floor : int : 1 : compute real floor of a vector  Floor : int : 1 : 1 : compute real floor of a vector
87  Round : int : 1 : compute real rounding to nearest integral real of a vector  Round : int : 1 : 1 : compute real rounding to nearest integral real of a vector
88  Trunc : int : 1 : compute real truncation to integral real of a vector  Trunc : int : 1 : 1 : compute real truncation to integral real of a vector
89  #  #
90  ### conversions; the real to int forms are vector ops  ### conversions; the real to int forms are vector ops
91  IntToReal : : 1 :  IntToReal : : 1 : 1 :
92  RealToInt : int : 1 : cast real vector to int vector  RealToInt : int : 1 : 1 : cast real vector to int vector
93  #  #
94  ### image/kernel operations  ### image/kernel operations
95  # VoxelAddress<I,offset>(V, i, j, ...) -- compute the address of the voxel data indexed by i, j, ...  # VoxelAddress<I,offset>(V, i, j, ...) -- compute the address of the voxel data indexed by i, j, ...
96  # for non-scalar images, the offset specifies which sample and I specifies the stride.  # for non-scalar images, the offset specifies which sample and I specifies the stride.
97  VoxelAddress : ImageInfo.info * int : * : compute the address of a voxel  VoxelAddress : ImageInfo.info * int : 1 : * : compute the address of a voxel
98  # LoadVoxels<I,n>(a) -- load a vector of n voxels from the address a  # LoadVoxels<I,n>(a) -- load a vector of n voxels from the address a
99  LoadVoxels : ImageInfo.info * int : 1 : load a vector of voxel values from an address  LoadVoxels : ImageInfo.info * int : 1 : 1 : load a vector of voxel values from an address
100  # PosToImgSpace<I>(V,u) -- transforms the world-space position u into the image-space specified by V.  # PosToImgSpace<I>(V,u) -- transforms the world-space position u into the image-space specified by V.
101  PosToImgSpace : ImageInfo.info : 2 : transform a world-space position to image-space  PosToImgSpace : ImageInfo.info : 1 : 2 : transform a world-space position to image-space
102  # TensorToWorldSpace<I,ty>(V,u) -- transforms the image-space tensor u to from V's image space to world space  # TensorToWorldSpace<I,ty>(V,u) -- transforms the image-space tensor u to from V's image space to world space
103  TensorToWorldSpace : ImageInfo.info * ty : 2 : transform an image-space gradient to world-space  TensorToWorldSpace : ImageInfo.info * ty : 1 : 2 : transform an image-space gradient to world-space
104  # EvalKernel<i,h,k>(u) -- computes (D^k h)(u), where i is the size of vector u.  # EvalKernel<i,h,k>(u) -- computes (D^k h)(u), where i is the size of vector u.
105  EvalKernel : int * Kernel.kernel * int : 1 : apply a kernel function to a scalar or vector of arguments  EvalKernel : int * Kernel.kernel * int : 1 : 1 : apply a kernel function to a scalar or vector of arguments
 LoadImage : ImageInfo.info : 1 : image-file loading  
106  # Inside<I,s>(u,V) -- tests to see if image-space position u is inside the volume  # Inside<I,s>(u,V) -- tests to see if image-space position u is inside the volume
107  # occupied by the image V.  I is the image info and s is the border width  # occupied by the image V.  I is the image info and s is the border width
108  Inside : ImageInfo.info * int : 2 :  Inside : ImageInfo.info * int : 1 : 2 :
109    #
110    # nrrd file loading
111    LoadSeq   : ty * string                  : 1 : 0 : load sequence from nrrd file
112    LoadImage : ty * string * ImageInfo.info : 1 : 0 : load image from nrrd file
113  #  #
114  # inputs  # inputs
115  Input            : ty * string * string  : 0 :  Input   : input : 0 : 0 : program input
116  InputWithDefault : ty * string * string  : 1 :  #
117    # printing support for debugging
118    !Print : tys : 0 : * : print strings

Legend:
Removed from v.1484  
changed lines
  Added in v.2331

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0