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

SCM Repository

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

Diff of /branches/vis15/src/compiler/gen/ir/mid-ir.spec

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

revision 3474, Wed Dec 2 18:26:40 2015 UTC revision 3725, Mon Apr 4 22:00:07 2016 UTC
# Line 1  Line 1 
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)
# Line 8  Line 8 
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  Add : ty : 1 : 2 :  IAdd : : 1 : 2 : integer addition
13  Sub : ty : 1 : 2 :  ISub : : 1 : 2 : integer subtraction
14  Mul : ty : 1 : 2 :  IMul : : 1 : 2 : integer multiplication
15  Div : ty : 1 : 2 :  IDiv : : 1 : 2 : integer division
16  Mod : : 1 : 2 : integer modulo  IMod : : 1 : 2 : integer modulo
17  Neg : ty : 1 : 1 :  INeg : : 1 : 1 : integer negation
 Abs : ty : 1 : 1 :  
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 :
# Line 23  Line 22 
22  GT : ty : 1 : 2 :  GT : ty : 1 : 2 :
23  GTE : ty : 1 : 2 :  GTE : ty : 1 : 2 :
24  Not : : 1 : 1 : boolean negation  Not : : 1 : 1 : boolean negation
25  Max : : 1 : 2 :  Abs : ty : 1 : 1 :
26  Min : : 1 : 2 :  Max : ty : 1 : 2 :
27    Min : ty : 1 : 2 :
28  # Clamp<ty>(lo, hi, x) -- clamps x to the range lo..hi  # Clamp<ty>(lo, hi, x) -- clamps x to the range lo..hi
29  Clamp : ty : 1 : 3 : clamp argument to range  Clamp : ty : 1 : 3 : clamp argument to range
30  # Lerp<ty>(a, b, t) -- computes a + t*(b-a)  # Lerp<ty>(a, b, t) -- computes a + t*(b-a)
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  # Dot<n>(u, v)  -- computes dot product of u and v; n specifies u and v's arity  #
 Dot : int : 1 : 2 :  
 # MulVecMat<m,n>(v, M) -- computes v*M, where M is an mxn-matrix and v is an m-vector  
 MulVecMat : int * int : 1 : 2 : vector times matrix multiplication  
 # MulMatVec<m,n>(M, v) -- computes M*v, where M is an mxn-matrix and v is a n-vector  
 MulMatVec : int * int : 1 : 2 : matrix times vector multiplication (type is matrix type)  
 # MulMatMat<m,n,p>(M, N) -- computes M*N, where M is an mxn-matrix and N is an nxp-matrix  
 MulMatMat : int * int * int : 1 : 2 : matrix times matrix multiplication  
 # MulVecTen3<m,n,p>(v, T) -- computes v*T, where T is an mxnxp-tensor and v is an m-vector  
 MulVecTen3 : int * int * int : 1 : 2 : vector times 3rd-order tensor multiplication  
 # MulTen3Vec<m,n,p>(v, T) -- computes T*v, where T is an mxnxp-tensor and v is a p-vector  
 MulTen3Vec : int * int * int : 1 : 2 : 3rd-order tensor times vector multiplication  
 # ColonMul<ty1,ty2>(T1, T2) -- computes T1:T2, where T1 (resp. T2) has type ty1 (resp. ty2)  
 ColonMul : ty * ty : 1 : 2 : colon product  
 # Cross(u, v)   -- computes cross product of u and v  
 Cross : : 1 : 2 :  
 # Norm<ty>(x) -- returns the norm of the tensor x, which has type ty  
 Norm : ty : 1 : 1 :  
 # Normalize<n>(v)   -- returns the unit vector in direction u; n is the length ov u  
 Normalize : int : 1 : 1 :  
 # Scale<ty>(s,u) -- multiply scalar s time tensor u; ty specifies u's type  
 Scale : ty : 1 : 2 : scalar*tensor multiplication  
 PrincipleEvec : ty : 1 : 2 : principle eigenvector; ty is result vector type  
35  EigenVecs2x2 : : 1 : 1 : Eigen vectors and values for 2x2 matrix  EigenVecs2x2 : : 1 : 1 : Eigen vectors and values for 2x2 matrix
36  EigenVecs3x3 : : 1 : 1 : Eigen vectors and values for 3x3 matrix  EigenVecs3x3 : : 1 : 1 : Eigen vectors and values for 3x3 matrix
37  EigenVals2x2 : : 1 : 1 : Eigen values for 2x2 matrix  EigenVals2x2 : : 1 : 1 : Eigen values for 2x2 matrix
38  EigenVals3x3 : : 1 : 1 : Eigen values for 3x3 matrix  EigenVals3x3 : : 1 : 1 : Eigen values for 3x3 matrix
 # Identity<n>() -- nxn identity matrix  
 Identity : int : 1 : 0 : identity matrix  
39  # Zero<ty>() -- zero tensor  # Zero<ty>() -- zero tensor
40  Zero : ty : 1 : 0 : identity matrix  Zero : ty : 1 : 0 : all zeros tensor
41  # Trace<n>(M) -- computes trace of nxn matrix M  #
42  Trace : int : 1 : 1 : compute trace of matrix  ### tuple operations
 # Transpose<n,m>(M) -- computes transpose of nxm matrix  
 Transpose : int * int : 1 : 1 : compute transpose of matrix  
 Slice : ty * mask : 1 : 1 : tensor slice; type is tensor argument type  
43  #  #
 # operations on sequences  
44  # Select<ty,i>(u)  -- select ith element of tuple; ty is tuple type  # Select<ty,i>(u)  -- select ith element of tuple; ty is tuple type
45  Select : ty * int : 1 : 1 :  Select : ty * int : 1 : 1 :
46    #
47    ### operations on sequences
48    #
49  # Index<ty,i>(u)  -- select ith element of sequence; ty is sequence type  # Index<ty,i>(u)  -- select ith element of sequence; ty is sequence type
50  Index : ty * int : 1 : 1 :  Index : ty * int : 1 : 1 :
51  # Subscript<ty>(u,i) -- select ith element of sequence; ty is type of sequence  # Subscript<ty>(u,i) -- select ith element of sequence; ty is type of sequence
52  Subscript : ty : 1 : 2 :  Subscript : ty : 1 : 2 :
53  # MkDynamic<ty,n> -- make a sequence with type ty{n} into a dynamic sequence  # MkDynamic<ty,n> -- make a sequence with type ty[n] into a dynamic sequence
54  !MkDynamic : ty * int : 1 : 1 : make a fixed-length sequence dynamic  !MkDynamic : ty * int : 1 : 1 : make a fixed-length sequence dynamic
55  !Append : ty : 2 : 1 : append an element onto a dynamic sequence  !Append : ty : 2 : 1 : append an element onto a dynamic sequence
56  !Prepend : ty : 2 : 1 : prepend an element onto a dynamic sequence  !Prepend : ty : 2 : 1 : prepend an element onto a dynamic sequence
57  !Concat : ty : 2 : 1 : concatenate two dynamic sequences  !Concat : ty : 2 : 1 : concatenate two dynamic sequences
58  # Length<ty> -- return the length of a sequence with type ty{}  # Range(lo,hi) -- create a sequence with values [lo, lo+1, ..., hi]
59    Range : : 2 : 1 : create a range sequence
60    # Length<ty> -- return the length of a sequence with type ty[]
61  Length : ty : 1 : 1 : return the length of a dynamic sequence  Length : ty : 1 : 1 : return the length of a dynamic sequence
62  #  #
63    # SphereQuery<posType,seqTy>(??)
64    SphereQuery : ty * ty : 1 : 2 : find strands within a sphere
65    #
66  # compute integral parts of reals  # compute integral parts of reals
67  Ceiling : int : 1 : 1 : compute real ceiling of a vector  Ceiling : int : 1 : 1 : compute real ceiling of a vector
68  Floor : int : 1 : 1 : compute real floor of a vector  Floor : int : 1 : 1 : compute real floor of a vector
# Line 93  Line 73 
73  IntToReal : : 1 : 1 :  IntToReal : : 1 : 1 :
74  RealToInt : int : 1 : 1 : cast real vector to int vector  RealToInt : int : 1 : 1 : cast real vector to int vector
75  #  #
76    # reduction operations
77    R_All      : ty : 1 : 3 :
78    R_Exists   : ty : 1 : 3 :
79    R_Max      : ty : 1 : 3 :
80    R_Min      : ty : 1 : 3 :
81    R_Sum      : ty : 1 : 3 :
82    R_Product  : ty : 1 : 3 :
83    R_Mean     : ty : 1 : 3 :
84    R_Variance : ty : 1 : 4 :
85    #
86  ### image/kernel operations  ### image/kernel operations
87  #  #
88    Kernel     : Kernel.kernel * int  : 1 : 0 : Kernel<h, k>, where h is the kernel and k is level of differentiation
89    Transform  : ImageInfo.info : 1 : 1 : Pulls transformation matrix from image.
90    Translate  : ImageInfo.info : 1 : 1 : Pulls translation vector from image.
91    #
92  # 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, ...
93  # for non-scalar images, the offset specifies which sample and I specifies the stride.  # for non-scalar images, the offset specifies which plane when the image has tensor values
94    # and the image info I specifies the stride.
95  VoxelAddress : ImageInfo.info * int : 1 : * : compute the address of a voxel  VoxelAddress : ImageInfo.info * int : 1 : * : compute the address of a voxel
96  #  #
97  # VoxelAddressWithCtl<I,offset,ctl>(V, i, j, ...) -- compute the address of the voxel  # VoxelAddressWithCtl<I,offset,ctl>(V, i, j, ...) -- compute the address of the voxel
# Line 107  Line 102 
102  # 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
103  LoadVoxels : ImageInfo.info * int : 1 : 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
104  #  #
 # PosToImgSpace<I>(V,u) -- transforms the world-space position u into the image-space specified by V.  
 PosToImgSpace : ImageInfo.info : 1 : 2 : transform a world-space position to image-space  
 #  
 # TensorToWorldSpace<I,ty>(V,u) -- transforms the image-space tensor u to from V's image space to world space  
 TensorToWorldSpace : ImageInfo.info * ty : 1 : 2 : transform an image-space gradient to world-space  
 #  
 # EvalKernel<i,h,k>(u) -- computes (D^k h)(u), where i is the size of vector u.  
 EvalKernel : int * Kernel.kernel * int : 1 : 1 : apply a kernel function to a scalar or vector of arguments  
 #  
105  # 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
106  # 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
107  Inside : ImageInfo.info * int : 1 : 2 :  Inside : ImageInfo.info * int : 1 : 2 :
# Line 123  Line 109 
109  # ImageDim<I,i>(V) -- returns the i'th dimension of the image  # ImageDim<I,i>(V) -- returns the i'th dimension of the image
110  ImageDim : ImageInfo.info * int : 1 : 1 :  ImageDim : ImageInfo.info * int : 1 : 1 :
111  #  #
112    # BorderCtlDefault<I>(V,t) -- wrap the image V with the border control that returns a default value t
113    BorderCtlDefault : ImageInfo.info : 1 : 2 :
114    # BorderCtlClamp<I>(V) -- wrap the image V with the border control that clamps the index
115    BorderCtlClamp : ImageInfo.info : 1 : 1 :
116    # BorderCtlMirror<I>(V) -- wrap the image V with the border control that mirrors the index
117    BorderCtlMirror : ImageInfo.info : 1 : 1 :
118    # BorderCtlWrap<I>(V) -- wrap the image V with the border control that wraps the index
119    BorderCtlWrap : ImageInfo.info : 1 : 1 :
120    #
121  # nrrd file loading  # nrrd file loading
122  LoadSeq   : ty * string : 1 : 0 : load sequence from nrrd file  LoadSeq   : ty * string : 1 : 0 : load sequence from nrrd file
123  LoadImage : ty * string : 1 : 0 : load image from nrrd file  LoadImage : ty * string : 1 : 0 : load image from nrrd file
124  #  #
 # inputs  
 !Input            : input : 0 : 0 : program input  
 !InputWithDefault : input : 0 : 1 : program input with default value as argument  
 #  
125  # printing support for debugging  # printing support for debugging
126  !Print : tys : 0 : * : print strings  !Print : tys : 0 : * : print strings
127    #
128    # unlifted math functions
129    MathFn : MathFns.t : 1 : * : math function

Legend:
Removed from v.3474  
changed lines
  Added in v.3725

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