Home My Page Projects Code Snippets Project Openings diderot

# SCM Repository

[diderot] View of /branches/pure-cfg/src/compiler/IL/gen/high-il.spec
 [diderot] / branches / pure-cfg / src / compiler / IL / gen / high-il.spec

# View of /branches/pure-cfg/src/compiler/IL/gen/high-il.spec

Sun May 1 17:39:37 2011 UTC (9 years, 8 months ago) by jhr
File size: 2530 byte(s)
```  Finish implementing field scaling, addition, and subtraction
```
```# specification of operators for HighIL version of the IR.  Each line (other than comments)
# specifies an operator using four fields, which are separated by ":".  The fields are
#	name
#	argument type		(optional)
#	arity
#	comment			(optional)
#
# type-indexed arithmetic operations
Add : ty : 2 :
Sub : ty : 2 :
Mul : ty : 2 :
Div : ty : 2 :
Neg : ty : 1 :
Abs : ty : 1 :
LT : ty : 2 :
LTE : ty : 2 :
EQ : ty : 2 :
NEQ : ty : 2 :
GT : ty : 2 :
GTE : ty : 2 :
Power : : 2 : raise real to integer power
Not : : 1 : boolean negation
Max : : 2 :
Min : : 2 :
# Lerp<ty>(a, b, t) -- computes a + t*(b-a)
Lerp : ty : 3 : linear interpolation between 0 and 1
#
# tensor/vector operations
#
Dot : ty : 2 :
MulVecMat : ty : 2 : vector times matrix multiplication (type is matrix type)
MulMatVec : ty : 2 : matrix times vector multiplication (type is matrix type)
MulMatMat : ty * ty : 2 : matrix times matrix multiplication
Cross : : 2 :
Outer : ty : 2 : vector outer product (type is result type)
# Norm<ty>(x) -- returns the norm of the tensor x, which has type ty
Norm : ty : 1 :
Normalize : ty : 1 :
Scale : ty : 2 : scalar*tensor multiplication
CL : : 1 : linear anisotropy measures
PrincipleEvec : ty : 2 : principle eigenvector; ty is result vector type
# Identity<n>() -- nxn identity matrix
Identity : int : 0 : identity matrix
# Zero<ty>() -- zero tensor
Zero : ty : 0 : identity matrix
# Trace<ty>(m) -- computes trace of matrix m; ty is type of matrix
Trace : ty : 1 : compute trace of matrix
Slice : ty * mask : 1 : tensor slice; type is tensor argument type
Subscript : ty : * : tensor subscript (special case of slice)
#
# conversions
IntToReal : : 1 :
TruncToInt : : 1 :
RoundToInt : : 1 :
CeilToInt : : 1 :
FloorToInt : : 1 :
#
# image/field operations
Kernel     : Kernel.kernel * int  : 0 : Kernel<h, k>, where h is the kernel and k is level of differentiation
Inside     : int		  : 2 : args are position, field
Field	   : int		  : 2 : Field<d> is d-dimension reconstructed field; args are image, kernel
Probe      : ty * ty              : 2 : Probe<domTy, rngTy>(fld, pos) probes fld at pos.