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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3483 - (download) (annotate)
Sat Dec 5 15:02:33 2015 UTC (3 years, 8 months ago) by jhr
File size: 4604 byte(s)
working on merge
# specification of operators for MidIL version of the IR.  Each line (other than comments)
# specifies an operator using five fields, which are separated by ":".  The fields are
#       name
#       argument type           (optional)
#       result arity
#       arity
#       comment                 (optional)
#
# Operations with effects are denoted by a "!" as the first character of the line.
#
# type-indexed arithmetic operations
IAdd : : 1 : 2 : integer addition
ISub : : 1 : 2 :
IMul : : 1 : 2 :
IDiv : : 1 : 2 :
IMod : : 1 : 2 : integer modulo
INeg : : 1 : 1 :
LT : ty : 1 : 2 :
LTE : ty : 1 : 2 :
EQ : ty : 1 : 2 :
NEQ : ty : 1 : 2 :
GT : ty : 1 : 2 :
GTE : ty : 1 : 2 :
Not : : 1 : 1 : boolean negation
Abs : ty : 1 : 1 :
Max : ty : 1 : 2 :
Min : ty : 1 : 2 :
# Clamp<ty>(lo, hi, x) -- clamps x to the range lo..hi
Clamp : ty : 1 : 3 : clamp argument to range
# Lerp<ty>(a, b, t) -- computes a + t*(b-a)
Lerp : ty : 1 : 3 : linear interpolation between 0 and 1
#
### vector operations
# Normalize<n>(v)   -- returns the unit vector in direction u; n is the length ov u
Normalize : int : 1 : 1 :
PrincipleEvec : ty : 1 : 2 : principle eigenvector; ty is result vector type
EigenVecs2x2 : : 1 : 1 : Eigen vectors and values for 2x2 matrix
EigenVecs3x3 : : 1 : 1 : Eigen vectors and values for 3x3 matrix
EigenVals2x2 : : 1 : 1 : Eigen values for 2x2 matrix
EigenVals3x3 : : 1 : 1 : Eigen values for 3x3 matrix
# Zero<ty>() -- zero tensor
Zero : ty : 1 : 0 : identity matrix
# operations on sequences
# Select<ty,i>(u)  -- select ith element of tuple; ty is tuple type
Select : ty * int : 1 : 1 :
# Index<ty,i>(u)  -- select ith element of sequence; ty is sequence type
Index : ty * int : 1 : 1 :
# Subscript<ty>(u,i) -- select ith element of sequence; ty is type of sequence
Subscript : ty : 1 : 2 :
# MkDynamic<ty,n> -- make a sequence with type ty{n} into a dynamic sequence
!MkDynamic : ty * int : 1 : 1 : make a fixed-length sequence dynamic
!Append : ty : 2 : 1 : append an element onto a dynamic sequence
!Prepend : ty : 2 : 1 : prepend an element onto a dynamic sequence
!Concat : ty : 2 : 1 : concatenate two dynamic sequences
# Length<ty> -- return the length of a sequence with type ty{}
Length : ty : 1 : 1 : return the length of a dynamic sequence
#
# compute integral parts of reals
Ceiling : int : 1 : 1 : compute real ceiling of a vector
Floor : int : 1 : 1 : compute real floor of a vector
Round : int : 1 : 1 : compute real rounding to nearest integral real of a vector
Trunc : int : 1 : 1 : compute real truncation to integral real of a vector
#
### conversions; the real to int forms are vector ops
IntToReal : : 1 : 1 :
RealToInt : int : 1 : 1 : cast real vector to int vector
#
### image/kernel operations
#
Kernel     : Kernel.kernel * int  : 1 : 0 : Kernel<h, k>, where h is the kernel and k is level of differentiation
Transform : ImageInfo.info : 1 : 1 : Pulls transformation matrix from image.
Translate : ImageInfo.info : 1 : 1 : Pulls translation vector from image.
#
# 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
#
# VoxelAddress<I,offset>(V, i, j, ...) -- compute the address of the voxel data indexed by i, j, ...
# for non-scalar images, the offset specifies which sample and I specifies the stride.
VoxelAddress : ImageInfo.info * int : 1 : * : compute the address of a voxel
#
# VoxelAddressWithCtl<I,offset,ctl>(V, i, j, ...) -- compute the address of the voxel
# indexed by i, j, ... using the index control ctl. For non-scalar images, the offset
# specifies which sample and I specifies the stride.
VoxelAddressWithCtl : ImageInfo.info * int * idxctl : 1 : * : compute the address of a voxel
#
# LoadVoxels<I,n>(a) -- load a vector of n voxels from the address a
LoadVoxels : ImageInfo.info * int : 1 : 1 : load a vector of voxel values from an address
#
# Inside<I,s>(u,V) -- tests to see if image-space position u is inside the volume
# occupied by the image V.  I is the image info and s is the border width
Inside : ImageInfo.info * int : 1 : 2 :
#
# ImageDim<I,i>(V) -- returns the i'th dimension of the image
ImageDim : ImageInfo.info * int : 1 : 1 :
#
# nrrd file loading
LoadSeq   : ty * string : 1 : 0 : load sequence from nrrd file
LoadImage : ty * string : 1 : 0 : load image from nrrd file
#
# inputs
!Input            : input : 0 : 0 : program input
!InputWithDefault : input : 0 : 1 : program input with default value as argument
#
# printing support for debugging
!Print : tys : 0 : * : print strings

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