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/tree-ops.spec
ViewVC logotype

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3844 - (download) (annotate)
Tue May 10 19:15:03 2016 UTC (3 years, 4 months ago) by jhr
File size: 5613 byte(s)
  working in merge
# specification of operators for LowIR 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.
#
# integer arithmetic operations
IAdd : : 1 : 2 : integer addition
ISub : : 1 : 2 : integer subtraction
IMul : : 1 : 2 : integer multiplication
IDiv : : 1 : 2 : integer division
IMod : : 1 : 2 : integer modulo
INeg : : 1 : 1 : integer negation
#
# scalar arithmetic operations
RAdd : : 1 : 2 : scalar (real) addition
RSub : : 1 : 2 :
RMul : : 1 : 2 :
RDiv : : 1 : 2 :
RNeg : : 1 : 1 :
#
# RClamp(lo, hi, x) -- clamps x to the range lo..hi
RClamp : : 1 : 3 : clamp argument to range
# RLerp(a, b, t) -- computes a + t*(b-a)
RLerp : : 1 : 3 : linear interpolation between 0 and 1
#
# comparisons (integer and scalar)
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 :
#
# vector arithmetic operations (int is arity)
VAdd   : int : 1 : 2 : vector addition
VSub   : int : 1 : 2 : vector subtraction
VScale : int : 1 : 2 : vector scaling
VMul   : int : 1 : 2 : vector element-wise multiplication
VNeg   : int : 1 : 2 : vector negation
VSum   : int : 1 : 1 : sum elements of a vector
# VIndex<n,i> -- project i'th element of n-ary vector
VIndex  : int * int : 1 : 1 : project
#
# VClamp<d>(lo, hi, x) -- clamps x to the range lo..hi
VClamp : int : 1 : 3 : clamp argument to range
# VMapClamp<d>(lo, hi, x) -- clamps x[alpha] to the range lo[alpha]..hi[alpha], where
# x, lo, and hi are all d-element vectors
VMapClamp : int : 1 : 3 : clamp argument to range
# VLerp<d>(a, b, t) -- computes a + t*(b-a)
VLerp : int : 1 : 3 : linear interpolation between 0 and 1
#
### tensor operations
#
# TensorIndex<ty,idxs>(T) returns the scalar T[idxs]
TensorIndex : ty * shape : 1 : 1 :
#
### matrix operations
#
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 : all zeros tensor
#
### tuple operations
#
# Select<ty,i>(u)  -- select ith element of tuple; ty is tuple type
Select : ty * int : 1 : 1 :
#
### operations on sequences
#
# 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
# Range(lo,hi) -- create a sequence with values [lo, lo+1, ..., hi]
Range : : 2 : 1 : create a range sequence
# Length<ty> -- return the length of a sequence with type ty[]
Length : ty : 1 : 1 : return the length of a dynamic sequence
#
# SphereQuery<posType,seqTy>(??)
SphereQuery : ty * ty : 1 : 2 : find strands within a sphere
#
Sqrt   : : 1 : 1 : returns the sqrt
Cos    : : 1 : 1 : returns the cosine
ArcCos : : 1 : 1 : returns the arccosine
Sin    : : 1 : 1 : returns the sine
ArcSin : : 1 : 1 : returns the arcsine
Tan    : : 1 : 1 : returns the Tangent
ArcTan : : 1 : 1 : returns the arcTangent
Exp  : : 1 : 1 :
#
# 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
#
# reduction operations
R_All      : ty : 1 : 3 :
R_Exists   : ty : 1 : 3 :
R_Max      : ty : 1 : 3 :
R_Min      : ty : 1 : 3 :
R_Sum      : ty : 1 : 3 :
R_Product  : ty : 1 : 3 :
R_Mean     : ty : 1 : 3 :
R_Variance : ty : 1 : 4 :
#
### image operations
#
Transform : ImageInfo.info * int : 1 : 2 : Pulls transformation matrix from image.
Translate : ImageInfo.info : 1 : 2 : Pulls translation vector from image.
#
# BaseAddress<I>(V) -- the base address of image V with info I
BaseAddress : ImageInfo.info : 1 : 1 : image base address
#
# ImageAddress<I>(V) -- the base address of an image with info I
#ImageAddress : ImageInfo.info : 1 : 1 : image base address
#
# ControlIndex<I,ctl,d>(V,i) -- border control for the d'th axis of the image V and index i
ControlIndex : ImageInfo.info * idxctl * int : 1 : 2 :
#
# 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 :
#
### other operations
#
# nrrd file loading
LoadSeq   : ty * string : 1 : 0 : load sequence from nrrd file
LoadImage : ty * string : 1 : 0 : load image from nrrd file
#
# unlifted math functions
MathFn : MathFns.t : 1 : * : math function

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